Static IP with DHCP-Assigned DNS on Ubuntu 9.10
Posted on December 3rd, 2009 by Paul
There is a ton of bug reports regarding the Network-Manager’s nm-applet not properly configuring static ips. There are, and always have been, bugs in the nm-applet, in each of its versions. In short, getting a static ip with dhcp assigned DNS parameters requires editing the /etc/dhcp3/dhclient.conf file. Here we go.
sudo vi /etc/dhcp3/dhclient.conf>> alias { interface "eth0"; fixed-address 192.168.1.101; option subnet-mask 255.255.255.255; } <<sudo dhclient -rsudo dhclient
EDIT FOR Ubuntu Server 11.04 (Reference)
$ sudo vi /etc/network/interfaces
Append the following configuration:
auto eth0:0 iface eth0:0 inet static address 192.168.1.101 netmask 255.255.255.0 broadcast 192.168.1.255 network 192.168.1.0
$ sudo /etc/init.d/networking restart
