配置 host only 后 nat不能上网了

如果只有nat 网关为nat 中设置的网关  eth0

启动第二块网卡host_only 网关就变成了 host_only中的网关  eth1

解决放法 

route -n 看启用的是哪个网关

[root@localhost ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window irtt Iface
172.16.44.0     0.0.0.0          255.255.255.0    U         0      0          0 vmnet8
172.16.10.0     0.0.0.0          255.255.255.0        U         0      0          0 vmnet1
172.16.0.0       0.0.0.0          255.255.252.0        U         0      0          0 eth0
169.254.0.0     0.0.0.0          255.255.0.0           U         0      0          0 eth0
0.0.0.0         172.16.0.254(网关)    0.0.0.0           UG        0      0          0 eth0

查看你的网关

在nat 的eth0 中配置GATEWAY 即可

取消 host_only 的 eth1 中取消配置GATEWAY

service network restart

原文地址:https://www.cnblogs.com/zhaoyang-1989/p/5800850.html