ccnp第1講之筆記(靜態路由)

一、路由條目的選擇:對於目的地和掩碼相同的路由條目,先比較管理距離(代表路由條目的來源),管理距離小的存放如路由表中;管理距離一樣的比較度量值(metric),度量值表示路徑的好壞,選擇小的加表,如果一樣則同時加表,這點就實現了基於三層的負載均衡。

二、靜態路由的配置:ip route 目的ip 掩碼  X(下一跳地址或者出站接口) [distance]    [permanent]

X什麼時候寫下一跳地址,什麼時候寫出站接口

網段大體分爲2類:多路訪問(MA),點到點(P2P);  其中MA包括以太網,幀中繼,P2P包括HDLC,PPP。

如果靜態路由對應的出口接口是一個MA接口,建議選擇下一跳地址,因爲MA網段可能包含多個節點,如果不是選擇下一跳而是出站接口,會導致轉發路由器無限地針對目的ip進行arp請求,並且如果對端路由器開啓了代理arp,不管請求誰的mac地址,都會回覆自己的mac地址。這會導致大量的arp在網絡中轉發,浪費了帶寬和arp表項。如果是P2P網段,建議選擇出站接口,因爲如果選擇下一跳,路由器會對下一跳地址進行路由查詢來找到出口接口,這樣就造成了遞歸表查詢。所以,建議全寫,既寫下一跳地址,又寫出站接口。

三、用靜態路由做路由控制

對於距離矢量路由協議:在路由協議A中將一個接口使用NETWORK語句宣告進協議A,會實現該接口對於該協議報文的收發

收:鄰居傳遞過來的所有路由條目

發:該路由器所有被宣告進協議A的接口的C(直連)路由,以及通過這下接口獲悉的鄰居傳遞過來的屬於該協議的並且被加入路由表的路由。

在DV(距離矢量)協議中,使用靜態路由就可以覆蓋通過DV IGP獲悉的動態路由條目,實現該路由條目的傳遞過濾,在LS(鏈路狀態) IGP中,靜態路由無法實現路由過濾。

四、靜態路由命令參數

A、permanent(永久存在)

在沒有加permanent參數時,如果靜態路由所關聯的發包接口shutdown了,則這條路由條目也不會存在。

在SVC(交換虛電路,按照需求才產生鏈路,沒有鏈路時接口就是shutdown的)中,使用靜態路由就常常使用到這個參數。

B、distance

使用靜態路由使用冗餘備份,即浮動靜態路由

在運行路由協議X的網絡中,添加一條大於該協議X的管理距離的靜態路由,當協議X產生的路由鏈路出現故障時,則這條靜態路由會作爲備用路由出現,否者不會出現在路由表中。

只在擁有冗餘鏈路的時候才建議使用這個參數做備份,其他時候不建議使用。

五、

對於PC,如果該設備接收到了路由器傳遞的代理arp reply,則該PC會無條件的信任這個reply,並且將其加入arp表中。

對於路由器,如果該設備接收到了代理arp reply ,則該路由器會優先判斷該reply中應答者IP地址所在的網段是否可達,如果是,則接受,如果不是,則直接丟棄。

六、

遞歸路由、代理arp的實驗

實驗目的:當靜態路由的下一跳爲非直連ip時,研究遞歸路由的情況;研究arp的情況。

實驗拓撲:

實驗步驟:

1、配置完基本命令及ip

2、在R1上做靜態路由,下一跳爲R4的F0/0:ip route  4.4.4.0  255.255.255.0  f0/0  200.2.2.4

R2和R3:ip route 4.4.4.0 255.255.255.0 f0/1 200.2.2.4

3、R2,R2,R3都debug arp。

4、在R1:ping 4.4.4.4

觀察結果:R1:

*Mar  1 01:07:56.203: IP ARP: creating incomplete entry for IP address: 200.2.2.4 interface FastEthernet0/0
*Mar  1 01:07:56.203: IP ARP: sent req src 100.1.1.1 c800.04c4.0000,
dst 200.2.2.4 0000.0000.0000 FastEthernet0/0
*Mar  1 01:07:56.255: IP ARP rep filtered src 200.2.2.4 c802.04c4.0000, dst 100.1.1.1 c800.04c4.0000 wrong cable, interface FastEthernet0/0
*Mar  1 01:07:56.255: IP ARP rep filtered src 200.2.2.4 c801.04c4.0000, dst 100.1.1.1 c800.04c4.0000 wrong cable, interface FastEthernet0/0.
*Mar  1 01:07:58.199: IP ARP throttled out the ARP Request for 200.2.2.4.

