CentOS Network Configuration Network configuration
-bash-4.1# Setup #如果没有setup命令, the Setup command can also be installed with yum install setuptool-y
http://jingyan.baidu.com/album/25648fc1a303ce9191fd0032.html?picindex=2
-bash-4.1# Yum Install Setuptool
Then enter your own IP address, subnet mask, gateway, etc., if you use the graphical interface set or not be able to take effect static IP, please change the file bootproto=static
Ifconfig-a
Ifup Etho Enable network 0 network connection
Ifdown eth0 Disable 1 nic
[email protected] ~]# Cat/etc/sysconfig/network-scripts/ifcfg-eth0 #这个文件是自动获取IP, you only need onboot=yes Yes Yes
Device=eth0
Hwaddr=00:0c:29:79:38:bb
Type=ethernet
uuid=31b2e3cb-096e-41a8-a6aa-da6db0935222
Onboot=yes
Nm_controlled=yes
Bootproto=dhcp
[Email protected] ~]# Cat/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0
Hwaddr=00:0c:29:79:38:bb
Type=ethernet
uuid=31b2e3cb-096e-41a8-a6aa-da6db0935222
Onboot=yes
Nm_controlled=yes
Bootproto=none #也可以bootproto=static
ipaddr=192.168.1.7
netmask=255.255.255.0
dns2=114.114.114.114
gateway=192.168.1.1
dns1=202.96.134.133
Ipv6init=no
Userctl=no
[email protected] ~]# cat/etc/resolv.conf #dns配配置文件
CentOS Network Configuration