How to assign a static IP in Ubuntu 14.04

Here’s a quick post on how to statically assign an IP address in Ubuntu / Xubuntu 14.04 since it’s a little different than other Debian versions.

First, use your favorite text editor to edit the following file:

sudo vim /etc/network/interfaces

You’ll want to add the following lines.

**This is assuming your network is setup with the following 192.168.x.x configuration. You will want to adjust the IPs accordingly.

auto eth0 iface eth0 inet static address 192.168.1.xx netmask network broadcast gateway

After you assign the static IPs, you will need to specify DNS. Here’s how:

sudo vim /etc/resovlconf/resolv.conf.d/base

nameserver nameserver

Save the file.


sudo resolvconf -u

Followed by:

/etc/init.d/networking restart