Pages

Thursday 6 February 2014

Ubuntu Server 12.04 - network settings

I had to setup today a Ubuntu Server 12.04 virtual machine for a client with some of our products pre-installed on it. First thing was that they used IPv4 and second for some reason I was unable to resolve properly. So here is what I did and worked:

I disabled IPv6 putting the following lines in  /etc/sysctl.conf :
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

In /etc/network/interfaces I set the static IPs for the network addapters:
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.6
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

In Ubuntu Server 12.04, any changes made manually to /etc/resolv.conf will be overwritten later by a DNS information manager called resolvconf.

If you want to change the default settings, you could modify files base, head, or 
tail under /etc/resolvconf/resolv.conf.d.

base: Used when no other data can be found
head: Header of default resolv.conf. The server inside will the first ones to check.
tail: entries appended at the end of resolv.conf. In some cases, upgrading from a previous Ubuntu release, will make tail a symlink to original.

After this small changes everything worked as planed.