CentOS网络配置
1. # vi /etc/sysconfig/network-scripts/ifcfg-eth0
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-em1 DEVICE=em1 BOOTPROTO=none HWADDR=00:A0:D1:EA:F0:E4 IPV6INIT=yes IPV6_AUTOCONF=yes NM_CONTROLLED=yes ONBOOT=yes TYPE=Ethernet UUID="467384d9-bc11-4a27-a15e-1d1d9d42fe4b" DNS1=172.16.0.10 USERCTL=no IPADDR=172.16.2.10 NETMASK=255.255.0.0 GATEWAY=172.16.0.10
第二步
# vi /etc/sysconfig/network NETWORKING=yes HOSTNAME=localhost
第三步
# vi /etc/resolv.conf ; generated by /sbin/dhclient-script nameserver 172.16.0.10 search localhost
第四步
4. # vi /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
第五步、重启网络设置使其生效:
service network restart
第六步、关闭防火墙
chkconfig iptables off
service iptables stop
安利一个不错的资源分享平台:快速进入