歡迎您光臨本站 註冊首頁

VMware.Workstation.v5的host-only方式上外網問題

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

VMware.Workstation.v5的host-only方式上外網問題

我的是redhat9 host + win2000pro guest 使用host-only方式,內網是通了,但guest上不了外網.我現在把我的設置貼出來,希望各位大俠幫忙看看,錯在哪裡了.

1.使用vmware-config.pl配置VMware
root@seaman-yang root]# /usr/bin/vmware-config.pl
Making sure services for VMware Workstation are stopped.

Stopping VMware services:
   Virtual machine monitor                                 [  確定  ]
   DHCP server on /dev/vmnet1                              [  確定  ]
   Host-only networking on /dev/vmnet1                     [  確定  ]
   DHCP server on /dev/vmnet8                              [  確定  ]
   NAT service on /dev/vmnet8                              [  確定  ]
   Host-only networking on /dev/vmnet8                     [  確定  ]
   Virtual ethernet                                        [  確定  ]

Configuring fallback GTK+ 2.4 libraries.

In which directory do you want to install the mime type icons?
/usr/share/icons

In which directory do you want to install the application's icon?
/usr/share/pixmaps

Trying to find a suitable vmmon module for your running kernel.

The module up-2.4.20-8.athlon-RH9.0 loads perfectly in the running kernel.

You have already setup networking.

Would you like to skip networking setup and keep your old settings as they are?
(yes/no) no

Do you want networking for your virtual machines? (yes/no/help) yes

Would you prefer to modify your existing networking configuration using the
wizard or the editor? (wizard/editor/help) editor

The following virtual networks have been defined:

. vmnet1 is a host-only network on private subnet 172.16.126.0.
. vmnet8 is a NAT network on private subnet 192.168.1.64.

Do you wish to make any changes to the current virtual networks settings?
(yes/no) yes
Which virtual network do you wish to configure? (0-99) 8

The network vmnet8 has been reserved for a NAT network.  You may change it, but
it is highly recommended that you use it as a NAT network.  Are you sure you
want to modify it? (yes/no) yes

What type of virtual network do you wish to set vmnet8?
(bridged,hostonly,nat,none) none

Removing a NAT network for vmnet8.

The following virtual networks have been defined:

. vmnet1 is a host-only network on private subnet 172.16.126.0.

Do you wish to make additional changes to the current virtual networks settings?
(yes/no) yes

Which virtual network do you wish to configure? (0-99) 8

The network vmnet8 has been reserved for a NAT network.  You may change it, but
it is highly recommended that you use it as a NAT network.  Are you sure you
want to modify it? (yes/no) yes

What type of virtual network do you wish to set vmnet8?
(bridged,hostonly,nat,none) hostonly

Configuring a host-only network for vmnet8.

Do you want this program to probe for an unused private subnet? (yes/no/help)
no

What will be the IP address of your host on the private network? 192.168.1.70

What will be the netmask of your private network? 192.168.1.65

The following virtual networks have been defined:

. vmnet1 is a host-only network on private subnet 172.16.126.0.
. vmnet8 is a host-only network on private subnet 192.168.1.65.

Do you wish to make additional changes to the current virtual networks settings?
(yes/no) no

Trying to find a suitable vmnet module for your running kernel.

The module up-2.4.20-8.athlon-RH9.0 loads perfectly in the running kernel.

Starting VMware services:
   Virtual machine monitor                                 [  確定  ]
   Virtual ethernet                                        [  確定  ]
   Host-only networking on /dev/vmnet1 (background)        [  確定  ]
   Host-only networking on /dev/vmnet8 (background)        [  確定  ]

The configuration of VMware Workstation 5.0.0 build-13124 for Linux for this
running kernel completed successfully.

You can now run VMware Workstation by invoking the following command:
"/usr/bin/vmware".

2.用ifconfig查看vmware的虛擬網路設備
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0A:EB:56:FA:BB
          inet addr:192.168.1.70  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7079 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1257 errors:0 dropped:0 overruns:0 carrier:0
          collisions:33 txqueuelen:100
          RX bytes:1342729 (1.2 Mb)  TX bytes:166501 (162.5 Kb)
          Interrupt:5

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1565 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1565 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:111616 (109.0 Kb)  TX bytes:111616 (109.0 Kb)

vmnet1    Link encap:Ethernet  HWaddr 00:50:56:C0:00:01
          inet addr:172.16.126.1  Bcast:172.16.126.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

vmnet8    Link encap:Ethernet  HWaddr 00:50:56:C0:00:08
          inet addr:192.168.1.65  Bcast:255.255.255.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

# service network restart
正在關閉介面 eth0:                                        [  確定  ]
關閉環回介面:                                             [  確定  ]
設置網路參數:                                             [  確定  ]
彈出環回介面:                                             [  確定  ]
彈出界面 eth0:                                            [  確定  ]


3.在主系統上ping一下虛擬系統:
# ping -c 3 172.16.126.1
PING 172.16.126.1 (172.16.126.1) 56(84) bytes of data.
64 bytes from 172.16.126.1: icmp_seq=1 ttl=64 time=0.055 ms
64 bytes from 172.16.126.1: icmp_seq=2 ttl=64 time=0.050 ms
64 bytes from 172.16.126.1: icmp_seq=3 ttl=64 time=0.050 ms

--- 172.16.126.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.050/0.051/0.055/0.008 ms


4.查看路由表
# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     0      0        0 vmnet8
172.16.126.0    *               255.255.255.0   U     0      0        0 vmnet1
169.254.0.0     *               255.255.0.0     U     0      0        0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
# service network restart
正在關閉介面 eth0:                                        [  確定  ]
關閉環回介面:                                             [  確定  ]
禁用 IPv4 包轉送:                                         [  確定  ]
設置網路參數:                                             [  確定  ]
彈出環回介面:                                             [  確定  ]
彈出界面 eth0:                                            [  確定  ]


5.再來開啟路由功能,設定iptables,使主機成為一台 nat server
# echo 1 >; /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o eth0 -s 172.16.126.0/24 -j MASQUERADE
《解決方案》

VMware.Workstation.v5的host-only方式上外網問題

怎麼沒有人幫我解決啊
《解決方案》

VMware.Workstation.v5的host-only方式上外網問題

http://www.linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&p=4428180&highlight=#4428180

[火星人 ] VMware.Workstation.v5的host-only方式上外網問題已經有829次圍觀

http://coctec.com/docs/service/show-post-9826.html