1. 程式人生 > >1-PC1有默認網關/Normal-ARP(正常ARP)

1-PC1有默認網關/Normal-ARP(正常ARP)

代理arp 驗證 sha log 默認 ado pin lin col

1、實驗拓撲:
技術分享圖片
拓展:
(1)PC1問跨網段的目的的MAC,這時候默認網關會把自己的MAC給PC1,這個時候就是代理ARP的過程。
(2)電腦也是有路由表的,要去Ping別人,要去先找有沒這條路由條目
2、命令部署:
基本部署:
PC1(config)#int f0/0
PC1(config-if)#no shutdown
PC1(config-if)#ip add 12.1.1.1 255.255.255.0
PC1(config)#no ip routing

R2(config)#int f0/0
R2(config-if)#no shutdown
R2(config-if)#ip add 12.1.1.2 255.255.255.0

R2(config-if)#int f0/1
R2(config-if)#no shutdown
R2(config-if)#ip add 23.1.1.2 255.255.255.0

R3(config)#int f0/0
R3(config-if)#no shutdown
R3(config-if)#ip add 23.1.1.3 255.255.255.0
R3(config-if)#int lo1
R3(config-if)#ip add
R3(config-if)#ip add 3.3.3.3 255.255.255.0

重點部署:
PC1(config)#ip default-gateway 12.1.1.2

R2(config)#ip route 0.0.0.0 0.0.0.0 23.1.1.3
R3(config)#ip route 12.1.1.0 255.255.255.0 f0/0

3、抓包驗證:
(1)查看R2—>f0/0的MAC地址、PC—>f0/0的MAC地址等
PC1#show arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 12.1.1.2 - c001.1858.0000 ARPA FastEthernet0/0

PC1#show int f0/0
FastEthernet0/0 is up, line protocol is up

Hardware is Gt96k FE, address is c001.1858.0000 (bia c001.1858.0000)

R2#show int f0/0
FastEthernet0/0 is up, line protocol is up
Hardware is Gt96k FE, address is c002.3430.0000 (bia c002.3430.0000)

清除ARP:
方法:先把PC1接口shutdown—>no shutdown—>clear arp-cache

R2開啟Debug功能:
R2#debug arp
ARP packet debugging is on

(2)抓包結果:
R2#
Mar 1 00:28:34.899: IP ARP: rcvd req src 12.1.1.1 c001.1858.0000, dst 12.1.1.2 FastEthernet0/0
Mar 1 00:28:34.899: IP ARP: sent rep src 12.1.1.2 c002.3430.0000,
dst 12.1.1.1 c001.1858.0000 FastEthernet0/0
新版抓包,抓到的還是3.3.3.3的地址。
(3)看到的地址永遠是R2的f0/0的MAC地址

技術分享圖片

1-PC1有默認網關/Normal-ARP(正常ARP)