您好,欢迎来到江西省计算机培训学院!
技术文摘当前位置:首页 >> 技术文摘
路由重发布
发布时间:2015年5月14日 浏览:970 次
为什么要采用路由重发布?
在一个大型的企业网络中可能会采用不同的路由协议(rip,ospf,static),为了实现多种路由协议的协同工作,路由器可以通过路由的重分发将学到的一种路由协议重分发到另外的一种路由协议中,从而使得整个网络可以互相连通。
拓扑图:
R1路由重发布的配置:
r1#show running-config
Building configuration...
Current configuration : 919 bytes
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
hostname r1
interface FastEthernet0/0
ip address 192.168.3.1 255.255.255.0
duplex auto
speed auto
interface FastEthernet0/1
ip address 192.168.1.2 255.255.255.0
duplex auto
speed auto
!
interface Serial0/0/0
ip address 192.168.4.1 255.255.255.0
clock rate 9600
router ospf 1 ###在ospf路由协议中重新发布rip, connected,static等路由协议###
log-adjacency-changes
redistribute rip subnets
redistribute static
redistribute connected
network 192.168.3.0 0.0.0.255 area 0
!
router rip###在rip路由协议中重新发布ospf, connected,static等路由协议###
redistribute ospf 1 metric 3
redistribute static metric 1
redistribute connected metric 1
network 192.168.1.0
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.4.2
line con 0
line vty 0 4
login
路由未重发布前:
各路由器的路由表:
R0路由器
r0#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
C 192.168.1.0/24 is directly connected, FastEthernet0/1
C 192.168.2.0/24 is directly connected, Loopback0
r0#
R1路由器
r1#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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 192.168.4.2 to network 0.0.0.0
C 192.168.1.0/24 is directly connected, FastEthernet0/1
R 192.168.2.0/24 [120/1] via 192.168.1.1, 00:00:06, FastEthernet0/1rip学到的r0
C 192.168.3.0/24 is directly connected, FastEthernet0/0
C 192.168.4.0/24 is directly connected, Serial0/0/0
192.168.5.0/32 is subnetted, 1 subnets
O 192.168.5.1 [110/2] via 192.168.3.2, 00:23:05, FastEthernet0/0ospf学到的r2
S* 0.0.0.0/0 [1/0] via 192.168.4.2
r1#
R2路由器
r2#show ip rou
r2#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
C 192.168.3.0/24 is directly connected, FastEthernet0/0
C 192.168.5.0/24 is directly connected, Loopback0
R3路由器
r3#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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 192.168.4.1 to network 0.0.0.0
C 192.168.4.0/24 is directly connected, Serial0/0/0
C 192.168.6.0/24 is directly connected, Loopback0
S* 0.0.0.0/0 [1/0] via 192.168.4.1
路由重发布后:
R0路由器(发生变化)
r0#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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 192.168.1.2 to network 0.0.0.0
C 192.168.1.0/24 is directly connected, FastEthernet0/1
C 192.168.2.0/24 is directly connected, Loopback0
R 192.168.3.0/24 [120/3] via 192.168.1.2, 00:06:43, FastEthernet0/1 ospf
R 192.168.4.0/24 [120/1] via 192.168.1.2, 00:10:59, FastEthernet0/1直连
R 192.168.5.0/24 [120/3] via 192.168.1.2, 00:06:43, FastEthernet0/1 ospf
R* 0.0.0.0/0 [120/1] via 192.168.1.2, 00:10:41, FastEthernet0/1 静态
r0#
R1路由器(未发生变化)
r1#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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 192.168.4.2 to network 0.0.0.0
C 192.168.1.0/24 is directly connected, FastEthernet0/1
R 192.168.2.0/24 [120/1] via 192.168.1.1, 00:00:14, FastEthernet0/1
C 192.168.3.0/24 is directly connected, FastEthernet0/0
C 192.168.4.0/24 is directly connected, Serial0/0/0
192.168.5.0/32 is subnetted, 1 subnets
O 192.168.5.1 [110/2] via 192.168.3.2, 00:43:15, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 192.168.4.2
R2路由器(发生变化)
r2#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
O E2 192.168.1.0/24 [110/20] via 192.168.3.1, 00:09:45, FastEthernet0/0
O E2 192.168.2.0/24 [110/20] via 192.168.3.1, 00:09:12, FastEthernet0/0
C 192.168.3.0/24 is directly connected, FastEthernet0/0
O E2 192.168.4.0/24 [110/20] via 192.168.3.1, 00:09:45, FastEthernet0/0
C 192.168.5.0/24 is directly connected, Loopback0
r2#
R3路由器
r3#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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 192.168.4.1 to network 0.0.0.0
C 192.168.4.0/24 is directly connected, Serial0/0/0
C 192.168.6.0/24 is directly connected, Loopback0
S* 0.0.0.0/0 [1/0] via 192.168.4.1
r3#
测试连通性
R0---R2
r0#ping 192.168.5.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.5.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms
R0---R3
r0#ping 192.168.6.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.6.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 47/59/63 ms
r0#
R3---R0
r3#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/59/63 ms
r3#
R3---R2
r3#ping 192.168.5.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.5.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 62/65/79 ms
R2---R0
r2#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 46/58/62 ms
R2---R3(没有ping同不知道为什么,静态路由没有学习到)哪位大虾请教下
r2#ping 192.168.6.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.6.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
解决办法:在r2上面配置一条默认路由
ip route 0.0.0.0 0.0.0.0 192.168.3.1
再次测试:
R2---R3(没有ping同不知道为什么,静态路由没有学习到)
r2#ping 192.168.6.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.6.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 47/59/63 ms
 
将文章分享到:
上一篇: 全真网络实验机架
下一篇: 布线实战:如何辨别网线优劣
学院动态
联系方式
报名咨询热线:
13576968766
15070010500(毛老师)
15870000729(王老师)
官方邮箱:kxy@qdlhrhjz.com
招办热线:张老师
传  真:0791-88176246
   
热门资讯
全国免费热线:400-0791-361
电话:13576968766 张老师
传真:0791-88176246
邮箱:kxy@qdlhrhjz.com
地址:江西省南昌市上坊路382号(江西省科学院内)
软件工程师高级培训
Java软件工程师
Android工程师
企业应用软件测试工程师
思科/华为网络高级培训
思科网络工程师
华为网络工程师
Linux网络工程师
版权所有澳门巴黎人娱乐app © 2014 江西省计算机培训学院 赣ICP备05000706号