proxy arp 代理ARP
思科官網上是這麼介紹它的,Proxy ARP is the technique in which one host, usually a router, answers ARP requests intended for another machine. By "faking" its identity, the router accepts responsibility for routing packets to the "real" destination. Proxy ARP can help machines on a subnet reach remote subnets without the need to configure routing or a default gateway.大概意思就是代理ARP可以幫助一個網段上的機器不通過配置路由或者網關就能通路另一個網段的機器。
接下來用實驗來證明一下。拓撲如下

R1:e0/0 12.1.1.1/24
R2:e0/0 12.1.1.2/24 e0/1 23.1.1.2/24
R3:e0/1 23.1.1.3
配置完上面的基礎配置後,我們将R1模拟成一台PC
R1(config)#no ip routing
R2(config)#ip arp proxy 全局開啟代理ARP功能
R3(config)#ip route 12.1.1.0 255.255.255.0 23.1.1.2 R3上開啟回包的靜态路由
首先在R1上面開啟debug arp
然後在R1上ping 23.1.1.3 檢視現象
ping通
*Mar 1 00:07:58.587: IP ARP: creating incomplete entry for IP address: 23.1.1.3 interface Ethernet0/0
*Mar 1 00:07:58.591: IP ARP: sent req src 12.1.1.1 cc00.13ac.0000,
dst 23.1.1.3 0000.0000.0000 Ethernet0/0
*Mar 1 00:07:58.623: IP ARP: rcvd rep src 23.1.1.3 cc01.13ac.0000, dst 12.1.1.1 Ethernet0/0
Internet 12.1.1.2 - cc01.13ac.0000 ARPA Ethernet0/0
雖然回應的位址是23.1.1.3 但是MAC位址卻是R2的e0/0的MAC位址。這正好證明了代理ARP的功能,R2做了回好人,讓R1認為自己就是R3。這就是代理ARP的原理