First, the network card address configuration
The Ubuntu network configuration file is:/etc/network/interfaces
1. Configure the NIC in DHCP mode
Auto Eth0
Iface eth0 inet DHCP
Use the sudo/etc/init.d/networking Restart command to make the network settings effective
2. Configure a static IP address for the NIC
sudo vi/etc/network/interfaces
Auto Eth0
Iface eth0 inet Static
Address 192.168.1.100
Netmask 255.255.255.0
Gateway 192.168.1.1
sudo/etc/init.d/networking restart
3. Set a second IP address (virtual IP address)
sudo vi/etc/network/interfaces
Auto Eth0:1
Iface eth0:1 inet Static
Address 192.168.1.101
Netmask 255.255.0
Gateway 192.168.1.1
sudo/etc/init.d/networking restart
4. Set the host name (hostname)
Use the following command to view the host name of the current host:
Sudo/bin/hostname
Use the following command to set the current host name:
Sudo/bin/hostname newname
5. Configure DNS
(1) Add some host names and the IP addresses of these host names in/etc/hosts, this is the static query of this machine
(2)/etc/resolv.conf
NameServer *.*.*.*
Original address: http://blog.chinaunix.net/uid-656828-id-3098797.html
"Go" ubuntu NIC configuration