How to assign a static IP address in Ubuntu

L'Antre du Tryphon

schedule
2014-02-22 | 22:28h
update
2014-02-22 | 22:32h
person
www.ctheroux.com
domain
www.ctheroux.com

How to assign a static IP address in Ubuntu

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

Advertisement

Imprint
Responsible for the content:
www.ctheroux.com
Privacy & Terms of Use:
www.ctheroux.com
Mobile website via:
WordPress AMP Plugin
Last AMPHTML update:
06.04.2024 - 03:36:00
Privacy-Data & cookie usage: