一、 组网:
我司SR6608路由器替换Cisco 设备,需要SR6608路由器只将从OSPF区域学习到100.1.1.0/24的路由引入到RIP中,然后通过RIP发布给对端的迈普设备,过滤掉200.1.1.0/24的路由;迈普设备会分别从SR6608路由器和C3路由器学习到两条等价的100.1.1.0/24的RIP路由。
二、 问题描述:
SR6608路由器替换Cisco 设备,通过将Cisco设备的配置翻译成SR6608路由器配置之后,需要在SR6608路由器上过滤掉200.1.1.0/24,只发布100.1.1.0/24的路由对端迈普的设备,然而当采用相同的配置情况下,现场反馈对端迈普设备只能从C3上学习到一条100.1.1.0/24的RIP的路由,但是无法学习到从我司SR6608路由器发布的RIP的路由。
Cisco设备的信息:
Cisco设备前缀列表及路由策略的配置:
ip prefix-list h3c seq 10 permit 100.0.0.0/8
route-map h3c permit 10
match ip address prefix-list h3c
Cisco设备RIP路由过滤策略的配置:
router rip
version 2
network 54.0.0.0
redistribute ospf 1 metric 1 route-map h3c
no auto-summary
H3C SR6608路由器的信息:
H3C SR6608路由器前缀列表及路由策略的配置:
ip ip-prefix h3c index 10 permit 100.0.0.0 8
route-policy h3c permit node 10
if-match ip-prefix h3c
H3C SR6608路由器RIP路由过滤策略的配置:
rip 1
undo summary
version 2
network 54.0.0.0
import-route ospf 1 cost 1 route-policy h3c
三、 过程分析:
现场组网中,SR6608路由器在RIP里面引入OSPF的外部路由,通过查看SR6608路由器本地IP路由表,发现已经成功的将这条100.0.0.0/8 OSPF外部路由引入到了IP的路由表中,并且过滤掉了200.1.1.0/24,这证明了SR6608路由器配置的路由策略、路由过滤都是正确的:
dis ip routing-table
Routing Tables: Public
Destinations : 12 Routes : 13
Destination/Mask Proto Pre Cost NextHop Interface
100.0.0.0/8 O_ASE 150 20 15.1.1.1 GE3/0/0
O_ASE 150 20 25.1.1.1 GE4/0/0
其他直连路由信息略。
在我司SR6608路由器上面的debugging rip 1 packet interface GigabitEthernet 3/0/1能看到我司路由器把RIP的路由发送出去了:
*Jul 20 00:45:45:452 2014 H3C RM/6/RMDEBUG: RIP 1 : Sending response on interface GigabitEthernet3/0/1 from 54.1.1.1 to 224.0.0.9
*Jul 20 00:45:45:452 2014 H3C RM/6/RMDEBUG: Packet : vers 2, cmd response, length 384
*Jul 20 00:45:45:452 2014 H3C RM/6/RMDEBUG: AFI 2, dest 100.0.0.0/255.0.0.0, nexthop 0.0.0.0, cost 2, tag 0
但是查看迈普设备的路由表,看到只有从C3学习到100.0.0.0/8的路由。
maipu #show ip route rip
Codes: C - connected, S - static, R - RIP, O - OSPF, OE-OSPF External, M - Management
D - Redirect, E - IRMP, EX - IRMP external, o - SNSP, B - BGP, i-ISIS
Gateway of last resort is not set
R 100.0.0.0/8 [120/1] via 34.1.1.1, 00:05:04, fastethernet0
其他路由信息略。
maipu#show ip rip database
Types: N - Network, L - Learn, R - Redistribute, D - Default config, S - Static config
Proto: C - connected, S - static, R - RIP, O - OSPF, E - IRMP,
o - SNSP, B - BGP, i-ISIS
RIP routing database in VRF kernel (Counter 5):
T/P Network ProID Metric Next-Hop From Time Tag Interface
L/R 100.0.0.0/8 none 1 34.1.1.1 34.1.1.1 02:51 0 fastethernet0
N/C 3.3.3.3/32 none 0 -- -- -- 0 loopback0
然后查看迈普设备的debug信息,发现我司设备发送过去的路由的metric值为2,从C3(Cisco)设备收到的路由的metric值为1:
从我司SR6608收到的路由debug信息:
*Jul 20 00:54:50: %7: [RIP] RIP recveived packet, sock=2157 src=54.1.1.1 len=384
*Jul 20 00:54:50: %7: [RIP] Received version 2 response packet
*Jul 20 00:54:50: %7: [RIP] Both do not need auth, Auth ok
*Jul 20 00:54:50: %7: route-entry: family 2 tag 0 ip 100.0.0.0 mask 255.0.0.0 nhop 0.0.0.0 metric 2
从C3(Cisco)设备收到的路由debug信息:
JLA22900#*Jul 20 01:03:36: %7: [RIP] RIP recveived packet, sock=2157 src=34.1.1.1 len=344
*Jul 20 01:03:36: %7: [RIP] Received version 2 response packet
*Jul 20 01:03:36: %7: [RIP] Both do not need auth, Auth ok
*Jul 20 01:03:36: %7: route-entry: family 2 tag 0 ip 100.0.0.0 mask 255.0.0.0 nhop 0.0.0.0 metric 1
因此,通过上述分析,可以定位是metric值影响的;
SR66路由器上的实现:
import-route protocol ospf cost cost
cost:所要引入路由的度量值,取值范围为0~16。如果没有指定度量值,则使用default cost命令设置的缺省度量值。
default cost value 缺省情况下,引入路由的缺省度量值为0。
然而,RFC文档对计算RIP协议Cost值(metric)并没有规定具体实现方法,所以每个厂家的实现可能会存在差异。SR6608路由器的RIP模块在此组网中,会将发送RIP路由的cost值加1,但Cisco设备不会加1。
四、 解决方法:
解决方案:在SR6608路由器上,配置RIP在引入外部路由时cost设为0,命令如下:
rip 1
import-route ospf 1 cost 0
备注:关于metric和Cost我司和Cisco设备的命名不同,但是功能是一样的。
我司设备的配置:
rip 1
import-route ospf 1 cost 0
Cisco设备的配置:
router rip
redistribute ospf 1 metric 1
再次查看迈普设备的路由表:
maipu#show ip rip database
Types: N - Network, L - Learn, R - Redistribute, D - Default config, S - Static config
Proto: C - connected, S - static, R - RIP, O - OSPF, E - IRMP,
o - SNSP, B - BGP, i-ISIS
RIP routing database in VRF kernel (Counter 5):
T/P Network ProID Metric Next-Hop From Time Tag Interface
L/R 100.0.0.0/8 none 1 34.1.1.1 34.1.1.1 02:51 0 fastethernet0
54.1.1.1 54.1.1.1 02:47 0 fastethernet1
N/C 3.3.3.3/32 none 0 -- -- -- 0 loopback0
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作