Change Ubuntu server from DHCP to a static IP address

1. Open interfaces file for editing:

sudo nano / etc/network/interfaces

2. Change interfaces file contents to:

auto eth0
iface eth0 inet static
address 192.168.10.15
netmask 255.255.255.0
network 192.168.10.0
gateway 192.168.10.1
dns-nameservers 192.168.10.1 8.8.8.8

You will have to change the IP addresses and the interface(eth0) depending on you network and hardware configuration.

3. Restart networking

sudo service networking restart

or
3.1. Reboot the machine

sudo reboot now
Categories: Linux Tags: , , ,
%d bloggers like this: