Ubuntu Tip of The Week: Configuring Static IP Addressing ~ Ask The Admin

Thursday, May 15, 2008

Ubuntu Tip of The Week: Configuring Static IP Addressing

Hello fellow geeks and geekette's! It is I, El Di Pablo back with another quick Ubuntu tip. I thought of this because I am working on creating an Ubuntu 8.04 VMWare GSX server for my company. I figured I might as well write about it on aTa while it is still fresh in my mind.

As with most servers, you want to configure it for static IP addressing to make life a little more simple for everybody. Linux servers are no exception. The only trouble with some flavors of Linux servers is that they are strictly command line for less overhead and better performance. So how does one configure Ubuntu server for static IP addressing in the terminal you ask? Simple:

  1. First you need to edit /etc/network/interfaces using your favorite text editor (I like nano):

    sudo nano /etc/network/interfaces

  2. Next you need to enter your static IP information:

    #The primary network interface
    auto eth0
    iface eth0 inet static

  3. Save your changes.
  4. Now you need to point your server to your DNS server. To do this, you need to edit /etc/resolv.conf:

    sudo nano /etc/resolv.conf

    name server xxx.xxx.xxx.xxx (Replace the x's with the IP address of your DNS server)

  5. Save your changes, then restart your network:

    sudo /etc/init.d/networking restart

  6. Now test it by pinging www.asktheadmin.com. If all went well, you should be all set!

Have you had to set up a production Ubuntu server in your environment? Tell us about your experience in the comments!

By: El Di Pablo of Bauer-Power