Dave Perrett

Configure Ubuntu W/ Static IP

linux, quickie, security, web

Ubuntu Enterprise 6 seems to install as DHCP out-of-the-box. To change to a static ip, open the file /etc/network/interfaces. It should contain some lines like :

1
2
auto eth0
iface eth0 inet dhcp

Change this to something like :

1
2
3
4
5
6
7
auto eth0
iface eth0 inet static
address xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
network xxx.xxx.xxx.xxx
broadcast xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx

where xxx.xxx.xxx.xxx are the appropriate IP addresses for your network. To restart the networking service, run :

1
$ sudo /etc/init.d/networking restart