Wrongfully assigned IP address

If you have no internet connection that may have many causes. I recently had a wrongfully assigned IP address. The computer accesses the internet through a router that assigns an IP address form 192.168.1.0/24 address range.
The first thing if the connection to the internet fails is to check the connection to the router with a ping. In my case this failed. Executing the ifconfig showed why:
ifconfig -a
The assigned IP was not in the defined range by the router. In fact it was a public IP (this might be a sign that someone unauthorised tried to gain access). It seems the IP was defined static since a restart of the system or the router had no effect.
Here is the solution:
sudo ifconfig eth0 down
sudo ifconfig eth0 up

eth0 is the network interface with the wrong IP. If you are on another distribution than Ubuntu you may not need the sudo to bring the interface down and up again.

Schreibe einen Kommentar