1

Using VMWare Workstation 12 Player on host machine, Win 10.

Would like to create two separate networks using VMWare, yet they have Internet connection.

Kali Linux, 192.168.88.129 has NAT network adapter

Windows XP, 192.168.1.4 has bridged network adapter

Windows XP cannot ping Kali Linux, but why is Kali Linux able to ping Windows XP.

I wish for them to be separate networks, only having Internet connection.

Below is screenshot. Please help.

enter image description here

1 Answer 1

2

The difference is in the NAT vs BRIDGE connection.

NAT Network Address Translation .. basically hides ONE ip behind another, it "translates" the IP and port calls from the Natted Address, to be from host server/pc itself.

Bridge network adapters listen and forward traffic to/for the correct network segments. A "network bridge" listens to MAC's and will learn if an Address/mac are on the same side. When the IP/Mac are on the same side of a bridge, it doesn't forward the traffic across the bridge, when the ip/mac are on opposite sides of the bridge, the traffic is forwarded across.

Think of a bridge over a river in the same city. Both sides of the city are the same name, its just traffic for one side has to cross the bridge for the other side. If your destination is not in the "other half" of the city, then you simply don't cross the bridge.

So in your XP machine, with Bridge Mode Networking.. the "city" is 192.168.1.x, your VM lives at 192.168.1.4 .. and as you saw, the NAT ip address is 192.168.88.x.

Your Bridged VM's address is in 192.168.1.x, and if you look at your real host pc's IP address it will also be in the 192.168.1.x address space.

Lets say your real physical PC is 192.168.1.3 Your XP vm is 192.168.1.4 Your Linux VM 192.168.88.129

In a NAT/PAT situation ...you start from 192.168.88.129, you're trying to go to www.google.com.

Your connection goes into the host pc (your real physical machine) it sees you're going to Port 80 at www.google.com, it sees you started from .. say.. port 4125 ... it converts or tracks the source port (192.168.88.129:4125) and source IP address of the network packet, it re-writes the IP and/or PORT to 192.168.1.3:4225 ... the destination in the packet is still www.google.com:80 but the new source of the network packet is 192.168.1.3:4225

The Reply from Google would come back to 192.168.1.3:4225 .. the NAT/PAT TABLE has an entry, that says your real physical machine translated 192.168.88.129:4125 .. to 192.168.1.3:4225 .. so traffic coming back to port 4225 on ip 192.168.1.3 gets the destination re-written to 192.168.88.129:4125

recap.. NAT / PAT change the IP's and Ports of the source when traffic is going outbound through NAT/PAT, and then for inbound traffic, it converts (re-writes) the destination ip and port back to the original.

Shutdown your Linux VM .. change the NIC to Bridge Mode, and you will see DHCP gives it a 192.168.1.x IP address and you will be able to ping both ways (baring iptables on linux, or windows firewall on XP)

If you want two separate network segments, your gateway needs to support both networks, both VM's would go into bridged mode, and then you'd change one's subnet.

Less complicated is to run two nic's in the PC, one nic to each network segment, then set the bridge for each VM to one of the NIC's networks.

2
  • Should also mention bridging two different networks off one nic may not work (haven't tried recently with VMware and it may be a issue in windows) 2 nics is the best way, just don't set a gateway address on the second NIC of the real physical machine, doing so could cause havoc for your regular traffic
    – TG2
    Aug 21, 2016 at 19:07
  • Very detailed and thorough!
    – Rhonda
    Aug 22, 2016 at 9:25

You must log in to answer this question.

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