4-高级路由:RIP默认路由

一、实验拓扑:

二、命令部署:
1、基本部署:
R1(config)#int f0/0
R1(config-if)#no shutdown
R1(config-if)#ip add 14.1.1.1 255.255.255.0
R1(config-if)#int f1/0
R1(config-if)#no shutdown
R1(config-if)#ip add 12.1.1.1 255.255.255.0

R1(config)#router rip
R1(config-router)#network 14.1.1.1
R1(config-router)#network 12.1.1.1

R2(config-if)#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 f1/0
R2(config-if)#no shutdown
R2(config-if)#ip add 23.1.1.2 255.255.255.0

R2(config)#router rip
R2(config-router)#network 12.1.1.2
R2(config-router)#network 23.1.1.2

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)#router rip
R3(config-router)#network 23.1.1.3

R4(config)#int f0/0
R4(config-if)#no shutdown
R4(config-if)#ip add 14.1.1.4 255.255.255.0

R4(config)#int lo1
R4(config-if)#ip add 4.4.4.4 255.255.255.0

2、重点部署:
①第一种方法:互指默认路由,在边界路由器R1 RIP协议内重分发静态路由。
R1(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.4
R4(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.1

R1(config)#router rip
R1(config-router)#redistribute static

扫描二维码关注公众号,回复: 1927671 查看本文章

②第二种方法:互指默认路由,在边界路由器R1 RIP协议内宣告0.0.0.0网段。
R1(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.4
R4(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.1

R1(config)#router rip
R1(config-router)#network 0.0.0.0

③第三种方法(推荐使用此方法):互指默认路由,在边界路由器R1 RIP协议内部署:default-information originate(强制让身后R2、R3获得带*默认路由)
R1(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.4
R4(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.1

R1(config)#router rip
R1(config-router)#default-information originate

④第四种方法:
R1(config)#no ip route 0.0.0.0 0.0.0.0 14.1.1.4
R4(config)#no ip route 0.0.0.0 0.0.0.0 14.1.1.1

R1(config)#ip default-network 14.0.0.0
R1(config)#router rip
R1(config-router)#network 14.0.0.0

三、验证:
①第一种方法:
未重分发前:
R2#show ip route
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, FastEthernet1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0
R 14.0.0.0/8 [120/1] via 12.1.1.1, 00:00:15, FastEthernet0/0
测试:R2#ping 4.4.4.4 显示不通

重分发后:
R2#show ip route
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, FastEthernet1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0
R 14.0.0.0/8 [120/1] via 12.1.1.1, 00:00:03, FastEthernet0/0
R* 0.0.0.0/0 [120/1] via 12.1.1.1, 00:00:03, FastEthernet0/0
测试:R2#ping 4.4.4.4 成功Ping 通
同理:R3和R2显示效果一样。
②第二种方法:
此处R1的SecureCRT卡住了,可能是新版本不允许这样。

③第三种方法:
R2#show ip route
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, FastEthernet1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0
R 14.0.0.0/8 [120/1] via 12.1.1.1, 00:00:04, FastEthernet0/0
R 0.0.0.0/0 [120/1] via 12.1.1.1, 00:00:04, FastEthernet0/0
测试:R2#ping 4.4.4.4 成功Ping 通
同理:R3和R2显示效果一样。
④第四种方法:
R2#show ip route
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, FastEthernet1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0
R 14.0.0.0/8 [120/1] via 12.1.1.1, 00:00:01, FastEthernet0/0
R
0.0.0.0/0 [120/1] via 12.1.1.1, 00:00:01, FastEthernet0/0
测试:R2#ping 4.4.4.4 不通很正常,因为没有到4.4.4.4的路由条目。
4-高级路由:RIP默认路由

猜你喜欢

转载自blog.51cto.com/13856092/2137469