centos6 和 centos7 网络配置
centos 6配置,
1
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0" BOOTPROTO="static" HWADDR="00:0C:29:67:55:C1" IPV6INIT="yes" NM_CONTROLLED="yes" ONBOOT="yes" TYPE="Ethernet" UUID="7f53405d-079b-4f36-b880-adb8f8af7995" IPADDR=192.168.203.129 NETMASK=255.255.255.0 GATEWAY=192.168.203.2 DNS1=114.114.114.114 DNS2=180.76.76.76
2,service network restart
centos7 网络配置
1,vim /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="eth0"
UUID="790efb13-d4fe-4671-b596-e62d48ea127b"
DEVICE="eth0"
ONBOOT="yes"
IPADDR="192.168.40.14"
PREFIX="24"
GATEWAY="192.168.40.254"
DNS1="192.168.40.5"
DNS2="180.76.76.76"
IPV6_PRIVACY="no"
2,systemctl restart nework