R2:

*Mar  1 01:07:26.531: IP ARP: rcvd req src 100.1.1.1 c800.04c4.0000, dst 200.2.2.4 FastEthernet0/0
*Mar  1 01:07:26.531: IP ARP: sent rep src 200.2.2.4 c801.04c4.0000,
dst 100.1.1.1 c800.04c4.0000 FastEthernet0/0

R3:

*Mar  1 01:06:55.627: IP ARP: rcvd req src 100.1.1.1 c800.04c4.0000, dst 200.2.2.4 FastEthernet0/0
*Mar  1 01:06:55.631: IP ARP: sent rep src 200.2.2.4 c802.04c4.0000,
dst 100.1.1.1 c800.04c4.0000 FastEthernet0/0

R1查找路由,知道到4.4.4.4的下一跳爲200.2.2.4,但是不知道200.2.2.4怎麼去,於是發送arp請求,通過f0/0端口廣 播出去,而R2、R3知道到200.2.2.4怎麼去,同時代理arp是默認開啓的,於是都回復arp reply,告訴R1 200.2.2.4的mac地址是自己的F0/0 mac地址。

於是R1收到的arp reply是這樣的:200.2.2.4的mac地址是xxx-xxx-xxx(R2或者R3的相應端口mac)。同時R1又發現200.2.2.4不可達,於是丟棄。通過show arp驗證是否丟棄:

r1#show arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  100.1.1.1               -   c800.04c4.0000  ARPA   FastEthernet0/0
Internet  100.1.1.2              71   c801.04c4.0000  ARPA   FastEthernet0/0
Internet  100.1.1.3              71   c802.04c4.0000  ARPA   FastEthernet0/0
r1#

可以發現,arp表中並沒有200.2.2.4的項目。

5、從上面可以看到只要再給R1一個靜態路由,告訴它200.2.2.4可達,是否就可以添加上200.2.2.4的arp項?好的,現在來做一下:

R1:

ip route 200.2.2.0 255.255.255.0 f0/0 100.1.1.2

ping 4.4.4.4

查看結果:

Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:

*Mar  1 01:30:32.247: IP ARP: creating incomplete entry for IP address: 200.2.2.4 interface FastEthernet0/0
*Mar  1 01:30:32.247: IP ARP: sent req src 100.1.1.1 c800.04c4.0000,
dst 200.2.2.4 0000.0000.0000 FastEthernet0/0
*Mar  1 01:30:32.299: IP ARP: rcvd rep src 200.2.2.4 c802.04c4.0000, dst 100.1.1.1 FastEthernet0/0
*Mar  1 01:30:32.303: IP ARP: rcvd rep src 200.2.2.4 c801.04c4.0000, dst 100.1.1.1 FastEthernet0/0…..
Success rate is 0 percent (0/5)

查看arp表show arp:

Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  100.1.1.1               -   c800.04c4.0000  ARPA   FastEthernet0/0
Internet  100.1.1.2              83   c801.04c4.0000  ARPA   FastEthernet0/0
Internet  100.1.1.3              83   c802.04c4.0000  ARPA   FastEthernet0/0
Internet  200.2.2.4               3   c801.04c4.0000  ARPA   FastEthernet0/0

發現arp請求只發送了一次,並且在arp表裏已經有了200.2.2.4的表項,上面顯示爲R2的f0/0 mac地址,如果在R4中有回包路由,就可以ping通了。所走的路徑就是R1-R2-R4。

那麼,在R1中,這條靜態路由(稱爲A,  S    200.2.2.0/24 [1/0] via 100.1.1.2, FastEthernet0/0)的作用是什麼?

A路由是爲了主路由(稱爲B,  S       4.4.4.0 [1/0] via 200.2.2.4, FastEthernet0/0)而服務的,所以可以稱A路由爲遞歸路由,那麼遞歸路由在尋徑過程中的作用是什麼?影不影響路徑的選擇?

仔細觀察下遞歸路由S    200.2.2.0/24 [1/0] via 100.1.1.2, FastEthernet0/0,其中也有下一跳via 100.1.1.2,那麼這個下一跳地址對於尋徑有沒有影響呢?是不是這樣的:當這個下一跳爲R2的F0/0時,就走上面的路徑(R1-R2-R4);而 當下一跳爲R3的F0/0時,就走下面的路徑(R1-R3-R4)?

下面我就來驗證下能不能,先shutdown掉R2,然後重新寫一個下一跳走R3的遞歸路由,看看結果。好的,我先讓R1能夠ping通:

