[已解决]]策略路由疑问
本帖最后由 Chaochao 于 2009-8-11 10:08 编辑做了一实验
route-map t3 permit 10
match ip address 103
set ip next-hop 10.7.7.3
基本成功。匹配acl的数据包的下一条被被到10.7.7.3
课上老师讲过, set ip next-hop 可以接两个地址做备用。
将最后一条改为set ip next-hop 10.7.7.3 10.7.7.2
10.7.7.2是另外一个接口的下一跳,路由都是通的。
然后将10.7.7.3的端口shutdown掉,测试了一下,无法ping通,似乎不会从另一个接口走。
请问正确的情况或配置该是什么样的?谢谢! 本帖最后由 tianchunyu 于 2009-8-1 15:13 编辑
10.7.7.3 ?10.7.7.2? 你这是个什么样的网络?广播网络?
执行策略路由的路由器配置如下:
R1#sh ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unsetadministratively down down
Serial1/0 10.6.6.1 YES manual up up
Serial1/1 10.7.7.1 YES manual up up
Serial1/2 unassigned YES unsetadministratively down down
Serial1/3 unassigned YES unsetadministratively down down
Serial1/4 unassigned YES unsetadministratively down down
Serial1/5 unassigned YES unsetadministratively down down
Serial1/6 unassigned YES unsetadministratively down down
Serial1/7 unassigned YES unsetadministratively down down
FastEthernet2/0 192.168.1.254 YES manual up up
FastEthernet2/1 unassigned YES unsetadministratively down down
R1#sh access-list 1
Standard IP access list 1
10 permit 192.168.1.0, wildcard bits 0.0.0.255 (78 matches)
R1#sh route-map A
STATIC routemaps
route-map 1, permit, sequence 10
Match clauses:
Set clauses:
Policy routing matches: 0 packets, 0 bytes
route-map A, permit, sequence 10
Match clauses:
ip address (access-lists): 1
Set clauses:
ip next-hop 10.6.6.2 10.7.7.2
Policy routing matches: 21 packets, 2070 bytes
DYNAMIC routemaps
Current active dynamic routemaps = 0
R1#sh run int f2/0
Building configuration...
Current configuration : 121 bytes
!
interface FastEthernet2/0
ip address 192.168.1.254 255.255.255.0
ip policy route-map A
duplex full
speed auto
end
R1#sh 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
10.0.0.0/24 is subnetted, 2 subnets
C 10.7.7.0 is directly connected, Serial1/1
C 10.6.6.0 is directly connected, Serial1/0
C 192.168.1.0/24 is directly connected, FastEthernet2/0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
策略验证:
PC#traceroute 10.6.6.2
Type escape sequence to abort.
Tracing the route to 10.6.6.2
1 192.168.1.254 252 msec 152 msec 48 msec
2 10.6.6.2 252 msec *204 msec
PC#traceroute 10.7.7.2
Type escape sequence to abort.
Tracing the route to 10.7.7.2
1 192.168.1.254 208 msec 232 msec 60 msec
2 10.6.6.2 188 msec 96 msec 96 msec
3 10.6.6.1 140 msec 100 msec 204 msec
4 10.7.7.2 300 msec *364 msec
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
手工关闭R1的s1/0--ip add :10.6.6.1 和关闭对端的效果是一致的
R1#sh ip
*Aug1 15:08:44.355: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to down
R1#sh 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
10.0.0.0/24 is subnetted, 1 subnets
C 10.7.7.0 is directly connected, Serial1/1
C 192.168.1.0/24 is directly connected, FastEthernet2/0
再次验证策略:
PC#traceroute 10.6.6.2
Type escape sequence to abort.
Tracing the route to 10.6.6.2
1 192.168.1.254 244 msec 84 msec 64 msec
2 10.7.7.2 148 msec 212 msec 76 msec
3 10.7.7.1 192 msec 256 msec 96 msec
4 10.7.7.1 !H*!H
PC#ping 10.6.6.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.6.6.2, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
PC#traceroute 10.7.7.2
Type escape sequence to abort.
Tracing the route to 10.7.7.2
1 192.168.1.254 284 msec 140 msec 52 msec
2 10.7.7.2 184 msec *168 msec 顶阿~~学习就是要这样 TCY,最近学习相当有干劲。 多谢,问题解决。
原因总结如下:原先网络拓扑是帧中继一点对多点的,我shutdown第一选择的链路时,
是到对端shutdown的,但在本端看,端口始终是UP的。所以可能数据一直没有转到
第二个地址上去。
后来改了一下,用了两个端口,一个E口,一个点对点的帧中继,运行OSPF,正常情况下
走E口,用策略路由成功改过来。shut掉一条后,也正常切换到第二条备用线路。
页:
[1]