Network Card configuration file Description:
# Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0 (describes the device alias for the NIC, for example, it is eth0 in the Ifcfg-eth0 file)
Bootproto=static (Sets the way the network card obtains an IP address, the possible options are static,dhcp or BOOTP, respectively, corresponding to the static specified IP address, IP address obtained through the DHCP protocol, IP address obtained through the BOOTP protocol)
broadcast=192.168.0.255 (corresponding subnet broadcast address)
HWADDR=00:07:E9:05:E8:B4 (the corresponding network card physical address)
ipaddr=12.168.1.2 (This field specifies the IP address of the NIC if the IP address is specified statically for the network card)
Ipv6init=no (Turn IPv6 on or off; turn off no, turn on Yes)
Ipv6_autoconf=no (turn on or off the IPV6 automatic configuration; Turn off no, turn on Yes)
gateway=192.168.1.1 (Configure Gateway)
netmask=255.255.255.0 (Network mask corresponding to NIC)
network=192.168.1.0 (network address corresponding to the NIC)
Onboot=yes (If this network interface is set at system startup and set to Yes, this device is activated when the system starts)
Service Network Restart re-activating the NIC
Modify the DNS configuration file for the corresponding NIC
# vi/etc/resolv.conf
Modify the following content
NameServer 8.8.8.8 #google域名服务器
Temporary network address configuration (restart failure): ifconfig eth0 192.168.1.254netmask 255.255.255.0
Start/Close off network card: ifconfig eth0 Up/down
Permanent address configuration Modify configuration file/etc/sysconfig/network-scriprit/ifcfg-eth0
Set multiple IPs for a network card
Ifconfig eth0 xxxxxxx
Ifconfig eth0:0 xxxxxxx
View the routing table route-n
Gateway for 0.0.0.0 means direct transfer from native
Add Delete route: Route add/del-net xxxxx Netmaskxxxxxx Dev Ethx
Linux Network routing configuration