centos7 网络配置_centos7最小化安装之后网络配置

1df73b115a05467a98d73b9eec7b95fd.png

1.进入目录 cd /etc/sysconfig/network-scripts

2.找到ifcfg-ens33文件,有可能不通,寻找ifcfg-开头的文件

3.编辑ifcfg-ens33

TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=dhcpDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=ens33UUID=2e718c8b-82c3-44b6-8b47-c13ab29a826bDEVICE=ens33ONBOOT=yes

4.将ONBOOT = no 改为 ONBOOT = yes

5.重启网卡

 service network restart

6.用 ifocnfig 查看ip地址

ens33: flags=4163 mtu 1500 inet 192.168.184.128 netmask 255.255.255.0 broadcast 192.168.184.255 inet6 fe80::df42:1f5b:eaa8:2611 prefixlen 64 scopeid 0x20 ether 00:0c:29:b3:a7:36 txqueuelen 1000 (Ethernet) RX packets 31235 bytes 45545507 (43.4 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 12671 bytes 806181 (787.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 220 bytes 19080 (18.6 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 220 bytes 19080 (18.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

7. 检查网络,成功ping网络

[root@localhost network-scripts]# ping www.baidu.comPING www.a.shifen.com (115.239.210.27) 56(84) bytes of data.64 bytes from 115.239.210.27 (115.239.210.27): icmp_seq=1 ttl=128 time=3.33 ms64 bytes from 115.239.210.27 (115.239.210.27): icmp_seq=2 ttl=128 time=5.25 ms64 bytes from 115.239.210.27 (115.239.210.27): icmp_seq=3 ttl=128 time=4.75 ms
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值