Setting up a static IP

 

Setting up a static IP address

UPDATE: I have updated this guide in more detail on my other project site which can be found here: http://draalin.com/setting-up-a-static-ip-address-in-ubuntu/

First of all setting up a static IP address in Ubuntu sever is very easy!
By default your /etc/network/interfaces file will look like this with dhcp already enabled.

sudo vi /etc/network/interfaces

setting up a static ip address in ubuntu server help

Lets say for example we want to configure our network for:

IP address of 192.168.1.100 (What you want the IP of your ubuntu machine to be)
default mask of 255.255.255.0 (also called /24 – You typically don’t change this)
gateway 192.168.1.1 (This is most likely your home router’s IP address by default)
network 192.168.1.0 (So it knows what network to run on)
broadcast 192.168.1.255 (Where do send  its “I don’t know where to go” messages)
dns-nameservers 192.168.1.1 (Will use the DNS server your router uses)

setting up a static ip address in ubuntu server help

Now lets restart our network service to ensure

sudo /etc/init.d/networking restart

 

Extra

  • I recommend doing this at the terminal itself and not through putty or some other program. Nothing like losing access to something 20 miles away!
  • If you have DNS issues I recommend using Google’s 8.8.8.8 or 8.8.4.4 over leaving it empty and using you’re local ISP’s.
  • If you would like a more in depth guide of setting up a static IP address I recommend you going straight to Ubuntu’s website here
Latest Comments
  1. Ranting Rantor October 8, 2012
  2. Nick Ace March 5, 2013
  3. tuulia April 30, 2013
    • draalin May 2, 2013

Leave a Reply

Your email address will not be published. Required fields are marked *