Tuesday, December 9, 2014

Ubuntu Server 14.04 - Config static IP address

Ubuntu 14.04 no longer allows you to edit "/etc/resolv.conf directly". Instead, you have to modify "/etc/resolvconf/resolv.conf.d/" head or tail. But it will be easiest to set this along side your ethernet config, in my opinion.

You need to edit the file "/etc/network/interfaces":

1
sudo  vi /etc/network/interfaces

Then change to include the following:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
#iface lo inet interface
iface eth0 inet static
address 192.168.1.200
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255
dns-nameservers 8.8.8.8 8.8.4.4

Finally, restart your ethernet
1
ifdown eth0 && ifup eth0

0 comments:

Post a Comment