I'm investigating an issue with a Ubuntu server acting as the Internet gateway for a branch office stopped working after being switched to a new Internet connection.
The IP address on the external interface is acquired from the ISP router via DHCP.
When the interface was disconnected from the old line and connected to the new one, there was no Internet connectivity. Checking the log, I found that the Ethernet link on the interface had come up but was still trying to use the IP address it had been using on the old line.
There weren't any dhclient
log entries after the Link is Up
message.
The way I understand DHCP, if the link on an Ethernet interface is going down and up again, the machine should assume that it might have been moved to a different network segment, and consequently try to reacquire its IP address before using it again.
Am I wrong?
you need to run
sudo dhclient <ethernet interface id>
ex: sudo dhclient eth0
Also check this out!