|
|
最简单的方案 : NAT(by VirtualBox)
Host :
直接使用VirtualBox提供的NAT功能.
Guest :
网卡设置为使用DHCP.
Guest -> WAN :
由VirtualBox的NAT提供WAN的访问服务.
Guest -> Host :
需要注意的是, 如果直接访问Guest拿到的网关IP, 会发现这个IP似乎是Host. 不过事实上不能直接访问网关IP来访问Host. 因为这个IP是由VirtualBox负责的, 只实现了NAT的功能, 其他的一些功能并不能正常运行(如FTP). 如果要访问Host, 应该访问Host的真实IP.
Host -> Guest :
不可访问. 虽然VirtualBox的NAT功能中包括了Port Forwarding的功能, 但截至到1.3.6 Snapshot, 这个功能仍没有出现在GUI中. 不过在OSE Version中已经可以使用这个功能. 通过Port Forwarding可以实现部分的向内访问.
VirtualBox NAT没有什么玩法了. 下面的方案都是使用VirtualBox的Host Interface功能.
我是按照这个配置的啊.........
但是默认装的gentoo没有dhcp client ...
我虚拟gentoo , ip手动配置
10.10.10.100 网关10.10.10.1
真实机器两个ip
eth0 Link encap:Ethernet HWaddr 00:16:76:21:20:19
inet addr:192.168.0.225 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::216:76ff:fe21:2019/64 Scope ink
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:739059 errors:0 dropped:0 overruns:0 frame:0
TX packets:275692 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:469128299 (447.3 Mb) TX bytes:31377774 (29.9 Mb)
eth0:1 Link encap:Ethernet HWaddr 00:16:76:21:20:19
inet addr:10.10.10.1 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:739059 errors:0 dropped:0 overruns:0 frame:0
TX packets:275692 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:469128299 (447.3 Mb) TX bytes:31377774 (29.9 Mb)
lo Link encap ocal Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:37 errors:0 dropped:0 overruns:0 frame:0
TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2924 (2.8 Kb) TX bytes:2924 (2.8 Kb)
localhost net #
但是虚拟gentoo ping不通真实机器............
请问什么地方出了问题,谢谢....... |
|