根据网上几篇博客,乱搞,终于可以上内外网了。
这里只记录最后解决上网的问题,前面遇到过NetworkManger.service与network.service冲突,network.service重启失败等问题
ifcfg-enp0s3 外网
TYPE="Ethernet" BOOTPROTO="dhcp" 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="enp0s3" UUID="1605d065-205d-424d-8031-7e938077f949" DEVICE="enp0s3" ONBOOT="yes" PEERDNS=yes PEERROUTES=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yesifcfg-enp0s8 内网
TYPE=Ethernet BOOTPROTO=static DEFROUTE=no IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME="enp0s8" UUID=78d94423-c3c8-4fee-9e06-670d9c2a736a ONBOOT=yes IPADDR=192.168.56.106 PREFIX=24 GATEWAY=192.168.56.1 IPV6_PEERDNS=yes IPV6_PEERROUTES=yes HWADDR=08:00:27:c9:11:24cd /etc/sysconfig/network-scripts vim ifcfg-enp0s8
通过查看配置,发现ifcfg-enp0s3和ifcfg-enp0s8都设置默认路由了,把ifcfg-enp0s8设置为no后问题解决
参考:
https://blog.51cto.com/lefteva/1917981
https://blog.csdn.net/dongfei2033/article/details/81124465
https://blog.csdn.net/beatlinux/article/details/104587653