Skip to main content

Static IP Address on Ubuntu 12.04

By October 2, 2013September 12th, 2022No Comments

The address configuration of Ubuntu tends to be a little different from other Linux distros; typically you would expect a individual configuration file for each interface in systems such as CentOS, RedHat and SUSE. With Ubuntu the configurations are combined into a single file,/etc/network/interfaces

During the install DHCP will be configured for you network connection but we can change this a letterly to a static IP address. To do this we would edit the /etc/network/interfaces and change the entry for the NIC to static from dhcp.

Once changed to static we must, of course configure the address information:

iface eth0 inet static

Note: that we will now configure the DNS information in each network stanza to allow for different DNS servers based on different types of connections, ie LAN, wireless and 3G. This is preferred over setting single entries in the /etc/resolv.conf