Scenario: Computer A has a local ip of 192.168.1.100, which is running a VM inside of it. The VM now makes a tcp request to an external IP address (74.125.225.98).
Could someone explain how the request is routed both to the remote ip and then back to the VM?
From my understanding, the VM wraps this request in an IP packet with the destination ip, and then wrapped again inside an Ethernet frame with its own unique (probably fake) MAC address. The router then replaces the VM's ip and MAC with its own, and sets the destination MAC to the ISP's router.
My main confusion is, when the tcp response is created and sent back to the VM... since the VM is running inside computer A, how would the router run an ARP request to get the VMs MAC address?
Thanks for the help :)
EDIT:
Found the following video which helped explain NAT: https://www.youtube.com/watch?v=01ajHxPLxAw