How to assign a static IP address in Ubuntu

By ctherouxNo Comments

Setting a static IP address in Ubuntu involves editing /etc/network/interfaces. If the interface is currently using DHCP, you will find these lines in the file.

auto lan
iface lan inet dhcp

You will have to replace the above lines with a section that looks like:

auto lan
iface lan inet static
address 192.168.1.80
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.200
dns-nameservers 8.8.8.8

Make the changes effective by either rebooting or by issuing this command:

sudo /etc/init.d/networking restart

Linux, Ubuntu, Ubuntu 11.04, Ubuntu 11.10, Ubuntu 12.04, Unix

Blue Taste Theme created by Jabox