I'm apparently having a difficult time understanding how the host and guests route traffic to each other. Sometimes it works but usually it doesn't.
I'm trying to reach a guest from the host (web and icmp) but the traffic is getting routed to the physical NIC's default gateway instead of to the host-only virtual network (verified with tracert). Why does it look like "route print" and "get-netroute" are showing different results?
route print
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.31 55
0.0.0.0 0.0.0.0 On-link 10.70.19.185 1
10.1.0.0 255.255.255.0 On-link 10.1.0.1 291
10.1.0.1 255.255.255.255 On-link 10.1.0.1 291
10.1.0.255 255.255.255.255 On-link 10.1.0.1 291
get-netroute
ifIndex DestinationPrefix NextHop RouteMetric ifMetric PolicyStore
22 10.1.0.255/32 0.0.0.0 256 35 ActiveStore
22 10.1.0.1/32 0.0.0.0 256 35 ActiveStore
22 10.1.0.0/24 0.0.0.0 256 35 ActiveStore
20 0.0.0.0/0 0.0.0.0 1 ActiveStore
9 0.0.0.0/0 192.168.0.1 0 55 ActiveStore
Ethernet adapter VMware Network Adapter VMnet1:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet1
Physical Address. . . . . . . . . : 00-50-56-C0-00-01
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::fdc6:8bc9:77ab:d7fb%22(Preferred)
IPv4 Address. . . . . . . . . . . : 10.1.0.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 922767446
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-26-E3-11-CA-CC-48-3A-86-21-7E
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled
What is the IP configuration of the guest OS NIC?
Guest OS:
mgmt: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.1.0.145 netmask 255.255.255.0 broadcast 10.1.0.255
inet6 fe80::20c:29ff:fefa:43fe prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:fa:43:fe txqueuelen 1000 (Ethernet)
I can get to the WAN from the guest, I just can't get to the guest from the host. It's trying to route to the default gateway, not the VM's network.