MSR系列路由器
关于策略路由处理步骤的经验案例
一、组网:
2台MSR通过1对GE口、2对CE1互联,每对CE1拆成2个通道,各接口及地址如下所示,目前要求在R1上对访问2.2.2.2的流进行策略路由,通过多种测试揭开策略路由的处理步骤(策略路由中只涉及4条串行链路,目的是实现流量依次在S8/0:0、S8/0:1、S8/1:0、S8/1:1转发)。
二、分析步骤
从R1不同配置查看策略路由处理过程
1. R1基本配置
#
//全局使能策略路由
ip local policy-based-route verify
#
//CE1接口配置
controller E1 8/0
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
controller E1 8/1
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
//CE1生成的通道串行接口配置
interface Serial8/0:0
link-protocol ppp
ip address 1.2.58.1 255.255.255.252
#
interface Serial8/0:1
link-protocol ppp
ip address 1.2.58.5 255.255.255.252
#
interface Serial8/1:0
link-protocol ppp
ip address 1.2.158.1 255.255.255.252
#
interface Serial8/1:1
link-protocol ppp
ip address 1.2.158.5 255.255.255.252
#
//GE接口配置
interface GigabitEthernet0/0
port link-mode route
ip address 1.2.0.1 255.255.255.252
#
//策略路由verify节点0配置
policy-based-route verify permit node 0
//应用出接口S8/0:0
apply output-interface Serial8/0:0
//应用下一跳地址1.2.58.6,即从S8/0:1可达
apply ip-address next-hop 1.2.58.6
//应用默认出接口S8/1:0
apply default output-interface Serial8/1:0
//应用默认吓一跳地址1.2.158.6,即从S8/1:1可达
apply ip-address default next-hop 1.2.158.6
//策略路由verify节点1配置
policy-based-route verify permit node 1
//应用出接口和下一跳地址
apply output-interface Serial8/1:0
apply ip-address next-hop 1.2.158.6
#
//通过G0/0出去的默认路由,下一跳为1.2.0.2
ip route-static 0.0.0.0 0 1.2.0.2
#
操作过程显示打开IP Packet和IP Policy-based-route调试开关
//r1上ping 2.2.2.2 一个包
<r1>ping -c 1 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
//匹配出接口S8/0:0,即策略路由verify节点0的第一条
*May 9 17:06:17:191 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface : Serial8/0:0
*May 9 17:06:17:191 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/0:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1535, offset = 0, ttl = 255, protocol = 1,
checksum = 30371, s = 1.2.58.1, d = 2.2.2.2
//提示从S8/0:0发出
prompt: Sending the packet from local at Serial8/0:0
*May 9 17:06:17:194 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/0:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1174, offset = 0, ttl = 255, protocol = 1,
checksum = 30732, s = 2.2.2.2, d = 1.2.58.1
prompt: Receiving IP packet from Serial8/0:0
*May 9 17:06:17:194 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/0:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1174, offset = 0, ttl = 255, protocol = 1,
checksum = 30732, s = 2.2.2.2, d = 1.2.58.1
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=3 ms
--- 2.2.2.2 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms
<r1>
2. 将S8/0:0接口关闭
#
ip local policy-based-route verify
#
controller E1 8/0
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
controller E1 8/1
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
//关闭该接口
interface Serial8/0:0
link-protocol ppp
shutdown
ip address 1.2.58.1 255.255.255.252
#
interface Serial8/0:1
link-protocol ppp
ip address 1.2.58.5 255.255.255.252
#
interface Serial8/1:0
link-protocol ppp
ip address 1.2.158.1 255.255.255.252
#
interface Serial8/1:1
link-protocol ppp
ip address 1.2.158.5 255.255.255.252
#
interface GigabitEthernet0/0
port link-mode route
ip address 1.2.0.1 255.255.255.252
#
policy-based-route verify permit node 0
apply output-interface Serial8/0:0
apply ip-address next-hop 1.2.58.6
apply default output-interface Serial8/1:0
apply ip-address default next-hop 1.2.158.6
policy-based-route verify permit node 1
apply output-interface Serial8/1:0
apply ip-address next-hop 1.2.158.6
#
ip route-static 0.0.0.0 0 1.2.0.2
#
操作过程显示打开IP Packet和IP Policy-based-route调试开关
//关闭S8/0:0,可以看到很多关于端口Down的信息
[r1-Serial8/0:0]shutdown
%May 9 17:17:30:617 2007 r1 DRVMSG/1/DRVMSG: Serial8/0:0: change status to down
%May 9 17:17:30:617 2007 r1 IFNET/4/UPDOWN:
Line protocol on the interface Serial8/0:0 is DOWN
%May 9 17:17:30:617 2007 r1 IFNET/4/UPDOWN:
Protocol PPP IPCP on the interface Serial8/0:0 is DOWN
[r1-Serial8/0:0]ping -c 1 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
//策略路由应用出接口S8/0:0失败
*May 9 17:17:39:529 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
//匹配到策略路由的第二条下一跳1.2.58.6
*May 9 17:17:39:529 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : next-hop : 1.2.58.6
*May 9 17:17:39:529 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/0:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1536, offset = 0, ttl = 255, protocol = 1,
checksum = 30366, s = 1.2.58.5, d = 2.2.2.2
//提示从S8/0:1发出,即发送
prompt: Sending the packet from local at Serial8/0:1
*May 9 17:17:39:531 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/0:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1175, offset = 0, ttl = 255, protocol = 1,
checksum = 30727, s = 2.2.2.2, d = 1.2.58.5
prompt: Receiving IP packet from Serial8/0:1
*May 9 17:17:39:532 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/0:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1175, offset = 0, ttl = 255, protocol = 1,
checksum = 30727, s = 2.2.2.2, d = 1.2.58.5
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=4 ms
--- 2.2.2.2 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 4/4/4 ms
[r1-Serial8/0:0]
3. 将S8/0:1接口也关闭
#
ip local policy-based-route verify
#
controller E1 8/0
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
controller E1 8/1
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
interface Serial8/0:0
link-protocol ppp
shutdown
ip address 1.2.58.1 255.255.255.252
#
//关闭S8/0:1
interface Serial8/0:1
link-protocol ppp
shutdown
ip address 1.2.58.5 255.255.255.252
#
interface Serial8/1:0
link-protocol ppp
ip address 1.2.158.1 255.255.255.252
#
interface Serial8/1:1
link-protocol ppp
ip address 1.2.158.5 255.255.255.252
#
interface GigabitEthernet0/0
port link-mode route
ip address 1.2.0.1 255.255.255.252
#
policy-based-route verify permit node 0
apply output-interface Serial8/0:0
apply ip-address next-hop 1.2.58.6
apply default output-interface Serial8/1:0
apply ip-address default next-hop 1.2.158.6
policy-based-route verify permit node 1
apply output-interface Serial8/1:0
apply ip-address next-hop 1.2.158.6
#
ip route-static 0.0.0.0 0 1.2.0.2
#
操作过程显示打开IP Packet和IP Policy-based-route调试开关
[r1-Serial8/0:1]shutdown
%May 9 17:20:20:816 2007 r1 DRVMSG/1/DRVMSG: Serial8/0:1: change status to down
%May 9 17:20:20:816 2007 r1 IFNET/4/UPDOWN:
Line protocol on the interface Serial8/0:1 is DOWN
%May 9 17:20:20:816 2007 r1 IFNET/4/UPDOWN:
Protocol PPP IPCP on the interface Serial8/0:1 is DOWN
[r1-Serial8/0:1]ping -c 1 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
//提示策略路由第一条失败,出接口Down
*May 9 17:20:26:331 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
//表示下一跳成功(由于默认路由的存在,所以1.2.58.6根据默认路由转发)
*May 9 17:20:26:332 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : next-hop : 1.2.58.6
*May 9 17:20:26:332 2007 r1 IPFWD/7/debug_case:
Sending, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1537, offset = 0, ttl = 255, protocol = 1,
checksum = 45217, s = 1.2.0.1, d = 2.2.2.2
prompt: Sending the packet from local at GigabitEthernet0/0
*May 9 17:20:26:333 2007 r1 IPFWD/7/debug_case:
Receiving, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1176, offset = 0, ttl = 255, protocol = 1,
checksum = 45578, s = 2.2.2.2, d = 1.2.0.1
prompt: Receiving IP packet from GigabitEthernet0/0
*May 9 17:20:26:333 2007 r1 IPDBG/7/debug_case:
Delivering, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1176, offset = 0, ttl = 255, protocol = 1,
checksum = 45578, s = 2.2.2.2, d = 1.2.0.1
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=3 ms
--- 2.2.2.2 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms
[r1-Serial8/0:1]
4. 修改路由
#
ip local policy-based-route verify
#
controller E1 8/0
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
controller E1 8/1
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
interface Serial8/0:0
link-protocol ppp
shutdown
ip address 1.2.58.1 255.255.255.252
#
interface Serial8/0:1
link-protocol ppp
shutdown
ip address 1.2.58.5 255.255.255.252
#
interface Serial8/1:0
link-protocol ppp
ip address 1.2.158.1 255.255.255.252
#
interface Serial8/1:1
link-protocol ppp
ip address 1.2.158.5 255.255.255.252
#
interface GigabitEthernet0/0
port link-mode route
ip address 1.2.0.1 255.255.255.252
#
policy-based-route verify permit node 0
apply output-interface Serial8/0:0
apply ip-address next-hop 1.2.58.6
apply default output-interface Serial8/1:0
apply ip-address default next-hop 1.2.158.6
policy-based-route verify permit node 1
apply output-interface Serial8/1:0
apply ip-address next-hop 1.2.158.6
#
ip route-static 2.2.2.2 255.255.255.255 1.2.0.2
#
操作过程显示打开IP Packet和IP Policy-based-route调试开关
<r1>ping -c 1 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
//表示出接口和下一跳都匹配失败
*May 9 21:48:05:704 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 21:48:05:704 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing fail for next-hop 1.2.58.6 error
*May 9 21:48:05:705 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 21:48:05:705 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing fail for next-hop 1.2.58.6 error
*May 9 21:48:05:705 2007 r1 IPFWD/7/debug_case:
Sending, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1755, offset = 0, ttl = 255, protocol = 1,
checksum = 44999, s = 1.2.0.1, d = 2.2.2.2
//表示根据普通路由转发,即配置的静态路由转发
prompt: Sending the packet from local at GigabitEthernet0/0
*May 9 21:48:05:706 2007 r1 IPFWD/7/debug_case:
Receiving, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1379, offset = 0, ttl = 255, protocol = 1,
checksum = 45375, s = 2.2.2.2, d = 1.2.0.1
prompt: Receiving IP packet from GigabitEthernet0/0
*May 9 21:48:05:706 2007 r1 IPDBG/7/debug_case:
Delivering, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1379, offset = 0, ttl = 255, protocol = 1,
checksum = 45375, s = 2.2.2.2, d = 1.2.0.1
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=3 ms
--- 2.2.2.2 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms
<r1>
5. 将路由删除
#
ip local policy-based-route verify
#
controller E1 8/0
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
controller E1 8/1
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
interface Serial8/0:0
link-protocol ppp
shutdown
ip address 1.2.58.1 255.255.255.252
#
interface Serial8/0:1
link-protocol ppp
shutdown
ip address 1.2.58.5 255.255.255.252
#
interface Serial8/1:0
link-protocol ppp
ip address 1.2.158.1 255.255.255.252
#
interface Serial8/1:1
link-protocol ppp
ip address 1.2.158.5 255.255.255.252
#
interface GigabitEthernet0/0
port link-mode route
ip address 1.2.0.1 255.255.255.252
#
policy-based-route verify permit node 0
apply output-interface Serial8/0:0
apply ip-address next-hop 1.2.58.6
apply default output-interface Serial8/1:0
apply ip-address default next-hop 1.2.158.6
policy-based-route verify permit node 1
apply output-interface Serial8/1:0
apply ip-address next-hop 1.2.158.6
#
操作过程显示打开IP Packet和IP Policy-based-route调试开关
[r1]ping -c 1 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
*May 9 17:23:15:910 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 17:23:15:910 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing fail for next-hop 1.2.58.6 error
//提示匹配了缺省出接口
*May 9 17:23:15:910 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface : Serial8/1:0
*May 9 17:23:15:910 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 17:23:15:910 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing fail for next-hop 1.2.58.6 error
*May 9 17:23:15:910 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1538, offset = 0, ttl = 255, protocol = 1,
checksum = 4768, s = 1.2.158.1, d = 2.2.2.2
//提示匹配了缺省出接口
prompt: Sending the packet from local at Serial8/1:0
*May 9 17:23:15:912 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1177, offset = 0, ttl = 255, protocol = 1,
checksum = 5129, s = 2.2.2.2, d = 1.2.158.1
prompt: Receiving IP packet from Serial8/1:0
*May 9 17:23:15:912 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1177, offset = 0, ttl = 255, protocol = 1,
checksum = 5129, s = 2.2.2.2, d = 1.2.158.1
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=4 ms
--- 2.2.2.2 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 4/4/4 ms
[r1]
6. 此时再将S8/1:0接口关闭
#
ip local policy-based-route verify
#
controller E1 8/0
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
controller E1 8/1
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
interface Serial8/0:0
link-protocol ppp
shutdown
ip address 1.2.58.1 255.255.255.252
#
interface Serial8/0:1
link-protocol ppp
shutdown
ip address 1.2.58.5 255.255.255.252
#
interface Serial8/1:0
link-protocol ppp
shutdown
ip address 1.2.158.1 255.255.255.252
#
interface Serial8/1:1
link-protocol ppp
ip address 1.2.158.5 255.255.255.252
#
interface GigabitEthernet0/0
port link-mode route
ip address 1.2.0.1 255.255.255.252
#
policy-based-route verify permit node 0
apply output-interface Serial8/0:0
apply ip-address next-hop 1.2.58.6
apply default output-interface Serial8/1:0
apply ip-address default next-hop 1.2.158.6
policy-based-route verify permit node 1
apply output-interface Serial8/1:0
apply ip-address next-hop 1.2.158.6
#
操作过程显示打开IP Packet和IP Policy-based-route调试开关
[r1-Serial8/1:0]shutdown
%May 9 17:49:28:825 2007 r1 DRVMSG/1/DRVMSG: Serial8/1:0: change status to down
%May 9 17:49:28:825 2007 r1 IFNET/4/UPDOWN:
Line protocol on the interface Serial8/1:0 is DOWN
%May 9 17:49:28:825 2007 r1 IFNET/4/UPDOWN:
Protocol PPP IPCP on the interface Serial8/1:0 is DOWN
[r1-Serial8/1:0]ping -c 1 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
*May 9 17:50:09:197 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 17:50:09:197 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing fail for next-hop 1.2.58.6 error
*May 9 17:50:09:197 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/1:0 is down
//提示匹配缺省的下一跳
*May 9 17:50:09:197 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : default next-hop : 1.2.158.6
*May 9 17:50:09:197 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 17:50:09:197 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing fail for next-hop 1.2.58.6 error
*May 9 17:50:09:198 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/1:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1540, offset = 0, ttl = 255, protocol = 1,
checksum = 4762, s = 1.2.158.5, d = 2.2.2.2
prompt: Sending the packet from local at Serial8/1:1
*May 9 17:50:09:199 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/1:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1179, offset = 0, ttl = 255, protocol = 1,
checksum = 5123, s = 2.2.2.2, d = 1.2.158.5
prompt: Receiving IP packet from Serial8/1:1
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=4 ms
*May 9 17:50:09:394 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/1:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1179, offset = 0, ttl = 255, protocol = 1,
checksum = 5123, s = 2.2.2.2, d = 1.2.158.5
prompt: IP packet is delivering up!
--- 2.2.2.2 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 4/4/4 ms
[r1-Serial8/1:0]
7. 此时再将S8/1:1接口关闭
#
ip local policy-based-route verify
#
controller E1 8/0
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
controller E1 8/1
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
interface Serial8/0:0
link-protocol ppp
shutdown
ip address 1.2.58.1 255.255.255.252
#
interface Serial8/0:1
link-protocol ppp
shutdown
ip address 1.2.58.5 255.255.255.252
#
interface Serial8/1:0
link-protocol ppp
shutdown
ip address 1.2.158.1 255.255.255.252
#
interface Serial8/1:1
link-protocol ppp
shutdown
ip address 1.2.158.5 255.255.255.252
#
interface GigabitEthernet0/0
port link-mode route
ip address 1.2.0.1 255.255.255.252
#
policy-based-route verify permit node 0
apply output-interface Serial8/0:0
apply ip-address next-hop 1.2.58.6
apply default output-interface Serial8/1:0
apply ip-address default next-hop 1.2.158.6
policy-based-route verify permit node 1
apply output-interface Serial8/1:0
apply ip-address next-hop 1.2.158.6
#
操作过程显示打开IP Packet和IP Policy-based-route调试开关
[r1-Serial8/1:1]shutdown
%May 9 17:49:28:825 2007 r1 DRVMSG/1/DRVMSG: Serial8/1:1: change status to down
%May 9 17:49:28:825 2007 r1 IFNET/4/UPDOWN:
Line protocol on the interface Serial8/1:1 is DOWN
%May 9 17:49:28:825 2007 r1 IFNET/4/UPDOWN:
Protocol PPP IPCP on the interface Serial8/1:1 is DOWN
[r1-Serial8/1:0]ping -c 1 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
*May 9 17:53:00:462 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 17:53:00:462 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing fail for next-hop 1.2.58.6 error
*May 9 17:53:00:462 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/1:0 is down
//提示匹配缺省下一跳失败
*May 9 17:53:00:462 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing fail for next-hop 1.2.158.6 error
*May 9 17:53:00:462 2007 r1 IPFWD/7/debug_case:
Discarding, interface = OURSENDPKT, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1541, offset = 0, ttl = 255, protocol = 1,
checksum = 0, s = 0.0.0.0, d = 2.2.2.2
prompt: Destination is unreachable!
Request time out
--- 2.2.2.2 ping statistics ---
1 packet(s) transmitted
0 packet(s) received
100.00% packet loss
[r1-Serial8/1:1]
8. 配置ACL和静态路由
#
ip local policy-based-route verify
#
acl number 2000
rule 0 permit source 1.2.0.1 0
#
controller E1 8/0
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
controller E1 8/1
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
interface Serial8/0:0
link-protocol ppp
ip address 1.2.58.1 255.255.255.252
#
interface Serial8/0:1
link-protocol ppp
ip address 1.2.58.5 255.255.255.252
#
interface Serial8/1:0
link-protocol ppp
ip address 1.2.158.1 255.255.255.252
#
interface Serial8/1:1
link-protocol ppp
ip address 1.2.158.5 255.255.255.252
#
interface GigabitEthernet0/0
port link-mode route
ip address 1.2.0.1 255.255.255.252
#
policy-based-route verify permit node 0
if-match acl 2000
apply output-interface Serial8/0:0
apply ip-address next-hop 1.2.58.6
apply default output-interface Serial8/1:0
apply ip-address default next-hop 1.2.158.6
policy-based-route verify permit node 1
apply output-interface Serial8/1:0
apply ip-address next-hop 1.2.158.6
#
ip route-static 0.0.0.0 0.0.0.0 1.2.0.2
#
操作过程显示打开IP Packet和IP Policy-based-route调试开关
//不带源地址ping,不匹配ACL 2000
<r1>ping -c 1 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
//匹配中策略路由节点1
*May 9 19:32:54:101 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface : Serial8/1:0
*May 9 19:32:54:102 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1545, offset = 0, ttl = 255, protocol = 1,
checksum = 4761, s = 1.2.158.1, d = 2.2.2.2
prompt: Sending the packet from local at Serial8/1:0
*May 9 19:32:54:104 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1183, offset = 0, ttl = 255, protocol = 1,
checksum = 5123, s = 2.2.2.2, d = 1.2.158.1
prompt: Receiving IP packet from Serial8/1:0
*May 9 19:32:54:104 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1183, offset = 0, ttl = 255, protocol = 1,
checksum = 5123, s = 2.2.2.2, d = 1.2.158.1
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=4 ms
--- 2.2.2.2 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 4/4/4 ms
//带源地址1.2.0.1 ping 2.2.2.2,匹配ACL 2000
<r1>ping -c 1 -a 1.2.0.1 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
//提示匹配中策略路由节点0
*May 9 19:32:57:537 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface : Serial8/0:0
*May 9 19:32:57:537 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/0:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1546, offset = 0, ttl = 255, protocol = 1,
checksum = 45208, s = 1.2.0.1, d = 2.2.2.2
prompt: Sending the packet from local at Serial8/0:0
*May 9 19:32:57:538 2007 r1 IPFWD/7/debug_case:
Receiving, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1184, offset = 0, ttl = 255, protocol = 1,
checksum = 45570, s = 2.2.2.2, d = 1.2.0.1
prompt: Receiving IP packet from GigabitEthernet0/0
*May 9 19:32:57:538 2007 r1 IPDBG/7/debug_case:
Delivering, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1184, offset = 0, ttl = 255, protocol = 1,
checksum = 45570, s = 2.2.2.2, d = 1.2.0.1
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=3 ms
--- 2.2.2.2 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms
<r1>
9. 配置双出接口和双下一跳
#
ip local policy-based-route verify
#
controller E1 8/0
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
controller E1 8/1
channel-set 0 timeslot-list 1-15
channel-set 1 timeslot-list 16-31
#
interface Serial8/0:0
link-protocol ppp
ip address 1.2.58.1 255.255.255.252
#
interface Serial8/0:1
link-protocol ppp
ip address 1.2.58.5 255.255.255.252
#
interface Serial8/1:0
link-protocol ppp
ip address 1.2.158.1 255.255.255.252
#
interface Serial8/1:1
link-protocol ppp
ip address 1.2.158.5 255.255.255.252
#
interface GigabitEthernet0/0
port link-mode route
ip address 1.2.0.1 255.255.255.252
#
policy-based-route verify permit node 0
apply output-interface Serial8/0:0 Serial8/1:0
apply ip-address next-hop 1.2.58.6 1.2.158.6
#
ip route-static 0.0.0.0 0.0.0.0 1.2.0.2
#
操作过程显示打开IP Packet和IP Policy-based-route调试开关
//可以看到,在2个出接口中作负载分担
[r1-Serial8/0:0]ping -c 2 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
*May 9 20:14:40:177 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface : Serial8/0:0
*May 9 20:14:40:177 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/0:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1569, offset = 0, ttl = 255, protocol = 1,
checksum = 30337, s = 1.2.58.1, d = 2.2.2.2
prompt: Sending the packet from local at Serial8/0:0
*May 9 20:14:40:179 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/0:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1207, offset = 0, ttl = 255, protocol = 1,
checksum = 30699, s = 2.2.2.2, d = 1.2.58.1
prompt: Receiving IP packet from Serial8/0:0
*May 9 20:14:40:180 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/0:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1207, offset = 0, ttl = 255, protocol = 1,
checksum = 30699, s = 2.2.2.2, d = 1.2.58.1
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=4 ms
*May 9 20:14:40:382 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface : Serial8/1:0
*May 9 20:14:40:383 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1570, offset = 0, ttl = 255, protocol = 1,
checksum = 4736, s = 1.2.158.1, d = 2.2.2.2
prompt: Sending the packet from local at Serial8/1:0
*May 9 20:14:40:385 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1208, offset = 0, ttl = 255, protocol = 1,
checksum = 5098, s = 2.2.2.2, d = 1.2.158.1
prompt: Receiving IP packet from Serial8/1:0
*May 9 20:14:40:385 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1208, offset = 0, ttl = 255, protocol = 1,
checksum = 5098, s = 2.2.2.2, d = 1.2.158.1
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=3 ms
--- 2.2.2.2 ping statistics ---
2 packet(s) transmitted
2 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/4 ms
[r1-Serial8/0:0]sh
[r1-Serial8/0:0]
%May 9 20:14:49:324 2007 r1 DRVMSG/1/DRVMSG: Serial8/0:0: change status to down
%May 9 20:14:49:324 2007 r1 IFNET/4/UPDOWN:
Line protocol on the interface Serial8/0:0 is DOWN
%May 9 20:14:49:324 2007 r1 IFNET/4/UPDOWN:
Protocol PPP IPCP on the interface Serial8/0:0 is DOWN
[r1-Serial8/0:0]ping -c 2 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
//可以看到全部流量切换至S8/1:0
*May 9 20:14:52:830 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 20:14:52:830 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface : Serial8/1:0
*May 9 20:14:52:830 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1571, offset = 0, ttl = 255, protocol = 1,
checksum = 4735, s = 1.2.158.1, d = 2.2.2.2
prompt: Sending the packet from local at Serial8/1:0
*May 9 20:14:52:832 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1209, offset = 0, ttl = 255, protocol = 1,
checksum = 5097, s = 2.2.2.2, d = 1.2.158.1
prompt: Receiving IP packet from Serial8/1:0
*May 9 20:14:52:832 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1209, offset = 0, ttl = 255, protocol = 1,
checksum = 5097, s = 2.2.2.2, d = 1.2.158.1
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=4 ms
*May 9 20:14:53:39 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 20:14:53:39 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface : Serial8/1:0
*May 9 20:14:53:39 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1572, offset = 0, ttl = 255, protocol = 1,
checksum = 4734, s = 1.2.158.1, d = 2.2.2.2
prompt: Sending the packet from local at Serial8/1:0
*May 9 20:14:53:42 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1210, offset = 0, ttl = 255, protocol = 1,
checksum = 5096, s = 2.2.2.2, d = 1.2.158.1
prompt: Receiving IP packet from Serial8/1:0
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=4 ms
*May 9 20:14:53:442 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/1:0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1210, offset = 0, ttl = 255, protocol = 1,
checksum = 5096, s = 2.2.2.2, d = 1.2.158.1
prompt: IP packet is delivering up!
--- 2.2.2.2 ping statistics ---
2 packet(s) transmitted
2 packet(s) received
0.00% packet loss
round-trip min/avg/max = 4/4/4 ms
[r1-Serial8/0:0]int s8/1:0
[r1-Serial8/1:0]sh
[r1-Serial8/1:0]
%May 9 20:15:08:36 2007 r1 DRVMSG/1/DRVMSG: Serial8/1:0: change status to down
%May 9 20:15:08:36 2007 r1 IFNET/4/UPDOWN:
Line protocol on the interface Serial8/1:0 is DOWN
%May 9 20:15:08:36 2007 r1 IFNET/4/UPDOWN:
Protocol PPP IPCP on the interface Serial8/1:0 is DOWN
[r1-Serial8/1:0]ping -c 2 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
//可以看到在2个下一跳中做负载分担
*May 9 20:15:12:68 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 20:15:12:68 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/1:0 is down
*May 9 20:15:12:68 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : next-hop : 1.2.58.6
*May 9 20:15:12:68 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/0:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1573, offset = 0, ttl = 255, protocol = 1,
checksum = 30329, s = 1.2.58.5, d = 2.2.2.2
prompt: Sending the packet from local at Serial8/0:1
*May 9 20:15:12:70 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/0:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1211, offset = 0, ttl = 255, protocol = 1,
checksum = 30691, s = 2.2.2.2, d = 1.2.58.5
prompt: Receiving IP packet from Serial8/0:1
*May 9 20:15:12:70 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/0:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1211, offset = 0, ttl = 255, protocol = 1,
checksum = 30691, s = 2.2.2.2, d = 1.2.58.5
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=4 ms
*May 9 20:15:12:276 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 20:15:12:277 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/1:0 is down
*May 9 20:15:12:277 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : next-hop : 1.2.158.6
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=3 ms
*May 9 20:15:12:528 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/1:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1574, offset = 0, ttl = 255, protocol = 1,
checksum = 4728, s = 1.2.158.5, d = 2.2.2.2
prompt: Sending the packet from local at Serial8/1:1
*May 9 20:15:12:830 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/1:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1212, offset = 0, ttl = 255, protocol = 1,
checksum = 5090, s = 2.2.2.2, d = 1.2.158.5
prompt: Receiving IP packet from Serial8/1:1
*May 9 20:15:13:82 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/1:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1212, offset = 0, ttl = 255, protocol = 1,
checksum = 5090, s = 2.2.2.2, d = 1.2.158.5
prompt: IP packet is delivering up!
--- 2.2.2.2 ping statistics ---
2 packet(s) transmitted
2 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/4 ms
[r1-Serial8/1:0]int s8/0:1
[r1-Serial8/0:1]shu
[r1-Serial8/0:1]
%May 9 20:15:40:157 2007 r1 DRVMSG/1/DRVMSG: Serial8/0:1: change status to down
%May 9 20:15:40:157 2007 r1 IFNET/4/UPDOWN:
Line protocol on the interface Serial8/0:1 is DOWN
%May 9 20:15:40:157 2007 r1 IFNET/4/UPDOWN:
Protocol PPP IPCP on the interface Serial8/0:1 is DOWN
[r1-Serial8/0:1]ping -c 2 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
//依然是在2个下一跳之间做负载分担
*May 9 20:15:47:730 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 20:15:47:730 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/1:0 is down
*May 9 20:15:47:730 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : next-hop : 1.2.58.6
*May 9 20:15:47:730 2007 r1 IPFWD/7/debug_case:
Sending, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1575, offset = 0, ttl = 255, protocol = 1,
checksum = 45179, s = 1.2.0.1, d = 2.2.2.2
//由于默认路由的存在,认为1.2.58.6可达,因此走缺省路由转发
prompt: Sending the packet from local at GigabitEthernet0/0
*May 9 20:15:47:731 2007 r1 IPFWD/7/debug_case:
Receiving, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1213, offset = 0, ttl = 255, protocol = 1,
checksum = 45541, s = 2.2.2.2, d = 1.2.0.1
prompt: Receiving IP packet from GigabitEthernet0/0
*May 9 20:15:47:731 2007 r1 IPDBG/7/debug_case:
Delivering, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1213, offset = 0, ttl = 255, protocol = 1,
checksum = 45541, s = 2.2.2.2, d = 1.2.0.1
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=3 ms
*May 9 20:15:47:939 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 20:15:47:940 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/1:0 is down
*May 9 20:15:47:940 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : next-hop : 1.2.158.6
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=3 ms
*May 9 20:15:48:191 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/1:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1576, offset = 0, ttl = 255, protocol = 1,
checksum = 4726, s = 1.2.158.5, d = 2.2.2.2
prompt: Sending the packet from local at Serial8/1:1
*May 9 20:15:48:493 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/1:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1214, offset = 0, ttl = 255, protocol = 1,
checksum = 5088, s = 2.2.2.2, d = 1.2.158.5
prompt: Receiving IP packet from Serial8/1:1
*May 9 20:15:48:795 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/1:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1214, offset = 0, ttl = 255, protocol = 1,
checksum = 5088, s = 2.2.2.2, d = 1.2.158.5
prompt: IP packet is delivering up!
--- 2.2.2.2 ping statistics ---
2 packet(s) transmitted
2 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms
[r1-Serial8/0:1]un sh
[r1-Serial8/0:1]
%May 9 20:30:48:201 2007 r1 DRVMSG/1/DRVMSG: Serial8/0:1: change status to up
%May 9 20:30:48:202 2007 r1 IFNET/4/UPDOWN:
Line protocol on the interface Serial8/0:1 is UP
%May 9 20:30:48:205 2007 r1 IFNET/4/UPDOWN:
Protocol PPP IPCP on the interface Serial8/0:1 is UP
[r1-Serial8/0:1]int s8/1:1
[r1-Serial8/1:1]sh
[r1-Serial8/1:1]
%May 9 20:30:53:360 2007 r1 DRVMSG/1/DRVMSG: Serial8/1:1: change status to down
%May 9 20:30:53:360 2007 r1 IFNET/4/UPDOWN:
Line protocol on the interface Serial8/1:1 is DOWN
%May 9 20:30:53:360 2007 r1 IFNET/4/UPDOWN:
Protocol PPP IPCP on the interface Serial8/1:1 is DOWN
[r1-Serial8/1:1]ping -c 2 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
//也是依然在2个下一跳之间做负载分担
*May 9 20:30:57:901 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 20:30:57:901 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/1:0 is down
*May 9 20:30:57:901 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : next-hop : 1.2.58.6
*May 9 20:30:57:901 2007 r1 IPFWD/7/debug_case:
Sending, interface = Serial8/0:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1579, offset = 0, ttl = 255, protocol = 1,
checksum = 30323, s = 1.2.58.5, d = 2.2.2.2
prompt: Sending the packet from local at Serial8/0:1
*May 9 20:30:57:903 2007 r1 IPFWD/7/debug_case:
Receiving, interface = Serial8/0:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1217, offset = 0, ttl = 255, protocol = 1,
checksum = 30685, s = 2.2.2.2, d = 1.2.58.5
prompt: Receiving IP packet from Serial8/0:1
*May 9 20:30:57:903 2007 r1 IPDBG/7/debug_case:
Delivering, interface = Serial8/0:1, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1217, offset = 0, ttl = 255, protocol = 1,
checksum = 30685, s = 2.2.2.2, d = 1.2.58.5
prompt: IP packet is delivering up!
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=4 ms
*May 9 20:30:58:110 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/0:0 is down
*May 9 20:30:58:111 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : output interface Serial8/1:0 is down
*May 9 20:30:58:111 2007 r1 PBR/7/POLICY-ROUTING:IP policy based routing success : next-hop : 1.2.158.6
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=2 ms
*May 9 20:30:58:362 2007 r1 IPFWD/7/debug_case:
Sending, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1580, offset = 0, ttl = 255, protocol = 1,
checksum = 45174, s = 1.2.0.1, d = 2.2.2.2
//也是因为缺省路由的存在,因而认为1.2.158.6可达,从缺省路由转发
prompt: Sending the packet from local at GigabitEthernet0/0
*May 9 20:30:58:664 2007 r1 IPFWD/7/debug_case:
Receiving, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1218, offset = 0, ttl = 255, protocol = 1,
checksum = 45536, s = 2.2.2.2, d = 1.2.0.1
prompt: Receiving IP packet from GigabitEthernet0/0
*May 9 20:30:58:916 2007 r1 IPDBG/7/debug_case:
Delivering, interface = GigabitEthernet0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 1218, offset = 0, ttl = 255, protocol = 1,
checksum = 45536, s = 2.2.2.2, d = 1.2.0.1
prompt: IP packet is delivering up!
--- 2.2.2.2 ping statistics ---
2 packet(s) transmitted
2 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/3/4 ms
[r1-Serial8/1:1]
三、过程分析:
1. 节点和节点之间是靠ACL来实现的,而不是路由,当一条流进入第一个节点后在任何条件下都不会进入下一个节点,只有某一条流不符合前一个节点的匹配条件下才会匹配下一个节点;
2. 应用出接口的优先级要高于应用下一跳,只有当前出接口不可用情况下(可以通过ping接口地址判断)才会应用下一跳,因此如果出接口类型是NBMA或P2MP或广播(以太网就是典型),那么出接口不可用的条件要苛刻很多;
3. 应用默认出接口和默认下一跳的前提条件就是被策略的流在路由表中没有可以匹配的表项(即连默认路由都没有),在上例中可以通过display ip routing-table 2.2.2.2检查,如果发现没有任何路由,那么应用默认出接口或默认下一跳,否则按照普通路由表转发而不是策略路由转发;
4. 应用2个出接口或默认出接口、应用2个下一跳或默认下一跳时会进行负载分担;
5. 应用下一跳和默认下一跳会进行路由迭代,如上例中2个下一跳1.2.58.6和1.2.158.6,可以通过display ip routing-table 1.2.58.6/1.2.158.6来检查,如果此时发现有相应的普通路由表项,则策略路由迭代到此表项,如配置了ip route-static 0.0.0.0 0 1.2.0.2可以匹配1.2.58.6和1.2.158.6,所以在步骤分析一节中第3和第4小节可以看到匹配下一跳结果,前者成功(配置缺省路由)后者失败(无缺省路由,只有2.2.2.2的精确路由)。
四、结论:
有争论的地方在过程分析第5点,不应该对下一跳的默认路由进行迭代,因为普通路由表迭代中默认路由也是不参与迭代的,因为这样在IGP路由引入过程中会导致环路。在本例中,就可以配置2个下一跳并且缺省路由存在情况下,当其中一个下一跳不可达时,这个下一跳会迭代到缺省路由并进行负载分担,实际组网中很可能导致50%的丢包,我们更希望的是所有流量都切换到另一个下一跳中,这才是真正的负载分担+备份的功能。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作