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

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.

Free eBook!

Like what you read?

If so, please join over 28,000 people who receive our exclusive weekly newsletter and computer tips, and get FREE COPIES of 5 eBooks we created, as our gift to you for subscribing. Just enter your name and email below:

Post A Comment Using Facebook

Discuss This Article (Without Facebook)

5 comments

  1. You can also do it with one command:

    sudo /etc/init.d/networking restart

    This will restart the network using the values in /etc/network/interfaces

  2. Debianero Rumbero /

    I don’t know in Ubuntu but in Debian you can use ifup and ifdown commands.

  3. How about “dhclient wlan0″ or “dhclient eth0″.

  4. megario /

    Make sure that you verify your IP on a site like http://www.ip-adress.com

    Sometimes there are problems with the renew procedure.

  5. Borgulas /

    Thank you. Solved my internetz

Leave a Reply

PCMech Insider Cover Images - Subscribe To Get Your Copies!
Learn More
Every week, hundreds of tech enthusiasts, computer owners
and geeks read The Insider, the digital magazine of PCMech.

What’s Your Preference?

Daily Alerts

Each day we send out a quick email to thousands of PCMECH readers to notify them of new posts. This email is just a short, plain email with titles and links to our latest posts. You can unsubscribe from this service at any time.

You can subscribe to it by leaving your email address in the following field and confirming your subscription when you get an email asking you to do so.

Enter your email address for
Daily Updates:

Weekly Newsletter

Running for over 6 years, the PCMECH weekly newsletter helps you keep tabs on the world of tech. Each issue includes news bits, an article, an exclusive rant as well as a download of the week. This newsletter is subscribed to by over 28,000 readers (many who also subscribe to the other option) - come join the community!

To subscribe to this weekly newsletter simply add your email address to the following field and then follow the confirmation prompts. You will be able to unsubscribe at any time.

Enter your email address for
Free Weekly Newsletter: