CentOS配置IP和DNS
IP配置
1 2 3 4 5 6 7 |
shell>#vim /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.0.3 NETMASK=255.255.255.0 GATEWAY=192.168.0.1 |
使IP地址生效:
1 |
shell>#service network reload |
DNS配置
1 2 3 |
shell>#vim /etc/resolv.conf nameserver 100.100.2.138 nameserver 100.100.2.136 |
通知网关更新信息
1 |
shell>#service network restart |