6、在R4上做一個回包路由:ip route 100.1.1.0 255.255.255.0 f0/0 200.2.2.2

並且做個負載均衡

ip route 100.1.1.0 255.255.255.0 f0/0 200.2.2.3

查看結果R4:show ip route

100.0.0.0/24 is subnetted, 1 subnets
S       100.1.1.0 [1/0] via 200.2.2.2, FastEthernet0/0
                  [1/0] via 200.2.2.3, FastEthernet0/0
4.0.0.0/24 is subnetted, 1 subnets
C       4.4.4.0 is directly connected, Loopback0
C    200.2.2.0/24 is directly connected, FastEthernet0/0

R1:

r1#ping 4.4.4.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/50/96 ms

7、shutdown掉R2,重新做個走R3的遞歸路由

r2(config-if)#int f0
*Mar  1 02:17:39.147: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
*Mar  1 02:17:40.147: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
r2(config-if)#int f0/1
r2(config-if)#shutd
r2(config-if)#
*Mar  1 02:17:47.027: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
*Mar  1 02:17:48.027: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

R1:

r1(config)#no ip route 200.2.2.0 255.255.255.0 f0/0 100.1.1.2

r1(config)#ip route 200.2.2.0 255.255.255.0 f0/0 100.1.1.3

8、在R1、R4上打開debug,然後查看結果

r1#debug ip packet detail
IP packet debugging is on (detailed)
r1#debug ip icmp
ICMP packet debugging is on

r4#debug ip packet detail
IP packet debugging is on (detailed)
r4#debug ip icmp
ICMP packet debugging is on

查看結果R1:

r1#ping 4.4.4.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:

*Mar  1 02:30:29.515: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 02:30:29.515:     ICMP type=8, code=0.
*Mar  1 02:30:31.515: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 02:30:31.515:     ICMP type=8, code=0.
*Mar  1 02:30:33.515: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 02:30:33.515:     ICMP type=8, code=0.
*Mar  1 02:30:35.515: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 02:30:35.515:     ICMP type=8, code=0.
*Mar  1 02:30:37.515: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 02:30:37.515:     ICMP type=8, code=0.
Success rate is 0 percent (0/5)

而這個時候R4上沒有收到任何數據包

r4#debug ip packet detail
IP packet debugging is on (detailed)
r4#debug ip icmp
ICMP packet debugging is on
r4#
r4#

這代表R2 DOWN掉的時候,仍然走的是上面的路徑,並沒有走下面的路徑。

所以遞歸路由的作用僅僅是在R1收到ARP Reply時,告訴R1這個reply是可信賴的,即目標網段是可達的。無論下一跳地址是什麼,都不影響路徑的選擇,而影響路徑選擇的是R1的arp表中目標地址的mac,這個mac地址是由R2、R3的 arp reply決定的,即R2、R3的arp reply誰後到,誰就是arp表項中的地址。

但是遞歸路由的作用是爲了增加靜態路由的靈活性

那麼怎麼樣才能實現這個靈活性呢?即當R2 DOWN的時候走下面的路徑,R3 DOWN的時候走上面的路徑?

這個時候要先了解一下arp發送的根本原理:在路由器中,對於一個目的ip地址,如果arp中有這個IP的表項,那麼除非這個表項消失,否者路由器永遠不會對這個IP地址進行arp請求。而arp表項的存在時間默認是4個小時。

所以,只要修改了arp表項的存在時間,就可以很快速的實現路由切換。

好的,我來做一下:

9、修改R1的arp表項 存在時間爲10秒,同時也要修改R4的爲10秒

r1(config)#int f0/0
r1(config-if)#arp timeout ?
<0-2147483>  Seconds

r1(config-if)#arp timeout 10

這個時候,R1馬上就產生了一個提示信息

*Mar  1 02:48:01.267: IP ARP: sent req src 100.1.1.1 c800.04c4.0000,
dst 100.1.1.2 c801.04c4.0000 FastEthernet0/0
*Mar  1 02:48:01.267: IP ARP: sent req src 100.1.1.1 c800.04c4.0000,
dst 100.1.1.3 c802.04c4.0000 FastEthernet0/0
*Mar  1 02:48:01.267: IP ARP: sent req src 100.1.1.1 c800.04c4.0000,
dst 200.2.2.4 c801.04c4.0000 FastEthernet0/0
*Mar  1 02:48:01.287: IP ARP: rcvd rep src 100.1.1.3 c802.04c4.0000, dst 100.1.1.1 FastEthernet0/0
*Mar  1 02:48:01.291: IP ARP: creating entry for IP address: 100.1.1.3, hw: c802.04c4.0000

這個就意味這arp表項的消失,查看一下arp表

r1#show arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  100.1.1.1               -   c800.04c4.0000  ARPA   FastEthernet0/0
Internet  100.1.1.3               0   c802.04c4.0000  ARPA   FastEthernet0/0

發現200.2.2.4的表項已經消失了。

10、查看結果

R1:

r1#ping 4.4.4.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:

*Mar  1 03:00:15.871: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:00:15.875:     ICMP type=8, code=0.!
*Mar  1 03:00:17.871: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:00:17.871:     ICMP type=8, code=0
*Mar  1 03:00:17.887: IP: s=4.4.4.4 (FastEthernet0/0), d=100.1.1.1 (FastEthernet0/0), len 100, rcvd 3
*Mar  1 03:00:17.891:     ICMP type=0, code=0
*Mar  1 03:00:17.891: ICMP: echo reply rcvd, src 4.4.4.4, dst 100.1.1.1
*Mar  1 03:00:17.891: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:00:17.891:     ICMP type=8, code=0.!
*Mar  1 03:00:19.891: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:00:19.891:     ICMP type=8, code=0
*Mar  1 03:00:19.923: IP: s=4.4.4.4 (FastEthernet0/0), d=100.1.1.1 (FastEthernet0/0), len 100, rcvd 3
*Mar  1 03:00:19.923:     ICMP type=0, code=0
*Mar  1 03:00:19.923: ICMP: echo reply rcvd, src 4.4.4.4, dst 100.1.1.1
*Mar  1 03:00:19.923: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:00:19.927:     ICMP type=8, code=0.
Success rate is 40 percent (2/5), round-trip min/avg/max = 20/26/32 ms

多ping幾次

r1#ping 4.4.4.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!
*Mar  1 03:01:24.403: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:01:24.403:     ICMP type=8, code=0
*Mar  1 03:01:24.471: IP: s=4.4.4.4 (FastEthernet0/0), d=100.1.1.1 (FastEthernet0/0), len 100, rcvd 3
*Mar  1 03:01:24.471:     ICMP type=0, code=0
*Mar  1 03:01:24.471: ICMP: echo reply rcvd, src 4.4.4.4, dst 100.1.1.1
*Mar  1 03:01:24.475: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:01:24.475:     ICMP type=8, code=0.!
*Mar  1 03:01:26.471: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:01:26.471:     ICMP type=8, code=0
*Mar  1 03:01:26.503: IP: s=4.4.4.4 (FastEthernet0/0), d=100.1.1.1 (FastEthernet0/0), len 100, rcvd 3
*Mar  1 03:01:26.503:     ICMP type=0, code=0
*Mar  1 03:01:26.503: ICMP: echo reply rcvd, src 4.4.4.4, dst 100.1.1.1
*Mar  1 03:01:26.507: IP: s=100.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:01:26.507:     ICMP type=8, code=0.!
Success rate is 60 percent (3/5), round-trip min/avg/max = 24/44/72 ms

所以,只要修改了arp表項的存在時間,就可以很快速的實現路由切換。

那麼延伸一下,如果要R1去R4走上面路徑,而R4到R1走下面路徑要怎麼辦?

其實,只有在R3上關閉對R1的代理ARP功能,就能實現R1到R4走上面路徑了,同理也要關閉R2對R4的代理ARP。

好的,我來做下:

11、還原配置

R4:

r4(config)#no ip route 100.1.1.0 255.255.255.0 f0/0 200.2.2.2
r4(config)#no ip route 100.1.1.0 255.255.255.0 f0/0 200.2.2.3

R2:

r2(config)#int f0/0
r2(config-if)#no shutd
r2(config-if)#int f0/1
r2(config-if)#
*Mar  1 03:14:40.543: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 03:14:41.543: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
r2(config-if)#no shut
r2(config-if)#
*Mar  1 03:14:46.555: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 03:14:47.555: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

 

12、R4寫主路由和遞歸路由

r4(config)#ip route 1.1.1.0 255.255.255.0 f0/0 100.1.1.1
r4(config)#ip route 100.1.1.0 255.255.255.0 f0/0

13、清理一下R1和R4的arp

r1(config)#int f0/0
r1(config-if)#shutd
r1(config-if)#end
r1#
*Mar  1 03:12:51.443: %SYS-5-CONFIG_I: Configured from console by console
r1#clear arp
r1#clear arp-cache
r1#
r1#show arp

