有谁知道局域网访问虚拟机的虚拟机上不了网

yahoon 的BLOG
用户名:yahoon
文章数:130
评论数:771
访问量:1650404
注册日期:
阅读量:5863
阅读量:12276
阅读量:370930
阅读量:1065298
51CTO推荐博文
XPADSL,XP,().,,.
:XP,192.168.1.11
:redhat 9,192.168.1.13
linuxpppoe
[root@localhost root]# less /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.1.13
NETMASK=255.255.255.0
TYPE=Ethernet
USERCTL=no
PEERDNS=no
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
[root@localhost root]# adsl-setup
Welcome to the ADSL client setup.& First, I will run some checks on
your system to make sure the PPPoE client is installed properly...
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
LOGIN NAME&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Enter your Login Name (default root):&& adsl&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Enter the Ethernet interface connected to the ADSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethX, where 'X' is a number.
(default eth0):& modem
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped.& If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses.& You may have some problems with demand-activated links.
Enter the demand value (default no):&
Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide dynamic DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
Enter the DNS information here:& DNS,ADSL,server
Please enter your Password:& ADSL
Please re-enter your Password:&
Please enter 'yes' (two letters, lower-case.) if you want to allow
normal user to start or stop DSL connection (default yes):&
FIREWALLING
Please choose the firewall rules to use.& Note that these rules are
very basic.& You are strongly encouraged to use a more sophisticated
however, these will provide basic security.& If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself.& Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc.& If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.
The firewall choices are:
0 - NONE: This script will not set any firewall rules.& You are responsible
&&&&&&&&& for ensuring the security of your machine.& You are STRONGLY
&&&&&&&&& recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
&&&&&&&&&&&&&&& for a LAN
Choose a type of firewall (0-2): &,0
Start this connection at boot time
Do you want to start this connection at boot time?
Please enter no or yes (default no):& .
** Summary of what you entered ** &
Ethernet Interface: eth0
User name:&&&&&&&&& xxx
Activate-on-demand: No
DNS addresses:&&&&& Supplied by ISP's server
Firewalling:&&&&&&& NONE
User Control:&&&&&& yes
Accept these settings and adjust configuration files (y/n)? y&
Adjusting /etc/sysconfig/network-scripts/ifcfg-ppp0
Adjusting /etc/ppp/chap-secrets and /etc/ppp/pap-secrets
& (But first backing it up to /etc/ppp/chap-secrets.bak)
& (But first backing it up to /etc/ppp/pap-secrets.bak)
Congratulations, it should be all set up!
Type '/sbin/ifup ppp0' to bring up your xDSL link and '/sbin/ifdown ppp0'
to bring it down.
Type '/sbin/adsl-status /etc/sysconfig/network-scripts/ifcfg-ppp0'
to see the link status.
[root@localhost root]# adsl-start
[root@localhost root]# ifconfig
eth0&&&&& Link encap:Ethernet &HWaddr 00:0C:XX:XX:XX:XX
&&&&&&&&& inet addr:192.168.1.13& Bcast:192.168.1.255& Mask:255.255.255.0
ppp0&&&&& Link encap:Point-to-Point Protocol
&&&&&&&&& inet addr:59.175.103.180& P-t-P:59.175.102.1& Mask:255.255.255.255
&&&&&&&&& UP POINTOPOINT RUNNING NOARP MULTICAST& MTU:1492& Metric:1
&&&&&&&&& RX packets:3 errors:0 dropped:0 overruns:0 frame:0
&&&&&&&&& TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
&&&&&&&&& collisions:0 txqueuelen:3
&&&&&&&&& RX bytes:54 (54.0 b)& TX bytes:54 (54.0 b)
[root@localhost root]# ping [url][/url]
PING [url]www.[/url] (220.181.37.4) 56(84) bytes of data.
64 bytes from 220.181.37.4: icmp_seq=1 ttl=52 time=100 ms
64 bytes from 220.181.37.4: icmp_seq=2 ttl=52 time=102 ms
[root@localhost root]# route
Kernel IP routing table
Destination&&&& Gateway&&&&&&&& Genmask&&&&&&&& Flags Metric Ref&&& Use Iface
59.175.102.1&&& *&&&&&&&&&&&&&& 255.255.255.255 UH&&& 0&&&&& 0&&&&&&& 0 ppp0
192.168.1.0&&&& *&&&&&&&&&&&&&& 255.255.255.0&& U&&&& 0&&&&& 0&&&&&&& 0 eth0
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&&&&&&&& 59.175.102.1&&& 0.0.0.0&&&&&&&& UG&&& 0&&&&& 0&&&&&&& 0 ppp0
[root@localhost root]# echo 0 & /proc/sys/net/ipv4/ip_forward
[root@localhost root]# iptables -t filter -F
[root@localhost root]# iptables -t nat -F
[root@localhost root]# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQU
[root@localhost root]# echo 1 & /proc/sys/net/ipv4/ip_forward
xplinuxip192.168.1.13,DNSADSLDNS,202.103.24.68.XP.
linux,iptables.linux 1.13ip 0.13,echo 1 & /proc/sys/net/ipv4/ip_forward ,xp1.111.13ping1.13
linux,adslNAT,iptables.
记得每次修改IP设置之后要重启网卡,并且重新启动转发
echo 1 & /proc/sys/net/ipv4/ip_forward
linux,vmwarexpadsl,:/.,.,,reset.,..,,….??,,,,,U,.,…….
,,adsl/.modem.
&本文出自 “” 博客,请务必保留此出处
了这篇文章
类别:┆阅读(0)┆评论(0)
21:48:19 15:39:36 16:29:14 19:05:15 15:17:14&&&&&& win7中的能ping通中的主机,但局域网中的其他主机不能ping通虚拟机里的linux问题。首先,这应该主要是虚拟机里面的linux的ip没有设置为自动获取。本人的问题是这样的。我win7里面的vmware装的linux方式设置为了自动桥接,已经给能ping通局域网的其他主机,但是局域网的其他主机不能ping通虚拟机的linux,于是,我查了一下win7的DNSIP,方法:终端里面输入ipconfig /all。然后将虚拟机里面的linux的DNS服务器设置了宿主机win7的DNS。方法:
#rm /etc/resolv.conf
#touch /etc/resolv.conf
#echo nameserver 202.96.128.86 && /tc/resolv.假设202.96.128.86是DNS服务器地址
但是问题还没有解决,于是上网查了资料。查到了使用桥接方式联网,假如局域网上有DHCP服务器,则应该将IP设置为自动获取。于是,我便将虚拟机中的linux德尔设置为自动获取,DHCP服务器则设置为192.168.1.1(我是用的是宽带)。接着,重启网卡,方法:
#ifconfig eth0 down
#ifconfig eth0 up
再试着ping,ping通了。2014年6月 Linux/Unix社区大版内专家分月排行榜第二2014年1月 Linux/Unix社区大版内专家分月排行榜第二2013年11月 Linux/Unix社区大版内专家分月排行榜第二2010年6月 Windows专区大版内专家分月排行榜第二2010年4月 Windows专区大版内专家分月排行榜第二2010年3月 Windows专区大版内专家分月排行榜第二2009年12月 Windows专区大版内专家分月排行榜第二2009年11月 Windows专区大版内专家分月排行榜第二2008年7月 Windows专区大版内专家分月排行榜第二2008年1月 Windows专区大版内专家分月排行榜第二2007年12月 Windows专区大版内专家分月排行榜第二2007年11月 Windows专区大版内专家分月排行榜第二2007年10月 Windows专区大版内专家分月排行榜第二2007年6月 Windows专区大版内专家分月排行榜第二
2014年7月 Linux/Unix社区大版内专家分月排行榜第三2014年4月 Linux/Unix社区大版内专家分月排行榜第三2013年1月 Linux/Unix社区大版内专家分月排行榜第三2010年5月 Windows专区大版内专家分月排行榜第三2009年9月 Windows专区大版内专家分月排行榜第三2009年8月 Windows专区大版内专家分月排行榜第三2008年8月 Windows专区大版内专家分月排行榜第三2008年6月 Windows专区大版内专家分月排行榜第三2007年9月 Windows专区大版内专家分月排行榜第三2007年7月 Windows专区大版内专家分月排行榜第三2007年4月 Windows专区大版内专家分月排行榜第三
本帖子已过去太久远了,不再提供回复功能。局域网如何设置虚拟机上网
最近在WINDOWS7 安装了VMware 6.5, 虚拟机上采用 BRIDGE 的方式上网, 刚开始可以上网, 过几天之后,发现不能上网了,点击VMWARE界面右下角的电脑图标,连接,提示如下: the network bridge on device VMnet0 is not running. The virtual machine will not be able to communicate with the host or with other machines on your network。网上似乎有几种解决办法,但是好像没有什么用,网上的办法如下: 1.打开&本地连接&的属性窗口2.点击&安装&-&&服务&-&&添加...&-&&从磁盘安装&-&&选择X:\Program Files\VMware\VMware Workstation\netbridge.inf(每人的目录可能不同,自己找吧)&-&&确定&3.这时属性窗口里面应该有&vmware bridge protocol&,点击&属性&,在窗口里面输入&0&,确定,重新启动机器,ok了关键在第3步, 属性那个是灰色的, 根本无法点击!无奈之下,重装了VMWARE, 再采用桥接方式成功上网。 因为采用NAT, HOST ONLY 都没有成功。哪位兄弟能不能详细介绍一下, 不要随便从网上 copy一段话来敷衍我。
09-08-11 &
按照步骤来吧..我就虚拟上网.. 1、使用Manage Virtual Networks,将原有多余的功能如dhcp等等全关闭了(总之,你看到什么能关就关什么,但是,不要删除网卡),并另建一个网卡“……VMnet2”,这样,你就有三个网卡了。 2、改动你的已虚好的虚拟机的网卡设定为第一项(桥接)。 做完以上两步,你的虚拟机就拥有一个独立的网卡,与你的真实机在一个局网中处于对等的地位了,如果你的真实机处于局网中,你的虚拟机也就处于局网中,此时,你按你的局网给你的虚拟机分配IP,那么,你的虚拟机应能正常Ping通其它的机器(包括本地的真实机)。 接下来是上网的问题,如果你的真实机在局网上,那么你的虚拟机也在局网上,设好虚拟机的局网IP后,按真实机上网的方法处理,把虚拟机当真实机一样设就可以了。如果你的真实机是单机,那么向下看。 3、使用win自带的ADSL拔号功能(不建议另装拔号软件,注意,只能是winxp/win2003才行,如果不是,那就加装吧),正确建好ADSL拔号,并拔号上网,保证真实机上网成功。 4、右点网邻-》属性,进入网邻设定,找到ADSL拔号,右点它-》属性,进入后打开其上网共享,受共享的网络为“……VMnet2。完成后,你的“……VMnet2”的IP将自动设为192.168.0.1。 5、改动你的已虚好的虚拟机的网卡设定为第一项(桥接)。起动虚拟机,进入网络设定,把虚拟机的IP设为192.168.0.2(注意,如果你的机器也有双网卡,也在局网中,要保证192.168.0.2没有被网络上其它电脑占用,如占用,把最后一位换成别的)。 6、在虚拟机中,运行“cmd”或是“command”(win9x下),调出DOS窗,使用“ping 192.168.0.1”来测试是否与主机正常联通,如果联通,那么你成功了一半。 7、上一步成功后,现在你的虚机已成功入局网,接下来的事就简单多了,你只要把虚拟机的网关设为192.168.0.1,再把DNS设为192.168.0.1(如果win9x下,要求填入主机名,可以乱填,那玩不起什么作用),再去IE中把“internet选项”中,“连接”页中的“局域网设置”中的“自动检测设置”项去了。你的虚拟机就可以上网了。 8、请十分注意的是,上面的做法打开了你的主机的上网代理功能,你的主机一定要加装防火墙(或正确设定win自带的防火墙,建议加装天网),否则,可能引来互联网上恶意代理找寻者使用你的电脑做上网中转(这样至少会减慢你的网速
请登录后再发表评论!
把虚拟机的网卡模式调成NET模式虚拟机的IP不要设置 让它全部自动获取这样的上网方式就是和主机共享上网
请登录后再发表评论!
VMware 提供四种网络连接方式(1)Bridged方式用这种方式,虚拟系统的IP可设置成与本机系统在同一网段,虚拟系统相当于网络内的一台独立的机器,与本机共同插在一个交换机上,网络内其他机器可访问虚 拟系统,虚拟系统也可访问网络内其他机器,当然与本机系统的双向访问也不成问题。(2)NAT方式这种方式也可以实现本机系统与虚拟系统的双向访问.但网络内其他机器不能访问虚拟系统,虚拟系统可通过本机系统用NAT协议访问网络内其他机器。这种方式 是我喜欢用的。(3)host-only方式顾名思义这种方式只能进行虚拟机和主机之间的网络通信,既网络内其他机器不能访问虚拟系统,虚拟系统也不能访问其他机器.(4)自定义这个很灵活,大家可以根据喜好来随意调整......更多资料请访问 : 原文地址:
请登录后再发表评论!局域网的其他机器访问在vm虚拟机中的部署的网站 -
- ITeye技术网站
博客分类:
最近在公司的局域网中自己的电脑上安装了vm虚拟机,并且在vm中安装了centeros 系统
在centeros中搭建了一个tomcat的web服务,想让其他同事也可以访问到这个虚拟机中的web网站
试了大半天终于搞定了 现在把我的探索说下,希望对其他人有帮助
1.首先需要点击 点击 vm导航栏中的 VM——》settings——》NetWork Adapter选择NAT:Userd to share the host ip address 点击OK
2.点击 VM 导航栏的 Edit———》virtual NetWork Editor 找到 VMnet 8 选中后 点击下面的
NAT settings 可以看到一个 Add 按钮 点击add按钮 在 host port中输入你的同事想连接你的虚拟机中的网站时候 网站的端口号 比如 你同事 输入//localhost:8888/test可以访问到你的虚拟机中的网站,那么你就让 host port 中输入 8888, 然后在virtual machine ip address 中输入你的centeros的ip virtual machine port 指的则是 你的服务器的 端口,比如你安装的是一个tomcat服务器 那么这个端口可能就是8080 填写后了点击ok保存
3.点击你的centeros中的administration——》security leve and firewall 把www(http)给勾选上
4.执行命令 vi /etc/sysconfig/iptables 复制下-A RH -Firewall -l ....dport 80 的那一行
并粘贴这一行并把80 改成 8080
5.执行 iptables -F
& 执行 iptables -P INPUT ACCEPT
6.点击你的windows系统的控制界面,windows防火墙——》高级——入站规则,新建一个规则,选择端口,一个下一步就可以了
7.开启你的web服务,让其他同事访问 就可以成功了
sakajiaofu
浏览: 86476 次
来自: 南京
[img][/img]
sakajiaofu 写道

我要回帖

更多关于 局域网访问虚拟机 的文章

 

随机推荐