天天看点

WJC 分流

<a href="http://s3.51cto.com/wyfs02/M01/92/ED/wKiom1kFXMKRFOxfAABybNJl5IE458.png" target="_blank"></a>

环境:R3 Loop test ip1:3.3.3.3, test ip2:33.33.33.33

R4 (PC): Client ip:40.1.1.4

WJC-LAY3:三层交换机,学到去3.3.3.3/33.33.33.33的路由如下

<a href="http://s3.51cto.com/wyfs02/M02/92/EC/wKioL1kFXMPzgEm4AABED4WUZ_o536.png" target="_blank"></a>

优选E0/0出去

为了不影响R1(RA)&amp; R2(RB)的配置,我们尽量把policy做在WJC三层交换上

扩展1:基于某一网段实现分流,可以是语音网段

基于40.1.1.X网段做policy

WJC-SWL3(config)#access-list 10 permit 40.1.1.0 0.0.0.255

WJC-SWL3(config)#route-map policy1

WJC-SWL3(config-route-map)#match ip add 10

WJC-SWL3(config-route-map)#set ip next-hop 20.1.1.2

WJC-SWL3(config-route-map)#exit

WJC-SWL3(config)#int e0/1 \\入方向做policy

WJC-SWL3(config-if)#ip policy route-map policy1

看前后两次对结果:

<a href="http://s3.51cto.com/wyfs02/M01/92/EC/wKioL1kFXMSRkk7LAADTunSwOlc097.png" target="_blank"></a>

WJC-SWL3#debug ip policy

Policy routing debugging is on

WJC-SWL3#

*Apr 30 11:02:27.865: IP: s=40.1.1.4 (Ethernet0/1), d=3.3.3.3, len 28, policy match

*Apr 30 11:02:27.865: IP: route map policy1, item 10, permit

*Apr 30 11:02:27.865: IP: s=40.1.1.4 (Ethernet0/1), d=3.3.3.3 (Serial2/0), len 28, policy routed

*Apr 30 11:02:27.865: IP: Ethernet0/1 to Serial2/0 20.1.1.2

扩展2:实现打印分流 我们可以扩展ACL,比如说我们去打印服务器3.3.3.3,让流量强制走备线S2/0出去而去其他网段比如:33.33.33.33,依旧走E0/0

WJC-SWL3(config)#do sh access-list

Extended IP access list 100

10 permit ip any 3.3.3.0 0.0.0.255

WJC-SWL3(config)#route-map policy2

WJC-SWL3(config-route-map)#match ip address 100

WJC-SWL3(config)#int e0/1

WJC-SWL3(config-if)#ip policy route-map policy2

成功实现结果如下:

<a href="http://s3.51cto.com/wyfs02/M00/92/EC/wKioL1kFXMSw1RmSAADkQoaSvqo917.png" target="_blank"></a>

扩展3:另外route map后面可以跟序号,可以匹配多条ACL 做不同的分流

WJC-SWL3(config)#route-map policy2 ?

&lt;0-65535&gt; Sequence to insert to/delete from existing route-map entry

本文转自 bilinyee博客,原文链接:     http://blog.51cto.com/ericfu/1920797   如需转载请自行联系原作者

继续阅读