My Ubuntu Server computer suddenly loses a static IP address assigned to it and a routing table.
My environment is as follow.
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
A DHCPv4 is disabled on my router which has a DHCP server feature, and it is enanled on my Ubuntu Server with Dnsmasq instead.
As I have checked a DHCP lease on my Ubuntu Server, itself is not included. So it seems that a DHCP lease is not related on this problem. And the time at which this happens seems to be completely at random.
I have set up a static IP address via /etc/netplan
. My configuration /etc/netplan/99_config.yaml
is as follow.
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses:
- 192.168.3.2/24 # IPv4 private address
- XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX/64 # IPv6 global unicast address
gateway4: 192.168.3.1 # My router’s private address
gateway6: fe80::XXXX:XXXX:XXXX:XXXX # My router’s link local unicast address
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
And I have checked whether a static IP address is set correctly by a command ip a
.
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
inet 192.168.3.2/24 brd 192.168.3.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::XXXX:XXXX:XXXX:XXXX/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
I also have checked a routing table.
default via 192.168.3.1 dev eth0 proto static
192.168.3.0/24 dev eth0 proto kernel scope link src 192.168.3.2
It appears that there are no problems. However, after a couple of days or a couple of weeks, my Ubuntu Server loses a static IP address and a routing table suddenly despite the settings appear to be right.
At this time, my other computer sends an ICMP echo request to my router, and then it can receive an echo reply. But ofcourse it can’t from my Ubuntu Server. Thus my router and my other computer seem to be alive, only my Ubuntu Server has some problems.
How can I fix this problem? Any help would be greatly appreciated! Please let me know if you need more information to solve this.
Thank you.