Ubuntu Reference Guide

part of the WillPowered Inc. network
© 2011 William Hall <5/> - This site uses HTML5


Most people will want automagic networking and will never need or want to fiddle with it but occasionally things are different.

If fiddling with the network manager in your tray doesn't help, its probably broken and needs removing so you can manually set it up.

$ sudo apt-get remove network-manager-gnome network-manager

Now check that your interfaces are working with the ifconfig command. If you see eth0 and lo in the output then all is well.

You can now edit the interfaces file

$ sudo nano /etc/network/interfaces

Your interfaces file should always contain the following lines at the start unless there is a very good reason.

auto lo iface lo inet loopback

DHCP lines for eth0 are:

auto eth0 iface eth0 inet dhcp

Static IP lines for eth0 are:

auto eth0 iface eth0 inet static address netmask gateway

If you happen to use PPPoE then you want lines like this:

auto eth0 iface eth0 inet manual auto dsl-provider iface dsl-provider inet ppp pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf provider dsl-provider

For PPPoE you also want to run pppoeconf.

Now you should check the DNS settings in resolv.conf.

$ sudo nano /etc/resolv.conf

You can have up to three addresses entered in the following format.

nameserver nameserver

Once you are happy with everything, you can restart the networking with the following:

$ sudo /etc/init.d/networking restart

Reference here