1, server version
Set IP address
Ubuntu 12.04 's network settings file is/etc/network/interfaces, open the file and you will see
Auto lo
iface lo inet loopback
The setting here is the local loop. Add in the back
Auto eth0
iface eth0 inet static
address 192.168.1.230 (IP)
netmask 255.255.255.0 (subnet mask)
Gateway 192.168.1.1 (Gateway)
Eth0 is the computer network card, if the computer has more than one network card, such as there will be eth1, can be set up here. Iface eth0 inet set to DHCP is dynamically acquiring IP, set to static with a custom IP. Here to customize the IP address, so select the static option.
Restart Network Services
sudo/etc/init.d/networking restart
Restart good, with ifconfig look down eth0, is not changed to their own needs of the IP address.
Setting up DNS
IP settings, if the direct ping www.baidu.com will find ping impassability, because DNS has not been set up, edit/etc/resolv.conf, plus the DNS server address.
NameServer 8.8.8.8
nameserver 8.8.4.4
These two are the IP addresses of the free DNS servers provided by Google.
Ps1:ping hint, connect:network is unreachable, mostly gateway problem
sudo route add default GW 192.168.1.1
ps2:ping hint,ping: Unknown host baidu.com
Vi/etc/resolv.conf
#增加以下两行, specific IP please fill in the actual
NameServer 192.168.1.1
2, desktop version
The Desktop Edition provides Network-manage management tools that can be managed directly through the interface.
Click on the top right corner of the network icon, edit the connection, add new connections. My settings screenshot as follows, you can make changes according to your needs.
Ubuntu 12.04 Desktop Network Settings-Select the network card
Ubuntu 12.04 Desktop Network Settings-set IP http://www.01happy.com/ubuntu-12-04-network-setting/