Open the network interfaces file:

sudo vi /etc/network/interfaces

DHCP configuration:

auto eth0
iface eth0 inet dhcp

Static configuration:

auto eth0
iface eth0 inet static
address 192.168.20.56
netmask 255.255.255.0
network 192.168.20.0
broadcast 192.168.20.255
gateway 192.168.20.1
dns-nameserver 8.8.8.8 8.8.4.4

Restart the networking service:

sudo /etc/init.d/networking restart

Leave a Reply