5.5 IP策略路由典型配置
5.5.1 策略路由基本配置
『需求』
在Router上做策略路由,从40.1.1.0/25来的报文送往S0口,从40.1.1.128/25来的报文送往S1。
【Router】
当前路由器提示视图 |
依次输入的配置命令,重要的命令红色突出显示 |
简单说明 |
|
|
! |
适用版本:vrp1.74/1.44 |
|
[Router] |
acl 2001 |
定义acl1 |
|
[Router-acl-1] |
rule normal permit source 40.1.1.0 0.0.0.127 |
允许40.1.1.0/25源地址网段 |
|
[Router-acl-1] |
rule normal deny source any |
禁止其他任何网段 |
|
|
! |
|
|
[Router] |
acl 2002 |
定义acl2 |
|
[Router-acl-2] |
rule normal permit source 40.1.1.128 0.0.0.127 |
允许40.1.1.128/25源地址网段 |
|
[Router-acl-2] |
rule normal deny source any |
禁止其他任何网段 |
|
|
! |
|
|
[Router] |
interface Ethernet0 |
进入以太0口 |
|
[Router-ethernet0] |
ip address 40.1.1.1 255.255.255.0 |
配置ip地址 |
|
[Router-ethernet0] |
ip policy route-policy aaa |
应用aaa策略 |
|
|
! |
|
|
[Router] |
interface Serial0 |
进入串口0口 |
|
[Router-Serial0] |
link-protocol ppp |
封装ppp链路层协议 |
|
[Router-Serial0] |
ip address 30.1.1.2 255.255.255.252 |
配置ip地址 |
|
|
! |
|
|
[Router] |
interface Serial1 |
进入串口0口 |
|
[Router-Serial1] |
link-protocol ppp |
封装ppp链路层协议 |
|
[Router-Serial1] |
ip address 20.1.1.2 255.255.255.252 |
配置ip地址 |
|
|
! |
|
|
|
quit |
|
|
[Router] |
route-policy aaa permit 10 |
定义route-policy节点10 |
|
[Router-route-policy] |
if-match ip address 2001 |
规则,匹配acl 2001的报文 |
|
[Router-route-policy] |
apply interface Serial0 |
发往serial0 |
|
|
quit |
|
|
[Router] |
route-policy aaa permit 20 |
定义route-policy节点20 |
|
[Router-route-policy] |
if-match ip address 2002 |
匹配acl 2002的报文 |
|
[Router-route-policy] |
apply interface Serial1 |
发往serial1 |
|
|
! |
|