First, the topology is as follows:
I. PC1 sets 192.168.1.254 as its default gateway.
When PC1 communicates with PC2 for the first time, we all know that when data is encapsulated between Layer 3 and Layer 2, ARP is called to find the MAC address of the Peer end, however, if PC2's IP192.168.2.1 and IP192.168.1.1 are not in the same CIDR Block, PC1 will find the MAC address of its default gateway in the ARP table, if it is found, the MAC address of the vro is directly encapsulated into a layer-2 frame and sent to the router R1. If it is not found, then PC1 will send an ARP broadcast to find the MAC address of the gateway, and then encapsulate the MAC address of the gateway into the data frame.
2. No Default Gateway is set for PC1
Similarly, PC1 communicates with PC2 for the first time, but this time PC1 suddenly finds that it has not set the default gateway. It does not know how to reach router R1 or whether there is a router in the network, PC1 then sends an ARP request to 192.168.2.1. Then, when R1 receives the ARP request, it finds that it knows how to proceed to 192.168.2.1. Then, it replies its MAC address to pc1, to respond to the PC1 ARP request. In fact, the vro spoofs PC1 so that PC1 considers 192.168.2.1 as the port f0/0 of the vro. In the future, all packets sent from PC1 to 192.168.2.1 will be sent to router R1, then, it is sent to pc2.
The above process is the proxy ARP.
This article is from the "Xia Yang" blog