2

On my VMware internal nat network, when I try to do a simple HTTP request from my guest to my host OS, the arp request from my guest os asks for the MAC address of my host IP and attach it in the destination MAC of the following packets which is totally expected.

When I try the same thing on a real network(i.e on my school's network while my 'guest os' is now directly connected to the real network through a usb wifi dongle), it seems that the ARP request sent out from my 'guest os' now asks for the MAC address of another IP(which appears to be a switch) instead. Why doesn't my guest os just ask directly for the IP address of my host OS like before? How does my guest os know what ip to look for when sending requests?

2

ARP requests are normally limited to one broadcast domain (one subnet if you like). So when host A knows (based on subnet mask) that host B is located in the same broadcast domain, it sends ARP directly to host B. With ARP host A determines B's mac and sends frame with MAC B and IP B.

Otherwise it looks into IP routing table in order to determine nexthop for B's network if any. You probably have only one IPv4 route on your host - default one. So now host A should send IP packet with IP B and MAC of default gateway - that is how frame reaches IP nexthop. That is why ARP is being sent to DGW.

P. S. I believe your question is off topic here.

1

It first determines if the required IP address is local or requires going via a router - to do this is compares the RequiredIPaddress against the LocalIPAddress of each interface , It does a binary and with the NetworkMask to clear the lower order bits If these are exactly the same then the ARP request will be sent out that interface. It will be a broadcast at layer 2

If however there are no matches for this "is it local question" then it will route. So it works out the next hop address and gets the IPaddress of a router - it will do another ARP lookup for the IP address of the router.

What you description sounds like is that it did not match the addresses in the "is it local" part and it found that the Switch is the router it wants to use.

0

If your guest OS got IP from DHCP server then guest os DHCP client will send a ARP request for the IP it got from DHCP server, to check any conflict is there in the network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.