IP Settings View command
# ifconfig-a
# NETSTAT-NR
Set a value for eth0
# Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0 #设备名ONBOOT =yes #系统启动时是否激活设备BOOTPROTO =none #固定IP: none,static dhcp:dhcphwaddr=xx:xx:xx:xx : xx:xx #地址TYPE =ethernet #接口的设备类型, and #dhcp_hostname=example.com #DHCP服务器通知主机名IPADDR such as xDSL =192.168.1.16 #IP地址NETMASK =255.255.255.0 #子网掩码 #netaddr=192.168.1.0 #网络地址, usually automatically judged by subnet masks. #BROADCAST =192.168.1.255 #广播地址, usually automatically judged by subnet masks. Userctl=no #是否允许非user用户控制设备. Peerdns=no #从DHCP取得到的DNS服务器地址是否往/etc/resolv.conf inside the reaction. In the case of DHCP use, it is usually yes. gateway=192.168.1.1 #默认网关地址IPV6INIT =no #此设备是否把IPv6有效
DNS Value setting
# vi/etc/resolv.conf
NameServer XXX.XXX.XXX. Xxxnameserver XXX.XXX.XXX.XXX
# vi/etc/sysconfig/network
networking=yesnetworking_ipv6=nogateway=192.168.1.1
# Service Network Restart
[CentOS] CentOS Setup NIC