The default network setting in Ubuntu (or Debian) is to use DHCP. Often, however, it is desirable to use a static IP address and settings. To change your network configuration from DHCP to static follow these steps.
Open a terminal session and enter:
sudo nano /etc/network/interfaces
Two network interfaces should be listed, lo and eth0:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
iface lo inet loopback
# The primary network interface
iface eth0 inet dhcp
Change eth0 to your desired settings, such as:
iface eth0 inet static
Save the file and close using Ctl+X, Y, Enter.
Restart the network to apply the new setting, with this command:
sudo /etc/init.d/networking restart
Verify your network settings with: