How to set a static IP address on Ubuntu 14.04 server (and others)

This assumes you want to set a static IP address on the network device eth0.

Open up the interfaces file

sudo nano /etc/network/interfaces

and remove or comment out the line that says

iface eth0 inet dhcp

then add the following lines in its place:

iface eth0 inet static
address [static IP address, i.e.] netmask [i.e.] network [i.e.] broadcast [i.e.] gateway [i.e.] dns-nameservers [i.e.]

Save the file and reboot the server. On some systems you may also need to update /etc/resolv.conf and /etc/hosts

1 Trackback / Pingback

  1. Static IP setup in Trusty | 0ddn1x: tricks with *nix

Leave a Reply

Your email address will not be published.