Configuration of the Linux network
First, configure the network
Vi/etc/sysconfig/network Configuring the Network
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Device= "eth0:0"
Ipaddr= "192.168.1.100"
netmask= "255.255.255.0"
Second, modify the gateway
Vi/etc/sysconfig/network
Networking=yes
Hostname=aaron
gateway=192.168.1.1
Third, modify the DNS
The configuration file is below/etc/resolv.conf.
Vi/etc/resolv.conf
NameServer 202.109.14.5 #主DNS
NameServer 219.141.136.10 #次DNS
Search Localdomain
Four, restart the network (four methods)
1:root Account # Service Network restart
2:#/etc/init.d/network Restart
3:# Ifdown eth0
# ifup Eth0
4:# ifconfig eth0 Down
# ifconfig eth0 up
View the IP information of this machine ifconfig equivalent to the ipconfig of window
Check to see if the network is through. By pinging the IP address
VI Command
: Save the current file
: E filename: Open file filename for editing
: x: Save the current file and exit
: Q: Exit VI
: q!: Do not save the file and Exit VI