十九、CentOS7安裝
阿新 • • 發佈:2018-12-17
CentOS7安裝
設定ip地址:
[[email protected] ~]$ cd /etc/sysconfig/network-scripts/
[[email protected] network-scripts]$ vim ifcfg-ens33
TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static 設定 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=ens33 UUID=8ef810b1-afaa-493d-906c-a7357bbf5456 DEVICE=ens33 ONBOOT=yes IPADDR=92.168.1.127 新增 GATEWAY=192.168.1.2 新增 DNS1=192.168.1.2 新增
重啟服務:
[[email protected] network-scripts]# service network restart
Restarting network (via systemctl): [ 確定 ]
測試:
[[email protected] network-scripts]# ping www.baidu.com PING www.baidu.com (14.215.177.39) 56(84) bytes of data. 64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=1 ttl=128 time=112 ms 64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=2 ttl=128 time=29.4 ms 64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=3 ttl=128 time=47.1 ms 64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=4 ttl=128 time=30.1 ms