r1#

14、重新開啓R1、R4的F0/0,並show arp

r1#show arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  100.1.1.1               -   c800.04c4.0000  ARPA   FastEthernet0/0

r4#show arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  200.2.2.4               -   c803.04c4.0000  ARPA   FastEthernet0/0

都只有自己的。

15、關閉R3的F0/0和R2的F0/1代理arp功能,同時配置R2和R3去往1.1.1.0網段的路由

r2(config)#int f0/1
r2(config-if)#no ip pro
r2(config-if)#no ip proxy-arp

r3(config-if)#int f0/0
r3(config-if)#no ip pro
r3(config-if)#no ip proxy-arp

16、驗證結果

r1#ping 4.4.4.4 source 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/60/136 ms
r1#
*Mar  1 03:27:21.967: IP: s=1.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:27:21.967:     ICMP type=8, code=0
*Mar  1 03:27:22.099: IP: s=4.4.4.4 (FastEthernet0/0), d=1.1.1.1, len 100, rcvd 4
*Mar  1 03:27:22.103:     ICMP type=0, code=0
*Mar  1 03:27:22.103: ICMP: echo reply rcvd, src 4.4.4.4, dst 1.1.1.1
*Mar  1 03:27:22.103: IP: s=1.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:27:22.103:     ICMP type=8, code=0
*Mar  1 03:27:22.175: IP: s=4.4.4.4 (FastEthernet0/0), d=1.1.1.1, len 100, rcvd 4
*Mar  1 03:27:22.175:     ICMP type=0, code=0
*Mar  1 03:27:22.179: ICMP: echo reply rcvd, src 4.4.4.4, dst 1.1.1.1
*Mar  1 03:27:22.179: IP: s=1.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:27:22.179:     ICMP type=8, code=0
*Mar  1 03:27:22.191: IP: s=4.4.4.4 (FastEthernet0/0), d=1.1.1.1, len 100, rcvd 4
*Mar  1 03:27:22.191:     ICMP type=0, code=0
*Mar  1 03:27:22.195: ICMP: echo reply rcvd, src
r1# 4.4.4.4, dst 1.1.1.1
*Mar  1 03:27:22.195: IP: s=1.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:27:22.195:     ICMP type=8, code=0
*Mar  1 03:27:22.239: IP: s=4.4.4.4 (FastEthernet0/0), d=1.1.1.1, len 100, rcvd 4
*Mar  1 03:27:22.239:     ICMP type=0, code=0
*Mar  1 03:27:22.239: ICMP: echo reply rcvd, src 4.4.4.4, dst 1.1.1.1
*Mar  1 03:27:22.239: IP: s=1.1.1.1 (local), d=4.4.4.4 (FastEthernet0/0), len 100, sending
*Mar  1 03:27:22.243:     ICMP type=8, code=0
*Mar  1 03:27:22.267: IP: s=4.4.4.4 (FastEthernet0/0), d=1.1.1.1, len 100, rcvd 4
*Mar  1 03:27:22.267:     ICMP type=0, code=0
*Mar  1 03:27:22.267: ICMP: echo reply rcvd, src 4.4.4.4, dst 1.1.1.1

然後在R2的F0/1上抓包,看看是否只有發往R4的包而沒有R4的迴應包,同時抓R3的F0/1,看看是否只有R4的迴應包。由於我的gns3沒裝抓包工具,很可惜不能這樣驗證了,不過我可以看下R1和R4的arp表項

r1#show arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  100.1.1.1               -   c800.04c4.0000  ARPA   FastEthernet0/0
Internet  200.2.2.4               0   c801.04c4.0000  ARPA   FastEthernet0/0

r4#show arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  100.1.1.1               0   c802.04c4.0001  ARPA   FastEthernet0/0
Internet  200.2.2.2               0   c801.04c4.0001  ARPA   FastEthernet0/0
Internet  200.2.2.4               -   c803.04c4.0000  ARPA   FastEthernet0/0

通過

r2#show int f0/0
FastEthernet0/0 is up, line protocol is up
Hardware is AmdFE, address is c801.04c4.0000 (bia c801.04c4.0000)
Internet address is 100.1.1.2/24

可知c801.04c4.0000是R2的F0/0 mac地址。同理知 c802.04c4.0001是R3的F0/1 mac地址。

所以只要使用好 主路由,遞歸路由,代理arp就可以增加靜態路由的靈活性。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章