Releasing And Renewing Your IP Address In Ubuntu
With Ubuntu it is important (as it is in XP) to know certain network command functions. When most people have a problem with their router, cablemodem or DSL modem, they simply reboot the computer to renew the IP address. You do not have to do this. Instead you can simply shut down the network interface and restart it.
ifconfig is the command used in Ubuntu at the command line (better known as the terminal in GNOME) to not only find out what your IP address is, but also to disable/enable network interfaces if need be.
To see your current IP, just type ifconfig and press enter. You will see a list of network interfaces. On a wired connection, the first (and probably only) network card listed is usually eth0 (that’s a zero at the end, not letter O).
We’ll say for the moment your router had a screw-up and you had to restart it, so you need your computer to request its IP address back.
Releasing (down) and Renewing (up)
The release/renew commands from ifconfig are simply down and up.
We put a sudo in front of ifconfig to grant administrator privileges, and it all comes together like this:
sudo ifconfig eth0 down (shuts down the eth0 interface, releases the IP)
sudo ifconfig eth0 up (enables the eth0 interface, renews the IP)
And yes, you do have to use sudo both times.
Why know this? It saves time. Downing the network interface and "upping" it again is quicker than a reboot – especially for those of you out there with not-so good routers.