大佬教程收集整理的这篇文章主要介绍了centos6和7配置双网卡不能上网的问题,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
3.检查虚拟机网络的配置是否有问题
[[email protected] ~]# route del -net 0.0.0.0 [[email protected] ~]# route Kernel IP routIng table DesTination Gateway Genmask Flags Metric Ref Use Iface 192.168.65.0 * 255.255.255.0 U 0 0 0 eth0 192.168.18.0 * 255.255.255.0 U 0 0 0 eth1 link-local * 255.255.0.0 U 1002 0 0 eth0 link-local * 255.255.0.0 U 1003 0 0 eth1 [[email protected] ~]# route add gw 192.168.65.2 eth0 gw: 未知的主机 [[email protected] ~]# route add default gw 192.168.65.2 eth0 [[email protected] ~]# route Kernel IP routIng table DesTination Gateway Genmask Flags Metric Ref Use Iface 192.168.65.0 * 255.255.255.0 U 0 0 0 eth0 192.168.18.0 * 255.255.255.0 U 0 0 0 eth1 link-local * 255.255.0.0 U 1002 0 0 eth0 link-local * 255.255.0.0 U 1003 0 0 eth1 default bogon 0.0.0.0 UG 0 0 0 eth0
到此大功告成可以上外网了!
虽然现在是没问题了,但是重启了之后又不能上外网了,可以吧这个默认网关加到开机启动项里面去(或许还有别的什么方法,但是我目前还不知道!)
echo -e ‘ route del -net 0.0.0.0 2>/dev/null\n route add gw 192.168.65.2 eth0 2>/dev/null‘ >/etc/rc.d/rc.local
以上是大佬教程为你收集整理的centos6和7配置双网卡不能上网的问题全部内容,希望文章能够帮你解决centos6和7配置双网卡不能上网的问题所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。