简体   繁体   English

vmware设置来宾静态IP地址,主机通过3G调制解调器连接到专用网络

[英]Vmware set guest static ip address with host connected to private network by 3G modem

I have windows 7 host and guest debian 7 on vmware. 我在vmware上有Windows 7主机和来宾debian 7。 I am connected to internet by 3G modem and this is the ip config of host 我通过3G调制解调器连接到Internet,这是主机的ip配置

PPP adapter [provider name]:
   Connection-specific DNS Suffix  . :
   IPv4 Address. . . . . . . . . . . : 10.47.235.94
   Subnet Mask . . . . . . . . . . . : 255.255.255.255
   Default Gateway . . . . . . . . . : 0.0.0.0

what I am trying to achieve is to 我想要实现的是

1) set static ip for guest
2) connect from host to guest by ftp and remote mysql
3) access internet in guest

In the past I had cable internet connection and the ipconfig of host was this 过去我有电缆互联网连接,主机的ipconfig是这个

IPv4 Address. . . . . . . . . . . : 192.168.0.100
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1

that time I just changed the network type in vmware as bridged and had this 那个时候,我只是在vmware中更改了网络类型,将其桥接

nameserver 192.168.0.1

in etc/resolv.conf and also these lines in etc/network/interfaces and all things were just fine. etc/resolv.conf以及在etc/network/interfaces这些行,一切都很好。

iface eth0 inet static
address 192.168.0.107
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.0.1

I tried to do a similar thing 我试图做类似的事情

address 10.47.235.95  # just putting some ip other than the host's ip
netmask 255.255.255.255 # same as for host
network 192.168.1.0     # did not know what to put, so just left the same
gateway 0.0.0.0 # host's gateway

but does not work, neither I can connect to guest, nor I have internet in guest. 但无法正常工作,无法连接到访客,也无法在访客中连接互联网。

thanks 谢谢

You are saying that your subnet mask is 255.255.255.255. 您说的是子网掩码是255.255.255.255。 With this subnet mask you can't add even a single guest to your network (theoretically if SN mask is 255.255.255.255, there is no network). 使用此子网掩码,您甚至无法将单个来宾添加到您的网络(理论上,如果SN掩码为255.255.255.255,则没有网络)。 It should be at least 255.255.255.252. 至少应为255.255.255.252。 When you give the IP 10.47.235.95 to your guest, it won't be connected with your network because this IP belongs to another network. 当您将IP 10.47.235.95提供给访客时,它将不会与您的网络连接,因为该IP属于另一个网络。 If you select Bridged network type, your guest is directly connected with your network card and will try to use an IP. 如果选择“桥接网络类型”,则来宾将直接与网卡连接,并会尝试使用IP。 But since your SN mask is 255.255.255.255 there is no IP available for your guest. 但是,由于您的SN掩码为255.255.255.255,因此没有可供客人使用的IP。 Try to use NAT mode instead of bridged one. 尝试使用NAT模式而不是桥接模式。 If this don't work than you have to change your modem SN mask. 如果这不起作用,则必须更改调制解调器SN掩码。 When you had the SN mask 255.255.255.0 it was OK because this network allows 253 guests to be connected with the modem. 当您拥有SN掩码255.255.255.0时,就可以了,因为此网络允许253个访客与调制解调器连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM