Contributor
Contributor

A weird phenomenon about use VMnet8(NAT) with static IP

Jump to solution

PC: Windows10 1909, i7-6700

VMware:VMware ® Workstation 15 Pro 15.1.0 build-13591040

VM System: Ubuntu 16.04

  1. Click "VMware Virtual Ethernet Adapter for VMnet8" in Windows 10's Change Adapter options item. Select the Internet Protocol Version 4 (TCP/IPv4) item. Set IP address with 192.168.52.1, and Subnet Mask is 255.255.255.0
  2. In Virtual Network Editor , use VMnet8, click NAT Settings, Gateway ip is 192.168.52.1 , and Subnet IP is 192.168.52.0, Subnet Mask is 255.255.255.0
  3. and run ShadowsSocksR (A socks5 proxy client)in Windows 10, make it listen 10899 port.
  4. Start Ubuntu virtual machine. set these:tx-vm_proxy-ubuntu-wired-connection.pngtx-vm_proxy-ubuntu-proxy.png
  5. Now, Ubuntu virtual machine can access internet pass through sock5 proxy thich run in Windows 10.

AND THE WEIRD THING IS

When I reboot Ubuntu virtual machine, it can't access internet. And I want to capture packet of "VMware Virtual Ethernet Adapter for VMnet8" in Windows 10 and help myself to check how it does not work, so I run Wireshark in Windows10, and click capture button, and then Ubuntu virtual machine can access internet at the same time.

After that, it can not access internet when I reboot or start it and I will run Wireshark and capture VMnet8 Adapter and it will be repaired temporary.

So someone can tell me how's it going? Thank you.

0 Kudos
1 Solution

Accepted Solutions
Leadership
Leadership

Welcome to the Community,

I can't tell you why this works at all, because - if I understand your setup correctly - you're using the same IP address twice, for the virtual host adapter as well as for the NAT gateway address (which is the ".2" address by default).

What I could think of is, that what you are trying to archive may work with a Host-Only network configuration.


André.

View solution in original post

6 Replies
Leadership
Leadership

I guess that Wireshark is switching the adapter into promiscuous mode, quite why this opens up internet access without knowing everything about your specific setup I don’t know.

Leadership
Leadership

Welcome to the Community,

I can't tell you why this works at all, because - if I understand your setup correctly - you're using the same IP address twice, for the virtual host adapter as well as for the NAT gateway address (which is the ".2" address by default).

What I could think of is, that what you are trying to archive may work with a Host-Only network configuration.


André.

View solution in original post

Immortal
Immortal

> What I could think of is, that what you are trying to archive may work with a Host-Only network configuration.

???? - am I missing something ? - it looks like that is what he already does ??? VMnet8 is a just another hostonly network like a default vmnet1.

Only difference is that the virtual nic normally gets just one IP - vmnet8 also establishes an alias using ...2.On a default vmnet8 an additional NAT-service is installed that listens on the virtual nic but only accepts NAT-requests that enter via the dot .2 alias.

To me this looks like expected behaviour !

Normal behaviour: internet does not work

Guest XY sends request for googe DNS to 8.8.8.8 to default gateway x.y.z.1 - request is unroutable and will be dropped.

New behaviour with Wireshark in capture-mode.

If I remember right promiscuos mode changes the behaviour of the nic and among other things does this:

- listen on all devices and on all aliases

- stops dropping packages that in normal mode would be dropped

If we look for a simple explanation for the reported behaviour it could be this one:

In normal conditions the NAT-service listening on x.y.z.2 in network x.y.z.0 would have nothing to do if all connected VMs/hosts send their requests to the default gateway x.y.z.1

If the change to promiscuos mode now has the effect that the normal rule:

handle all NAT-requests coming in via vmnet8 when  they are addressed to the alias  x.y.z.2

is changed to

handle all NAT-requests coming in via vmnet8

The result then would be that the actually misconfigured configuration for the VMware NAT-service fails to work in normal conditions but works when  wireshark running on the host is added to the mix.

Guest XY sends request for googe DNS to 8.8.8.8 to default gateway x.y.z.1 - in promiscuos mode NAT-service no longer ignores requests coming in via the correct device but wrong alias.

Instead these requests are served - apparently successfully

Do you need support with a recovery problem ? - call me via skype "sanbarrow"
0 Kudos
Contributor
Contributor

I haven't thought about promiscuous mode, maybe you are right that is the reason.

0 Kudos
Contributor
Contributor

Thanks, you gave me a correct direction. I change the Gateway ip in Virtual Network Editor and set it to 192.168.52.2 , and change the default route(gateway) to 192.168.52.2 in Ubuntu virtual machine, now these problems have been solved.

Thanks again.

0 Kudos
Contributor
Contributor

Your explanation is clear and simple to understand. I agree with you.

But if I change the gateway ip to x.y.z.3 or x.y.z.2, it will be normal too.

gateway in Virtual Network Editorgateway in Virtual MachineHTTP(SOCKS5)PING
192.168.52.1192.168.52.1NOYES
192.168.52.1(running Wireshark)192.168.52.1(running Wireshark)YESNO
192.168.52.2192.168.52.2YESYES
192.168.52.2(running Wireshark)192.168.52.2(running Wireshark)YESYES
192.168.52.3192.168.52.3YESYES
192.168.52.3(running Wireshark)192.168.52.3(running Wireshark)YESYES
192.168.52.3192.168.52.2YESNO
192.168.52.3(running Wireshark)192.168.52.2(running Wireshark)YESNO
0 Kudos