2023年CCNP闫辉老师讲解实验手册课堂笔记.docx
《2023年CCNP闫辉老师讲解实验手册课堂笔记.docx》由会员分享,可在线阅读,更多相关《2023年CCNP闫辉老师讲解实验手册课堂笔记.docx(12页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、递归路由实验手册实验规定:R1可以R4的4个子网,并且实现途径的冗余备份实现非对称路由:R1的ICMP echo包和R4的ICMP reply包使用不同途径分析:假如只在R2上配置静态路由:ip route 10.0.1.0 255.255.255.0 f0/1 200.2.2.4ip route 10.1.1.0 255.255.255.0 f0/1 200.2.2.4ip route 10.2.1.0 255.255.255.0 f0/1 200.2.2.4ip route 10.3.1.0 255.255.255.0 f0/1 200.2.2.4那么假如R2路由down掉,想切换到R3这
2、条链路,必须在R3上进行同样的配置:ip route 10.0.1.0 255.255.255.0 f0/1 200.2.2.4ip route 10.1.1.0 255.255.255.0 f0/1 200.2.2.4ip route 10.2.1.0 255.255.255.0 f0/1 200.2.2.4ip route 10.3.1.0 255.255.255.0 f0/1 200.2.2.4假如网络中有成百上千条路由条目,进行这样的配置简直能让人疯掉。-下面,我们来尝试在R1直接配置到目的网段的静态路由:ip route 10.0.1.0 255.255.255.0 f0/0 200
3、.2.2.4ip route 10.1.1.0 255.255.255.0 f0/0 200.2.2.4ip route 10.2.1.0 255.255.255.0 f0/0 200.2.2.4ip route 10.3.1.0 255.255.255.0 f0/0 200.2.2.4此时来查看R1,R2,R3的路由表:R1(config)#do show ip route-Gateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback0
4、 100.0.0.0/24 is subnetted, 1 subnetsC 100.1.1.0 is directly connected, FastEthernet0/0 10.0.0.0/24 is subnetted, 4 subnetsS 10.3.1.0 1/0 via 200.2.2.4, FastEthernet0/0S 10.2.1.0 1/0 via 200.2.2.4, FastEthernet0/0S 10.1.1.0 1/0 via 200.2.2.4, FastEthernet0/0S 10.0.1.0 1/0 via 200.2.2.4, FastEthernet
5、0/0R2(config)#do sh ip route-Gateway of last resort is not set 100.0.0.0/24 is subnetted, 1 subnetsC 100.1.1.0 is directly connected, FastEthernet0/0C 200.2.2.0/24 is directly connected, FastEthernet0/1 10.0.0.0/24 is subnetted, 4 subnetsS 10.3.1.0 1/0 via 200.2.2.4, FastEthernet0/1S 10.2.1.0 1/0 vi
6、a 200.2.2.4, FastEthernet0/1S 10.1.1.0 1/0 via 200.2.2.4, FastEthernet0/1S 10.0.1.0 1/0 via 200.2.2.4, FastEthernet0/1R3(config)#do show ip route-Gateway of last resort is not set 100.0.0.0/24 is subnetted, 1 subnetsC 100.1.1.0 is directly connected, FastEthernet0/0C 200.2.2.0/24 is directly connect
7、ed, FastEthernet0/1 10.0.0.0/24 is subnetted, 4 subnetsS 10.3.1.0 1/0 via 200.2.2.4, FastEthernet0/1S 10.2.1.0 1/0 via 200.2.2.4, FastEthernet0/1S 10.1.1.0 1/0 via 200.2.2.4, FastEthernet0/1S 10.0.1.0 1/0 via 200.2.2.4, FastEthernet0/1可以看出R1,R2,R3都有了去往目的网络的完整路由表此时,假如ping目的网络可以通吗?当然不通,由于R1配置的静态路由只是告诉
8、它去往4个目的网段要从f0/0接口发数据,到达R4的200.2.2.4。可是现在R1没有去往R4到达路由,因此无法ping通。R1(config)#do ping 200.2.2.4Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 200.2.2.4, timeout is 2 seconds:.Success rate is 0 percent (0/5)此时,R1路由器会像一台PC同样,发送ARP请求200.2.2.24 相应的MAC,下面用debug命令来验证一下,在R1,R2,R3的特权模式下都启动debug
9、 arp,在R1上ping其中一个目的IP地址:10.0.1.4R1#ping 10.0.1.4Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.1.4, timeout is 2 seconds:*Mar 1 01:16:11.251: IP ARP: sent req src 100.1.1.1 c001.27a4.0000, dst 200.2.2.4 0000.0000.0000 FastEthernet0/0R1发出的ICMP报文想要发往10.0.1.4,由于没有到达200.2.2.4的路由所以超
10、时。此时R1发出arp广播,以100.1.1.1 mac:c001.27a4.0000为源,请求200.2.2.4的mac地址,由于mac未知,写为全0,并通过F0/0接口发出。*Mar 1 01:16:11.267: IP ARP rep filtered src 200.2.2.4 c003.274c.0000, dst 100.1.1.1 c001.27a4.0000 wrong cable, interface FastEthernet0/0此时,在R2和R3路由上会使用proxy arp(代理ARP),用自己的F0/0接口的MAC地址作为200.2.2.4的MAC地址reply给R1
11、。R2和R3启用proxy arp的条件:启动proxy arp(默认都是启动的)源IP和目的IP在不同的网段R2和R3分别都有去往源IP和目的IP的路由。由拓扑可以看出,它们满足上述三个条件。下面来看一下R2的debug arp的输出:R2#*Mar 1 01:34:15.487: IP ARP: rcvd req src 100.1.1.1 c001.27a4.0000, dst 200.2.2.4 FastEthernet0/0*Mar 1 01:34:15.487: IP ARP: sent rep src 200.2.2.4 c002.271c.0000, dst 100.1.1.1
12、 c001.27a4.0000 FastEthernet0/0R2用F0/0接口的MAC地址:c002.271c.0000回复给R1我们来验证一下:R2#show int f0/0FastEthernet0/0 is up, line protocol is up Hardware is Gt96k FE, address is c002.271c.0000 (bia c002.271c.0000) Internet address is 100.1.1.2/24可以看出的确是用R2的F0/0接口的MAC地址回复给R1的。同理,R3也会把自己的F0/0接口的MAC地址回复给R1。但R1不会接受
13、R2和R3的ARP应答。R1#ping 10.0.1.4Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.1.4, timeout is 2 seconds:*Mar 1 01:16:11.267: IP ARP rep filtered src 200.2.2.4 c002.271c.0000, dst 100.1.1.1 c001.27a4.0000 wrong cable, interface FastEthernet0/0.R1认为R2的arp回应包错误,丢弃此arp包。知识点:由于,R1没有去往2
14、00.2.2.4的路由,因此会过滤掉R2和R3回应的arp包,不会收录进自己的arp cable。假设此时,R1可以信任R2或R3发来的arp回应包,收录进自己的arp cable,由于R2和R3拥有去往目的网段的路由,这样R1就可以ping通目的网络了。然而,R1不能信任R2或R3的arp回应包的因素是什么呢?当然是R1没有去往200.2.2.0/24网段的路由。下面给R1配置一个去往该网段的静态路由。R1(config)#ip route 200.2.2.0 255.255.255.0 f0/0 100.1.1.2此时,R1收录R2和R3的两条回应包。再去ping 10.0.1.4,当然还
15、是ping不通,由于R4没有echo reply包的路由。R1#ping 10.0.1.4Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.1.4, timeout is 2 seconds:*Mar 1 01:30:32.299: IP ARP: rcvd rep src 200.2.2.4 c002.271c.0000, dst 100.1.1.1 FastEthernet0/0*Mar 1 01:30:32.303: IP ARP: rcvd rep src 200.2.2.4 c003.274c.0
16、000, dst 100.1.1.1 FastEthernet0/0R1接受了R2和R3的两条arp回应包。查看R1的arp表:R1#show arpProtocol Address Age (min) Hardware Addr Type InterfaceInternet 100.1.1.1 - c001.27a4.0000 ARPA FastEthernet0/0Internet 100.1.1.2 15 c002.271c.0000 ARPA FastEthernet0/0Internet 200.2.2.4 14 c002.271c.0000 ARPA FastEthernet0/0
17、因此,此时ping10.0.1.4的时候,R1就可以把ICMP echo包发送给R4。再看一下R1的路由表:R1#show ip routeGateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback0 100.0.0.0/24 is subnetted, 1 subnetsC 100.1.1.0 is directly connected, FastEthernet0/0S 200.2.2.0/24 1/0 via 100.1.1.2,
18、 FastEthernet0/0这条静态路由称之为“递归路由” 10.0.0.0/24 is subnetted, 4 subnetsS 10.3.1.0 1/0 via 200.2.2.4, FastEthernet0/0S 10.2.1.0 1/0 via 200.2.2.4, FastEthernet0/0S 10.1.1.0 1/0 via 200.2.2.4, FastEthernet0/0S 10.0.1.0 1/0 via 200.2.2.4, FastEthernet0/0这4条静态路由称之为“主路由”递归路由告诉主路由该怎么从R1的F0/0接口到达200.2.2.4网段,也可
19、以理解为用来解析主路由。那么在递归路由中的下一跳 100.1.1.2有没有实际意义呢?杰夫道尔说,这个下一跳地址在途径切换的时候有帮助,当R2这条链路down掉以后,只需要重新写递归路由为:ip route 200.2.2.0 255.255.255.0 F0/0 100.1.1.3,就可以实现把途径切换到R3的链路。真的是这样吗?实际并非如此。我们看一下下面的两条路由:S 200.2.2.0/24 1/0 via 100.1.1.2, FastEthernet0/0这条静态路由称之为“递归路由” (递归路由)S 10.3.1.0 1/0 via 200.2.2.4, FastEthernet
20、0/0 (主路由)假设上述的理解对的,当R1 ping 10.3.1.0网段的时候,需要到达200.2.2.4节点,而到达200.2.2.0网段需要通过100.1.1.2节点(R2的F0/0接口),那么R1发送arp请求,请求的应当是100.1.1.2节点的MAC地址。我们再来看一下R1的ARP表:Protocol Address Age (min) Hardware Addr Type InterfaceInternet 200.2.2.4 14 c002.271c.0000 ARPA FastEthernet0/0可以很明显看出R1发送arp请求,请求的仍然是200.2.2.4节点的MAC
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2023 CCNP 老师 讲解 实验 手册 课堂 笔记
限制150内