4

I am sorry if this is a stupid question, but I have been wrestling with VMware's NAT recently, so please forgive me.

I have a Windows 8.1 Host with a CentOS 7 guest and I am using VMware Workstation 12.1. I have my guest configured with NAT, using the VMware virtual network adapter VMnet8, which can be found in Windows "Network and Sharing Center".

My configuration works fine. I can get to the internet from my Linux guest, the problem is I don't understand why it works. I have included some images, can someone explain this to me?

My VMware guest network settings seem to suggest that my windows VMnet8 virtual adapter should be the default gateway with ip address 192.168.59.2. VMware guest network settings

However, this is not the case, as seen below. The Windows VMnet8 virtual network adapter has ip address 192.168.59.1 windows host virtual adapter

My question is again, Why does this work? What is the 192.168.59.2 address? I don't understand how network traffic is going from the virtual machine to this mystery 192.168.59.2 address, to the host system at 192.168.59.1. It is important that I understand this so that I can replicate it in the future. I have included some more information from the CentOS guest below. None of it suggests anything about the VMnet8 virtual adaptor.

[user1@localhost ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:88:c7:5b brd ff:ff:ff:ff:ff:ff
inet 192.168.59.128/24 brd 192.168.59.255 scope global dynamic eno16777736
   valid_lft 1009sec preferred_lft 1009sec
inet6 fe80::20c:29ff:fe88:c75b/64 scope link 
   valid_lft forever preferred_lft forever

[user1@localhost ~]$ ip route
default via 192.168.59.2 dev eno16777736  proto static  metric 100 
192.168.59.0/24 dev eno16777736  proto kernel  scope link  src 192.168.59.128 
192.168.59.0/24 dev eno16777736  proto kernel  scope link  src 192.168.59.128  metric 100 

[user1@localhost ~]$ cat /etc/resolv.conf 
# Generated by NetworkManager
search localdomain
nameserver 192.168.59.2

Also, in case you are doubting that I am in fact using NAT, take a look at my virtual machine network settings.

virtual machine settings

1 Answer 1

3

The VMNet8 adapter connects to the virtual network, as does the virtual network adapter installed on your host.

I think you may be confusing the point of the hosts adapter. Traffic from the guest to the Lan or Internet does not go through the 192.168.59.1 adapter. That adapter is used by the host to communicate with the guest; it is not a router port that bridges the VMNet network to the LAN.

The 192.168.59.2 interface is a software interface on the virtual network, which handles the uplink between the virtual network and the hosts LAN connection. You can control the physical interface, IP configuration, and other characteristics of rhe virtual network default gateway using the Virtual Network Editor: http://www.wikihow.com/Create-a-Virtual-Networks-by-Using-VMware-Workstation

So, to sum up, the virtual network is configured to use .2 as its gateway and automatically sends that traffic out the hosts LAN interface. the virtual interface on the host is used to participate on the network that the guests are on.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .