Main Content

Ubuntu Server 14.04 Static IP configuration

In order to set up static IP configuration in Ubuntu 14.04 you need to edit the /etc/network/interfaces file.

sudo nano /etc/network/interfaces

You can remove the content referring to the previous DHCP configuration and add the parameters below. Change the addresses below to fit your needs.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0

# Static IP configuration
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 8.8.4.4

You don’t have to restart the system instead restart the networking service.

sudo service networking restart