VMware Cloud Community
DePaulstudent
Contributor
Contributor

How is the default gateway configured via DHCP in VMs?

Hi all,

I am working with Kali Linux and enabled DHCP. Now I have a dynamic IP address assigned of 192.168.81 and a default gateway of 192.168.81.2. What I don't understand is, how does Kali determine the default gateway? I know the default gateway is usually the IP address of a physical router, so I'm wondering how this works. I don't have any router with the IP Address of 192.168.81.2 so I don't understand how Kali can actually access the internet and where the IP packets are going.

Is it the case that maybe Kali Linux will map the VM gateway to the IP address of physical PC? My physical PCs default gateway is 10.104.224.1. I thought maybe my VMs default gateway would also be 10.104.224.1.

I am pretty confused and would appreciate some advice.

Thanks,

Linda

Graduate student , DePaul U.

Reply
0 Kudos
1 Reply
bluefirestorm
Champion
Champion

The answer is it depends on how your VM's virtual NIC is configured.

I would guess that your Kali Linux guest VM is configured to use Network Address Translation (NAT). If that is the configuration there is a virtual network switch (VMNet8) that it connects to and that is where it gets its IP address and gateway.

There is a lot more explanation for the different network options for VMs in the VMware documentation, community site and elsewhere than I could possibly cover. But I hope this short explanation gives some clarity and give the impetus to read more.

Reply
0 Kudos