VMware Communities
grob115
Enthusiast
Enthusiast
Jump to solution

Network mode for VM

Hi, I need advise on which network mode I should pick for the VM.  The requirement are:

1) I need to put the VM on a separate network (shown with a hypothetical IP below).

2) The VM can connect to the Internet (the host is already able to do this).

3) The VM can see the Host and vice versa.

VM (Guest)Host
IP123.55.70.213192.168.60.3

Can someone advise which of the following network mode I should pick for the VM?

- NAT

- Host-only

- Bridged

- LAN segment

I initially picked "LAN segment", though the issue is I believe this would prevent the VM from connecting to either the host or the Internet.

NAT appears to be the solution from the Help section with the following description.

"With NAT, a virtual machine can use many standard protocols to connect to other machines on the exte..."

Once I powered up my Linux VM, I then went to System -> Preferences -> Network Connections in order to assign the IP address I want for the VM.  However, I'm not quite certain what I should put for the Netmask and Gateway in order to make this to work.  Can someone provide some guidance please?

LinuxNetwork.jpg

0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

The host settings are ok (no gateway for vmnet8). It's the CentOS guest where you need to set the gateway to 123.55.70.2.

André

View solution in original post

0 Kudos
18 Replies
a_p_
Leadership
Leadership
Jump to solution

I'm not familiar with VMware Player on Linux. However, if you'd post (attach) the /etc/vmware/vmnet8/nat/nat.conf I can probably help you with a working IP configuration.

André

0 Kudos
grob115
Enthusiast
Enthusiast
Jump to solution

There is no /etc/vmware directory.  I only see a /etc/vmware-tools directory.

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

The file I need is on the host, not within the VM.

André

0 Kudos
Shootist
Enthusiast
Enthusiast
Jump to solution

If you want the host to see the VM and the VM to see the host then you need to set it into Bridge mode, instead of NAT. Bridge mode make the VM show up on your LAN as another PC with it's own local (Private) LAN IP address in the same range as the rest of your LAN. In NAT mode it is using the host system, or is it something in the VM itself, as a Router. That is why your VM now has an IP in a completely different range.

Yes you can jump through some hoops (make changes) so the host system can get through the NAT to see the VM but why bother. Unless you have specific reasons to set the VM on another network.

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

If you want the host to see the VM and the VM to see the host then you need to set it into Bridge mode, instead of NAT.

Sorry, but I don't agree with you in this case. Requirement 1.) is a "separate network" and together with the other requirements, NAT is the only choice for this. It's just the IP settings which need to be configured correctly to make this work with NAT. One option would be to configure the VM for DHCP.

André

0 Kudos
WoodyZ
Immortal
Immortal
Jump to solution

Shootist wrote: If you want the host to see the VM and the VM to see the host then you need to set it into Bridge mode, instead of NAT. Bridge mode make the VM show up on your LAN as another PC with it's own local (Private) LAN IP address in the same range as the rest of your LAN. In NAT mode it is using the host system, or is it something in the VM itself, as a Router. That is why your VM now has an IP in a completely different range.

Just curious if you even bothered to read the entire post and replies before you chimed in!? since the OP explicitly and specifically states "1) I need to put the VM on a separate network (shown with a hypothetical IP below)." so obviously Bridged is not relevent here!

0 Kudos
WoodyZ
Immortal
Immortal
Jump to solution

Once I powered up my Linux VM, I then went to System -> Preferences -> Network Connections in order to assign the IP address I want for the VM.  However, I'm not quite certain what I should put for the Netmask and Gateway in order to make this to work.  Can someone provide some guidance please?

Unless I missed something obvious, it is not clear from your OP what your Host OS is, what version of VMware Player you're using or what Linux Distro the Guest is.  If you cannot find the file that André is asking for then provide the missing information cited along with the output of ipconfig /all from a Command Prompt if a Windows Host or ifconfig from a Terminal on a Linux Host and ifconfig on the Linux Guest.

0 Kudos
Shootist
Enthusiast
Enthusiast
Jump to solution

Yeah sorry I missed the Separate Network part of the post.

But please answer a question for me.

Why is it everyone on these type forums, especially the so call experts, are slightly condescending when pointing out some else mistake.

