Network Configuration in Ubuntu GNU / Linux

How to set up a network in Ubuntu Linux?

Information about the network settings in the file / etc / network / interfaces. Settings are very clear:

#sudo nano /etc/network/interfaces
auto lo
iface lo inet loopback# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1

Configuring hosts:

# sudo nano /etc/resolv.conf
nameserver 192.168.1.1
nameserver 8.8.8.8

Configuring hosts:

# sudo nano /etc/hosts

Reload this network:

# sudo /etc/init.d/networking restart