如何在Centos7进行网络配置
1、本人不太喜欢用NetworkManager这个东西
# systemctl stop NetworkManager.service # systemctl disable NetworkManager.service
2、修改网络配置
# vi /etc/sysconfig/network-scripts/ifcfg-ens3 NM_CONTROLLED=no //原来没有加上的 TYPE=Ethernet BOOTPROTO=static //dhcp改成static DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=yes //no改成yes IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens3 UUID=851ae637-14d4-4435-9c38-d3a3e4c2f0c3 DEVICE=ens3 IPADDR=192.168.5.214 //新加上的 NETMASK=255.255.255.0 //新加上的 GATEWAY=192.168.5.2 //新加上的 ONBOOT=yes //no改成yes
3、重启网络
# service network restart
相关推荐
amethystqi 2020-05-19
summerinsist 2020-04-29
IsanaYashiro 2020-02-18
andylanzhiyong 2020-02-10
lfjjia 2020-01-08
Proudoffaith 2020-01-13
wannagonna 2020-01-05
zhongzhiwei 2019-12-19
karelcn 2019-11-12
xiefei0 2017-02-09
菜鸟上路CCLinux 2016-11-10
linuxvfast 2014-05-05
plusz 2012-09-10
yimu 2012-07-22
hongsheyoumo 2012-03-15
withwu 2011-11-11
codedecode 2011-10-06