0 Kudos
grob115
Enthusiast
Enthusiast
Jump to solution

Hi, thanks for all those who have participated in assisting.  And yes the requirement is that the VM must be on a separate network in order for the software that I'm trying to setup on the VM will work.  The software will only work on a specific network segment.  I can get it to work on a different network but it'd take too much time and trouble for me to re-configure everything.

The host is a Windows 7 PC with VMware Player 4.0.1 build-528992, and guest VM is a CentOS 6 server.  Details of their network interface setup are currently as follow.

Windows 7

Windows IP Configuration


Ethernet adapter Local Area Connection 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . : test.com
   Link-local IPv6 Address . . . . . : fe80::d092:7d90:9a0b:a8fa%10
   IPv4 Address. . . . . . . . . . . : 192.168.60.2
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.60.1

Ethernet adapter VMware Network Adapter VMnet1:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::1564:4a48:cfd6:30b8%17
   IPv4 Address. . . . . . . . . . . : 192.168.146.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet8:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::1db4:45d5:3311:b099%18
   IPv4 Address. . . . . . . . . . . : 192.168.147.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Tunnel adapter isatap.{E1E22C75-9C18-4716-8BEF-7DDCCC0467E5}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.test.com:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : test.com

Tunnel adapter isatap.{E3C11810-484E-40BB-A7CD-3AA772BB7748}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{B0A09A79-F672-44B0-A1B2-1FEB3D822EA5}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

CentOS 6

eth0  Link encap:Ethernet  HWaddr 00:10:18:8C:BA:18 
          inet addr:123.55.70.213  Bcast:123.55.70.255  Mask:255.255.255.0
          inet6 addr: fe80::210:18ff:fe8c:ba18/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3395 (3.3 KiB)  TX bytes:4223 (4.1 KiB)

lo       Link encap:Local 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:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:480 (480.0 b)  TX bytes:480 (480.0 b)

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

What you need to do to achieve this is first to extract the "Virtual Network Editor" from the Player's installation package.

1.) Extract the installation package to a subfolder (this may take a minute, be patient)

VMware-player-4.0.1-528992.exe /e .\temp

2.) Extract the contents of the "network.cab" (using e.g. 7zip) and copy them into the Player's installation folder

Once done, run the "Virtual Network Editor" (vmnetcfg.exe) and set the "Subnet IP" of VMnet8 (NAT) to 123.55.70.0. After setting the guest to IP: 123.55.70.213, subnet: 255.255.255.0, gateway: 123.55.70.2 the guest should be online.

You may also want to adjust the "DHCP Settings ..." for VMnet8 to make sure the above IP address is not included in the DHCP range.

André

0 Kudos
grob115
Enthusiast
Enthusiast
Jump to solution

Thanks for the guidance.  I have just done that with the settings shown in the attachment for the VMNet8 adapter.

However, I am still unable to ping say www.yahoo.com from within the VM.

