看卷一的路由重分配,对rip默认路由认识不够,在网上找到好文一篇,共享一下,对大家的工作会有一定的启发。 在一个单出口网络内启用RIP协议,在网络出口处的路由器需要向RIP域内传播一条默认路由,这样,域内的路由器就可以通过默认路由访问外部网络。下面我们就用试验来模拟这个环境。到目前为止;通过RIP传递默认路由共有5种方法。 router rip 二 方法1 default-information r2(config)#int lo0 r2(config-if)#shutdown /这时我们将loopback接口关闭 r1#sh ip rou 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 12.0.0.0/24 is subnetted, 1 subnets C 12.0.0.0 is directly connected, Serial1/0 这时,R2不向R1传递默认路由,因为loopback接口关闭,ACL失效,route-map失效,所以 default-information originate命令不执行 ----------------------------------------- 下面我们在R2,R3之间启用EIGRP,在R3上起一个loopback接口,并宣告到EIGRP中,这时R2可以学习到3.3.3.0,在R2上建立ACL匹配从R3学习到的这条路由,随后建立route-map并调用ACL,同样最后在R2的RIP进程中的default-information originate命令后面调用这个route-map。 r2#sh run | b r e router eigrp 90 network 23.0.0.0 0.0.0.255 no auto-summary r3#sh run | b r e router eigrp 90 network 3.3.3.0 0.0.0.255 network 23.0.0.0 0.0.0.255 no auto-summary r2#sh ip rou 1.0.0.0/24 is subnetted, 1 subnets R 1.1.1.0 [120/1] via 12.0.0.1, 00:00:05, Serial1/0 2.0.0.0/32 is subnetted, 1 subnets C 2.2.2.2 is directly connected, Loopback0 3.0.0.0/24 is subnetted, 1 subnets D 3.3.3.0 [90/2297856] via 23.0.0.3, 00:01:42, Serial1/1 23.0.0.0/24 is subnetted, 1 subnets C 23.0.0.0 is directly connected, Serial1/1 12.0.0.0/24 is subnetted, 1 subnets C 12.0.0.0 is directly connected, Serial1/0 R2 access-list 1 permit 3.3.3.0 0.0.0.255 route-map WY permit 10 match ip address 1 R2 router rip version 2 network 12.0.0.0 default-information originate route-map WY no auto-summary r1#sh ip rou 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 12.0.0.0/24 is subnetted, 1 subnets C 12.0.0.0 is directly connected, Serial1/0 R* 0.0.0.0/0 [120/1] via 12.0.0.2, 00:00:01, Serial1/0 /这时R2向R1传递一条默认路由 r3(config)#int lo0 r3(config-if)#shutdown /在R3上关闭这个loopback接口 r1#sh ip rou 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 12.0.0.0/24 is subnetted, 1 subnets C 12.0.0.0 is directly connected, Serial1/0 R2不再向R1传递默认路由,同样因为loopback接口失效,导致 default-information originate命令不执行 ----------------------------------------- 方法2 手工写一条默认路由(到NULL0)然后重分布到RIP中 r2(config)#ip route 0.0.0.0 0.0.0.0 null 0 /在R2上建立一条默认路由 r2(config-router)#redistribute static /重分布静态路由到RIP中 r1#sh ip rou 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 12.0.0.0/24 is subnetted, 1 subnets C 12.0.0.0 is directly connected, Serial1/0 R* 0.0.0.0/0 [120/1] via 12.0.0.2, 00:00:02, Serial1/0 /这时,R2向R1传递一条默认路由 ----------------------------------------- 方法3 手工写一条默认路由(到NULL0)在进程中宣告 r2(config)#ip route 0.0.0.0 0.0.0.0 null 0 r2#sh run | b r r router rip version 2 network 12.0.0.0 network 0.0.0.0 /将这条默认路由宣告到R2的RIP进程中 no auto-summary r1#sh ip rou 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 12.0.0.0/24 is subnetted, 1 subnets C 12.0.0.0 is directly connected, Serial1/0 R* 0.0.0.0/0 [120/1] via 12.0.0.2, 00:00:07, Serial1/0 /R2向R1传递默认路由 ----------------------------------------- 方法4 ip default-network r2(config)#ip default-network 23.0.0.0 /建立一个缺省网络 r1#sh ip rou 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 12.0.0.0/24 is subnetted, 1 subnets C 12.0.0.0 is directly connected, Serial1/0 R* 0.0.0.0/0 [120/1] via 12.0.0.2, 00:00:09, Serial1/0 /R2向R1传递默认路由 ----------------------------------------- 方法5 在接口汇总 0.0.0.0/0 到NULL0的路由 r2(config)#ip route 0.0.0.0 0.0.0.0 null 0 /先建立一条默认路由 r2#sh run int s1/0 interface Serial1/0 ip address 12.0.0.2 255.255.255.0 ip summary-address rip 0.0.0.0 0.0.0.0 /在接口上手工汇总这条默认路由 r1#sh ip rou 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 12.0.0.0/24 is subnetted, 1 subnets C 12.0.0.0 is directly connected, Serial1/0 R* 0.0.0.0/0 [120/1] via 12.0.0.2, 00:00:09, Serial1/0 /R2向R1传递默认路由 通过本次试验,我们了解了几种向RIP域中传递默认路由的几种方法。希望还能找到其它方法。 注:源于工大瑞普 |
不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流
GMT+8, 2025-11-4 20:35 , Processed in 0.029580 second(s), 15 queries .
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.