来宾CentOS VM (VirtualBox):
[root@localhost network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.0.2.2 0.0.0.0 UG 0 0 0 eth0
10.0.2.0 * 255.255.255.0 U 0 0 0 eth0
10.0.4.0 * 255.255.255.0 U 0 0 0 eth2
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
link-local * 255.255.0.0 U 1004 0 0 eth2
192.168.56.0 * 255.255.255.0 U 0 0 0 eth110.0.2.0/24网络和10.0.4.0/24网络上的接口配置了NAT,而192.168.56.0/24网络上的接口配置为纯主机。当我连接到互联网时,我认为我是通过10.0.2.0网络连接的--有什么方法可以验证这一点吗?另外,我也不知道10.0.2.2网关是从哪里来的.我不能打开10.0.2.1,因为我认为它应该是网关。
第二,在添加10.0.4.0网络之后,有没有办法通过这个连接到互联网?网关是什么? 4.1不起作用。
如果问题不清楚,我很抱歉,我搞不懂用什么命令/方向去找出信息。
发布于 2014-10-06 11:30:47
首先,是的,你的虚拟机通过10.0.2.2连接互联网,因为它有"UG“标志。其次,您可以通过设置默认网关来更改它,无论您想要什么,您都必须找到网关ip地址,然后使用下面的命令更改它。
# route add default gw 10.0.4.2我假设您的网关是10.0.4.2,但是您可以在主机的设置中检查您的网关。
https://serverfault.com/questions/633816
复制相似问题