Note the Default Gateway for the VMNet8 on my Windows 7 is blank.  VMNet 8 is currently assigned an address in the same subnet as the one I want my VM to be (guess that's correct, right)?  However, when I try to put the real gateway for the host on it as the Gateway, I saw a message saying they're not no the same subnet?  Can someone advise me what to do next?  Thanks.

CentOS 6 Settings

eth0    Link encap:Ethernet  HWaddr 00:10:18:8C:BA:18 
          inet addr:123.55.70.213  Bcast:123.55.70.255  Mask:255.255.255.0
          inet6 addr: fe80::210:18ff:fe8c:ba18/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:54 errors:0 dropped:0 overruns:0 frame:0
          TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11386 (11.1 KiB)  TX bytes:11081 (10.8 KiB)

lo       Link encap:Local 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:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:480 (480.0 b)  TX bytes:480 (480.0 b)

Windows 7 Settings

Windows IP Configuration


Ethernet adapter Local Area Connection 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::d092:7d90:9a0b:a8fa%10
   IPv4 Address. . . . . . . . . . . : 192.168.10.7
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.10.1

Ethernet adapter VMware Network Adapter VMnet1:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::1564:4a48:cfd6:30b8%17
   IPv4 Address. . . . . . . . . . . : 192.168.146.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet8:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::1db4:45d5:3311:b099%18
   IPv4 Address. . . . . . . . . . . : 123.55.70.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Tunnel adapter isatap.{E1E22C75-9C18-4716-8BEF-7DDCCC0467E5}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{E3C11810-484E-40BB-A7CD-3AA772BB7748}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{B0A09A79-F672-44B0-A1B2-1FEB3D822EA5}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{5A3DD512-5C4F-4A45-B25F-42D2AE7B97C2}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter 6TO4 Adapter:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 2002:7b37:4601::7b37:4601
   Default Gateway . . . . . . . . . : 2002:c058:6301::c058:6301

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

The host settings are ok (no gateway for vmnet8). It's the CentOS guest where you need to set the gateway to 123.55.70.2.

André

0 Kudos
grob115
Enthusiast
Enthusiast
Jump to solution

Not sure why but I'm unable to connect to the Internet from my VM guest through the PC host.  When I checked on Windows, it appears the VMnet8 network has no Internet access.  I am able to Putty into the CentOS running on the guest VM from my Windows 7 host, however.  Any idea how I can enable this?

NoInternet.jpg

Note the VMware Bridge Protocol has not been selected.  This is correct, right?

VMwareBridgeProtocol.jpg

This is the TCP/IPv4 Properties for VMnet8. Noted that Default gateway is correct to have nothing set.

Can I however ask how would the Windows 7 host knows any Internet bound packets from the VM guest would need to be routed to my gateway at 192.168.10.1?

TCPIP4Settings.jpg

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Can you please provide the current IP configuration of the guest (IP address, subnet mask, gateway, DNS server). The VM's gateway - in case of NAT - has to be 123.55.70.2.

André

0 Kudos
continuum
Immortal
Immortal
Jump to solution

Hi shootist

>  Why is it  everyone on these type forums, especially the so call experts, are  slightly condescending when pointing out some else mistake.

Please forgive us - usually we all are quite easy going guys.
Its just that in the last few months we have a very large number of posts by a small number of new users that post random links to as many posts as they can.
So we are a little bit on edge at the moment.
Please forgive us

http://sanbarrow.com/gifs/cheers.gif


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
grob115
Enthusiast
Enthusiast
Jump to solution

André Pett wrote:

Can you please provide the current IP configuration of the guest (IP address, subnet mask, gateway, DNS server). The VM's gateway - in case of NAT - has to be 123.55.70.2.

André

Here's what set in System -> Preferences -> Network Connections -> Wired tab -> eth0

When I tried "ping www.yahoo.com" it's unable to find the site, whether or not I have set 123.55.70.2 as the DNS server on this screen below.

I even tried editing /etc/resolv.conf manually and running "service network restart" and doing the ping test again but still have no luck.

If I do "dig www.yahoo.com" it just stucks there until I press Control-C.  If I tried "dig @123.55.70.2 www.yahoo.com" it works fine however.  Any ideas?

guestNetworkSettings.jpg

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

If I tried "dig @123.55.70.2 www.yahoo.com" it works fine however

This at least proves the network is working. As I mentioned earlier I'm not a Linux guy, but in this case I'm pretty sure it's a configuration issue in the guest OS. Does dig return anything (at least the root servers) when you add +trace to the command line?

André

0 Kudos
grob115
Enthusiast
Enthusiast
Jump to solution

Hi, okay I found the solution.  So here are the steps:

1) Setup the VM to have an IP of 123.55.70.23

2) Setup the VM to use the GW at 123.55.70.2 with the following command.

route add default gw 123.55.70.2 eth0

3) Add DNS servers.

    a) Edit the DNS client configuration file.

        view /etc/resolv.conf

    b) Add the following entries.  These IPs are visible from the PC host via a connection to the Internet (circled in blue below).

       nameserver 192.168.10.1 (same entry applied for the VMnet8 network adapter on the PC host as shown below but can be different)

       nameserver 64.59.144.91 (same entry applied for the VMnet8 network adapter on the PC host as shown below but can be different)

  

4) Bounce the network service.

    service network restart

Network on PC host
VMPlayerNetworkSetup.jpg

Setting for VMnet8

Note no Default Gateway is required to be setup here.

VMPlayerNetworkSetup2.jpg

0 Kudos