Edit /etc/network/interfaces
# This file describes the network interfaces available on your system # and how to activate them. For information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet dhcp
Comment out the “iface eth0 inet dhcp
” line, and add
... iface eth0 inet static address <desired static IP address> netmask <mask (e.g. 255.255.255.0)> network <network (e.g. 192.168.1.0)> broadcast <network broadcast address (e.g. 192.168.1.255)> gateway <network (e.g. 192.168.1.1)>
Save the file and restart networking
sudo /etc/init.d/networking restart
One thought on “Ubuntu Static IP”