您的位置:首页 > 运维架构 > Linux

初学者如何学习linux

2009-02-13 10:22 323 查看
在上一文中介绍了RIP、EIGRP、OSPF之间的路由重分发,现在再介绍一下怎么实现默认路由、ISIS和其他协议之间的充分发。
试验模拟环境:IP分配和拓扑如图



实验步骤:
1、 基本配置参考拓扑图
2、 配置路由器1
配置默认路由
Router(config)#ip route 0.0.0.0 0.0.0.0 172.1.1.2 //配置默认路由
3、配置路由器3
配置IS-IS路由协议
r3(config)#router isis //配置IS-IS
r3(config-router)#net 49.0001.0000.0000.0001.00
r3(config-router)#exit
r3(config)#interface s0/0 //把IS-IS协议作用到接口上
r3(config-if)#ip router isis
r3(config-if)#int loo 0
r3(config-if)#ip router isis
4、配置路由器2
配置一条指向配置默认路由的路由器的静态路由
r2(config)#ip route 1.1.1.0 255.255.255.0 172.1.1.1 //静态路由指向外网网段
配置路由重定向
r2 (config)#router isis
r2 (config-router)#net
r2 (config-router)#net 49.0001.0000.0000.0002.00
r2 (config-router)#redistribute connected metric 10 //直连网段重分发
r2 (config-router)#redistribute static metric 10 //默认路由重分发
r2 (config-router)#exit
r2 (config)#int s0/0
r2 (config-if)#ip router isis
r2 (config-if)#int s0/1
r2(config-if)#ip router isis
r2 (config-if)#int loo 0
r2 (config-if)#ip router isis
r2 (config-if)#exit
测试连通性:
在路由器1上查看路由表
r1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 172.1.1.2 to network 0.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
172.1.0.0/24 is subnetted, 1 subnets
C 172.1.1.0 is directly connected, Serial0/0
S* 0.0.0.0/0 [1/0] via 172.1.1.2
在路由器2上查看路由表
r2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
S 1.1.1.0 [1/0] via 172.1.1.1
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
i L1 3.3.3.0 [115/20] via 172.2.1.2, Serial0/1
172.1.0.0/24 is subnetted, 1 subnets
C 172.1.1.0 is directly connected, Serial0/0
172.2.0.0/24 is subnetted, 1 subnets
C 172.2.1.0 is directly connected, Serial0/1
在路由器3上查看路由表
r3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
i L2 1.1.1.0 [115/20] via 172.2.1.1, Serial0/0
2.0.0.0/24 is subnetted, 1 subnets
i L1 2.2.2.0 [115/20] via 172.2.1.1, Serial0/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
172.1.0.0/24 is subnetted, 1 subnets
i L1 172.1.1.0 [115/20] via 172.2.1.1, Serial0/0
172.2.0.0/24 is subnetted, 1 subnets
C 172.2.1.0 is directly connected, Serial0/0
用PING命令测试
r1#ping 2.2.2.2 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, 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 = 48/126/256 ms
r1#ping 3.3.3.3 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, 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 = 48/120/208 ms
结合上一篇博文,我们可以实现默认路由、RIP、EIGRP、OSPF、IS-IS以及直连网段之间的路由重分发。
本文出自 “zhanglong” 博客,请务必保留此出处http://zhanglong.blog.51cto.com/712309/219155
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: