IPv4 address from ifconfig differs from dhclient

Tags:

Answer: 1

4 hours ago

After replacing the DHCP server (new router) I experience a weird situation on my ubuntu server (20.04.2 LTS)

ifconfig says (old):

enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.2.165  netmask 255.255.255.0  broadcast 192.168.2.255

dhclient says (new):

DHCPACK of 192.168.10.21 from 192.168.10.1 (xid=0xcad5f460)
RTNETLINK answers: File exists
bound to 192.168.10.21 -- renewal in 1080455 seconds.

I can ping both addresses and get an answer.

dhclient -r renews the 10.21-address, but does not touch the 2.165 address

systemctl restart network-manager did not resolve the issue

Some vdr-services use the old address and gets denied. Restarting vdr did not resolve the issue.

Can I resolve this without a reboot?

Added by: Vaughn Brakus

Answer: 2

21 hours ago

I would look at deleting the old lease file:

/var/lib/dhcp/dhclient.leases

Then run the dhclient -r to re-assign the 192.168.10.21 IP address. You may also specify the network interface:

dhclient -r -v enp0s31f6

Also, once you deleted the file and removed the IP, you may want to quickly send a request to get the new IP:

dhclient -v enp0s31f6

The problem with DHCP is that it views IP addresses on a different network as possibly coming from a different DHCP. So when your DHCP client queries the server with the old address, it thinks it was assigned by a different server and it ignores all such requests instead of telling the client to delete that old IP address.

Your network mask is 255.255.255.0 which means that 192.168.2.x and 192.168.10.x are two different networks.

As a side note: you can assign many IP addresses to the same network card. (In the old days, it was as many as 65534 or so). So it is normal to see two or more addresses on the same card. It is especially used to assign an IPv4 and an IPv6 set of addresses to a card.

Added by: Wilber O'Hara

Popular Search

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9