First, you need to modify the default attribute of IPV6. Ubuntu12.04 uses IPV6 by default. In this way, you cannot PING the host in the LAN. For details about setting ipv4 in Ubuntu, refer
First, you need to modify the default attribute of IPV6. Ubuntu 12.04 uses IPV6 by default, so that the host cannot be pinged in the LAN.
Ubuntu setting ipv4 see http://www.linuxidc.com/Linux/2012-07/64812.htm
Edit the/etc/network/interfaces and/etc/resolv. conf files. The former sets IP addresses, gateways, and subnet masks, and the latter sets dns and other attributes.
Example:
1. Configure the NIC in DHCP Mode
Edit the file/etc/network/interfaces:
Cp/etc/network/interfaces. bk (back up)
Sudo vi/etc/network/interfaces
Replace eth0 with the following rows:
# The primary network interface-use DHCP to find our address
Auto eth0
Iface eth0 inet dhcp
Run the following command to make the network settings take effect:
Sudo/etc/init. d/networking restart
You can also enter the following command in the command line to obtain the address.
Sudo dhclient eth0
I add:
Ifconfig eth0 command to view IP Address
2. configure a static IP address for the NIC
Edit the file/etc/network/interfaces:
Sudo vi/etc/network/interfaces
Replace eth0 with The following rows: # The primary network interface
Auto eth0
Iface eth0 inet static
Address 192.168.3.90
Gateway 192.168.3.1
Netmask 255.255.255.0
# Network 192.168.3.0
# Broadcast 192.168.3.255
Replace the preceding IP address and other information with your own. Use the following command to make the network settings take effect:
Sudo/etc/init. d/networking restart