My Computer runs 3 VMs: vmInfra(10.0.99.99), vmPrime(10.0.99.11) and vmDeux(10.0.99.12). The host can't ping any VM and vice versa! Here's the basic structure of my network:
The output of pings are:
# ping 10.0.99.2
PING 10.0.99.2 (10.0.99.2) 56(84) bytes of data.
From 10.0.99.1 icmp_seq=1 Destination Host Unreachable
From 10.0.99.1 icmp_seq=2 Destination Host Unreachable
From 10.0.99.1 icmp_seq=3 Destination Host Unreachable
From 10.0.99.1 icmp_seq=4 Destination Host Unreachable
From 10.0.99.1 icmp_seq=5 Destination Host Unreachable
From 10.0.99.1 icmp_seq=6 Destination Host Unreachable
^C
--- 10.0.99.2 ping statistics ---
7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6158ms
pipe 4
I just created a subnet using the VMware Virtual Network Editor, that generated a /etc/vmware/vmnet99/dhcpd/dhcpd.conf file:
allow unknown-clients;
default-lease-time 1800; # default is 30 minutes
max-lease-time 7200; # default is 2 hours
subnet 10.0.99.0 netmask 255.255.255.0 {
range 10.0.99.128 10.0.99.254;
option broadcast-address 10.0.99.255;
option domain-name-servers 10.0.99.2;
option domain-name localdomain;
default-lease-time 1800; # default is 30 minutes
max-lease-time 7200; # default is 2 hours
option netbios-name-servers 10.0.99.2;
option routers 10.0.99.2;
}
host vmnet99 {
hardware ethernet 00:50:56:C0:00:63;
fixed-address 10.0.99.1;
option domain-name-servers 0.0.0.0;
option domain-name "";
option routers 0.0.0.0;
}
My NAT Settings look like:
The output of `ifconfig` on my host is:
# ip route show
default via 192.168.1.1 dev wlo1 proto static metric 600
10.0.99.0/24 via 10.0.99.2 dev vmnet99
172.16.8.0/24 dev vmnet1 proto kernel scope link src 172.16.8.1
172.16.33.0/24 dev vmnet8 proto kernel scope link src 172.16.33.1
192.168.1.0/24 dev wlo1 proto kernel scope link src 192.168.1.73 metric 600
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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: enp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 3c:52:82:b9:05:5f brd ff:ff:ff:ff:ff:ff
3: wlo1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 3c:95:09:de:4e:8d brd ff:ff:ff:ff:ff:ff
inet 192.168.1.73/24 brd 192.168.1.255 scope global dynamic wlo1
valid_lft 85876sec preferred_lft 85876sec
inet6 fe80::6528:e383:1754:9aef/64 scope link
valid_lft forever preferred_lft forever
4: vmnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether 00:50:56:c0:00:01 brd ff:ff:ff:ff:ff:ff
inet 172.16.8.1/24 brd 172.16.8.255 scope global vmnet1
valid_lft forever preferred_lft forever
inet6 fe80::250:56ff:fec0:1/64 scope link
valid_lft forever preferred_lft forever
5: vmnet8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether 00:50:56:c0:00:08 brd ff:ff:ff:ff:ff:ff
inet 172.16.33.1/24 brd 172.16.33.255 scope global vmnet8
valid_lft forever preferred_lft forever
inet6 fe80::250:56ff:fec0:8/64 scope link
valid_lft forever preferred_lft forever
6: vmnet99: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether 00:50:56:c0:00:63 brd ff:ff:ff:ff:ff:ff
inet 10.0.99.1/24 brd 10.0.99.255 scope global vmnet99
valid_lft forever preferred_lft forever
inet6 fe80::250:56ff:fec0:63/64 scope link
valid_lft forever preferred_lft forever
I can't figure out what is wrong with my config that prevents the host from even pinging the Gateway NAT device, let alone the VMs!
Message was edited by: Somenath Sinha to update the output of `ip addr show`.
Since continuum didn't/couldn't find any fixes with the .vmx file, I had to find an alternative. Thanks for trying, continuum. Turns out that the /etc/vmware/vmnet99/dhcpd/dhcpd.conf file needs an entry for each static IP that needs to be assigned. Of course, the static IPs shouldn't clash with the DHCP range (by default <net>.128 - <net>.253) and thus should lie within <net>.3 - <net>.127 if the DHCP range hasn't been adjusted. The entries should be inserted at the bottom of the dhcpd.conf file, OUTSIDE the DO NOT MODIFY section. They take the form:
host vmInfra.somuVMnet.local {
hardware ethernet 00:0C:29:79:8C:1F;
fixed-address 10.0.99.99;
}
The MAC address provided in the hardware ethernet value is the one assigned to the virtual NIC of the VM. Now, this file should only be edited once the VMs have been shut down, and need a restart of the dhcpd service running on the host for the vmnet. Since I couldn't find the individual service linked to the particular vmnet, I just restarted the vmware service itself, using:
systemctl restart vmware; systemctl status -l vmware
Now we ensure that with that last part that the vmware service started properly. If it's running, and the dhcp server is running on the vmnet, then the VM will be auto-assigned the requested IP and there is no need to explicitly setup the IP using NetworkManager. (I have no clue what happens if the IPs clash, bdw). My VMs can now successfully SSH into the host and vice versa.
Your problem description is incomplete without also posting the vmx-file of atleast one of your VMs.
Other than that it makes no sense at all to create a vmnet99 used for NAT while you have the vmnet8 configured but unused.
Assigning vmnet99 requires that you manually edit your vmx-files - which you probably have not done.
Suggestion: delete vmnet99 and configure vmnet8 instead.
I followed your advice and tried the same structure on Vmnet8, but I'm facing the same problem here as well.. Here's the vmInfra.vmx file:
#!/usr/bin/vmware
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "14"
mks.enable3d = "TRUE"
pciBridge0.present = "TRUE"
pciBridge4.present = "TRUE"
pciBridge4.virtualDev = "pcieRootPort"
pciBridge4.functions = "8"
pciBridge5.present = "TRUE"
pciBridge5.virtualDev = "pcieRootPort"
pciBridge5.functions = "8"
pciBridge6.present = "TRUE"
pciBridge6.virtualDev = "pcieRootPort"
pciBridge6.functions = "8"
pciBridge7.present = "TRUE"
pciBridge7.virtualDev = "pcieRootPort"
pciBridge7.functions = "8"
vmci0.present = "TRUE"
hpet0.present = "TRUE"
usb.vbluetooth.startConnected = "TRUE"
displayName = "vmInfra"
guestOS = "rhel7-64"
nvram = "vmInfra.nvram"
virtualHW.productCompatibility = "hosted"
powerType.powerOff = "soft"
powerType.powerOn = "soft"
powerType.suspend = "soft"
powerType.reset = "soft"
tools.syncTime = "FALSE"
sound.autoDetect = "TRUE"
sound.fileName = "-1"
sound.present = "TRUE"
vcpu.hotadd = "TRUE"
memsize = "2048"
mem.hotadd = "TRUE"
scsi0.virtualDev = "lsilogic"
scsi0.present = "TRUE"
sata0.present = "TRUE"
scsi0:0.fileName = "/vm/mac/vmInfra/HDD1/vmInfra.vmdk"
scsi0:0.present = "TRUE"
sata0:1.deviceType = "cdrom-image"
sata0:1.fileName = "/vm/ISOs/ServerOS/rhel-server-7.4-x86_64-dvd.iso"
sata0:1.present = "TRUE"
usb.present = "TRUE"
ehci.present = "TRUE"
svga.graphicsMemoryKB = "786432"
ethernet0.addressType = "generated"
ethernet0.virtualDev = "e1000"
serial0.fileType = "thinprint"
serial0.fileName = "thinprint"
ethernet0.present = "TRUE"
serial0.present = "TRUE"
extendedConfigFile = "vmInfra.vmxf"
floppy0.present = "FALSE"
gui.lastPoweredViewMode = "fullscreen"
tools.upgrade.policy = "useGlobal"
uuid.bios = "56 4d dc 8c 5d 05 94 57-36 e8 ed 84 34 79 8c 1f"
uuid.location = "56 4d dc 8c 5d 05 94 57-36 e8 ed 84 34 79 8c 1f"
migrate.hostlog = "./vmInfra-e6b36999.hlog"
scsi0:0.redo = ""
pciBridge0.pciSlotNumber = "17"
pciBridge4.pciSlotNumber = "21"
pciBridge5.pciSlotNumber = "22"
pciBridge6.pciSlotNumber = "23"
pciBridge7.pciSlotNumber = "24"
scsi0.pciSlotNumber = "16"
usb.pciSlotNumber = "32"
ethernet0.pciSlotNumber = "33"
sound.pciSlotNumber = "34"
ehci.pciSlotNumber = "35"
vmci0.pciSlotNumber = "36"
sata0.pciSlotNumber = "37"
ethernet0.generatedAddress = "00:0C:29:79:8C:1F"
ethernet0.generatedAddressOffset = "0"
vmci0.id = "880380959"
monitor.phys_bits_used = "43"
vmotion.checkpointFBSize = "8388608"
vmotion.checkpointSVGAPrimarySize = "134217728"
cleanShutdown = "TRUE"
softPowerOff = "TRUE"
usb:1.speed = "2"
usb:1.present = "TRUE"
usb:1.deviceType = "hub"
usb:1.port = "1"
usb:1.parent = "-1"
svga.guestBackedPrimaryAware = "TRUE"
scsi0:1.fileName = "/vm/mac/vmInfra/var-cache/vmInfra_var-cache.vmdk"
scsi0:1.present = "TRUE"
scsi0:1.redo = ""
scsi0:2.fileName = "/vm/mac/vmInfra/localRepo/localRepo.vmdk"
scsi0:2.present = "TRUE"
scsi0:2.redo = ""
ethernet0.connectionType = "nat"
annotation = "Infra server for somuVMnet's internal LAN. Hosts the localRepo for updates in LAN @ ftp://10.0.99.99/localRepo|0A|0AIP : 10.0.99.99/24."
usb:0.present = "TRUE"
usb:0.deviceType = "hid"
usb:0.port = "0"
usb:0.parent = "-1"
Since continuum didn't/couldn't find any fixes with the .vmx file, I had to find an alternative. Thanks for trying, continuum. Turns out that the /etc/vmware/vmnet99/dhcpd/dhcpd.conf file needs an entry for each static IP that needs to be assigned. Of course, the static IPs shouldn't clash with the DHCP range (by default <net>.128 - <net>.253) and thus should lie within <net>.3 - <net>.127 if the DHCP range hasn't been adjusted. The entries should be inserted at the bottom of the dhcpd.conf file, OUTSIDE the DO NOT MODIFY section. They take the form:
host vmInfra.somuVMnet.local {
hardware ethernet 00:0C:29:79:8C:1F;
fixed-address 10.0.99.99;
}
The MAC address provided in the hardware ethernet value is the one assigned to the virtual NIC of the VM. Now, this file should only be edited once the VMs have been shut down, and need a restart of the dhcpd service running on the host for the vmnet. Since I couldn't find the individual service linked to the particular vmnet, I just restarted the vmware service itself, using:
systemctl restart vmware; systemctl status -l vmware
Now we ensure that with that last part that the vmware service started properly. If it's running, and the dhcp server is running on the vmnet, then the VM will be auto-assigned the requested IP and there is no need to explicitly setup the IP using NetworkManager. (I have no clue what happens if the IPs clash, bdw). My VMs can now successfully SSH into the host and vice versa.