URN Logo
UNIX Resources » Linux » China Linux Forum » Linux防火墙和代理服务器应用 » 5 » VMware.Workstation.v5的host-only方式上外网问题
announcement 声明: 本页内容为中国Linux论坛的内容镜像,文章的版权以及其他所有的相关权利属于中国Linux论坛和相应文章的作者,如果转载,请注明文章来源及相关版权信息。
Resources
China Linux Forum(finished)
Linux Forum(finished)
FreeBSD China(finished)
linuxforum.net
  业界新闻与评论
  自由软件杂谈
  IT 人生
  Linux软件快递
  翻译作坊
  Linux图书与评论
  GNU Emacs/XEmacs
  Linux 中文环境和中文化
  Linux桌面与办公软件
  Linux 多媒体与娱乐版
  自由之窗Mozilla
  笔记本电脑上的Linux
  Gentoo
  Debian 一族
  网络管理技术
  Linux 安装与入门
  WEB服务器和FTP服务器
  域名服务器和邮件服务器
  Linux防火墙和代理服务器应用
  文件及打印服务器
  技术培训与认证
  Linux内核技术
  Linux 嵌入技术
  Linux设备驱动程序
  Linux 集群技术
  LINUX平台数据库
  系统和网络安全
  CPU 与 编译器
  系统计算研究所专栏
  Linux下的GUI软件开发
  C/C++编程版
  PHP 技 术
  Java&jsp技术
  Shell编程技术
  Perl 编 程
  Python 编 程
  XML/Web Service 技术
  永远的Unix
  FreeBSD世界
   
VMware.Workstation.v5的host-only方式上外网问题
Author: yingsuifeng    Posted: 2005-08-12 04:02    Length: 9,641 byte(s)
[Original] [Print] [Top]
我的是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] /usr/share/icons

In which directory do you want to install the application's icon?
[/usr/share/pixmaps] /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] no

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

Would you prefer to modify your existing networking configuration using the
wizard or the editor? (wizard/editor/help) [editor] 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) [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) [no] yes

What type of virtual network do you wish to set vmnet8?
(bridged,hostonly,nat,none) [nat] 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] 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) [no] yes

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

Configuring a host-only network for vmnet8.

Do you want this program to probe for an unused private subnet? (yes/no/help)
[yes] 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) [yes] 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的虚拟网络设备
[root@seaman-yang root]# 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)

[root@seaman-yang root]# service network restart
正在关闭接口 eth0: [ 确定 ]
关闭环回接口: [ 确定 ]
设置网络参数: [ 确定 ]
弹出环回接口: [ 确定 ]
弹出界面 eth0: [ 确定 ]


3.在主系统上ping一下虚拟系统:
[root@seaman-yang root]# 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.查看路由表
[root@seaman-yang root]# 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
[root@seaman-yang root]# service network restart
正在关闭接口 eth0: [ 确定 ]
关闭环回接口: [ 确定 ]
禁用 IPv4 包转送: [ 确定 ]
设置网络参数: [ 确定 ]
弹出环回接口: [ 确定 ]
弹出界面 eth0: [ 确定 ]


5.再来开启路由功能,设定iptables,使主机成为一台 nat server
[root@seaman-yang root]# echo 1 > /proc/sys/net/ipv4/ip_forward
[root@seaman-yang root]# iptables -t nat -A POSTROUTING -o eth0 -s 172.16.126.0/24 -j MASQUERADE

----
自由啊,
你的旗帜虽破,
却仍在风中飘扬!
[Original] [Print] [Top]
« Previous thread
请问PEPORT 1449端口是做什么用的?
Linux防火墙和代理服务器应用
5
Next thread »
如何让Squid强制缓存一些网站
     

Copyright © 2007 UNIX Resources Network, All Rights Reserved.      About URN | Privacy & Legal | Help | Contact us
备案序号: 京ICP备05006143    webmaster: webmaster@unixresources.net
This page created on 2008-07-17 02:58:43, cost 0.039051055908203 ms.