🌑

Linhost.info

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.

1
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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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.

1
sudo service networking restart

— Feb 15, 2015