gqinvs 发表于 2018-7-26 13:16:08

华为S9300上应用基于报文长度的策略路由

组网要求:  对大小为64~1400字节的报文设置150.1.1.2作为下一跳地址。
  对大小为1401~1500字节的报文设置151.1.1.2作为下一跳地址。
  所有其它长度的报文都按基于目的地址的方法路由。
http://localhost:7891/pages/31183887/06%20(2010-01-08)/31183887/06%20(2010-01-08)/resources/s/images/fig_dc_s_cfg_09414001.png
基于报文长度的策略路由配置思路如下:   

  首先指定各接口的IP地址。
  配置动态路由协议,此处使用RIP协议。
  配置策略路由,包括匹配规则和动作。
操作步骤:  配置S9300A
  # 配置各接口的IP地址。
<Quidway> system-view   sysname S9300A
   vlan batch 10 to 11
   interface gigabitethernet 1/0/1
   port hybrid tagged vlan 10
   quit
   interface vlanif 10
   ip address 150.1.1.1 255.255.255.0
   quit
   interface gigabitethernet 1/0/2
   port hybrid tagged vlan 11
   quit
   interface vlanif 11
   ip address 151.1.1.1 255.255.255.0
   quit
  # 配置RIP路由协议。
rip   network 150.1.0.0
   network 151.1.0.0
   quit
  # 配置名称为policy1的策略路由。
policy-based-route policy1 permit node 10   if-match packet-length 64 1400
   apply ip-address next-hop 150.1.1.2
   quit
   policy-based-route policy1 permit node 20
   if-match packet-length 1401 1500
   apply ip-address next-hop 151.1.1.2
   quit
  # 使能策略路由。
ip local policy-based-route policy1  配置S9300B
<Quidway> system-view   sysname S9300B
   vlan batch 10 11
   interface gigabitethernet 1/0/1
   port hybrid tagged vlan 10
   quit
   interface vlanif 10
   ip address 150.1.1.2 255.255.255.0
   quit
   interface gigabitethernet 1/0/2
   port hybrid tagged vlan 11
   quit
   interface vlanif 11
   ip address 151.1.1.2 255.255.255.0
   quit
   rip
   network 10.0.0.0
   network 150.1.0.0
   network 151.1.0.0
   quit
  验证配置结果
  # 在S9300A用debugging ip policy-based-route命令监视策略路由。
<S9300A> debugging ip policy-based-route  <S9300A> terminal debugging
  <S9300A> terminal monitor
  # 从S9300A的GE2/0/0接口直连网段一台主机Ping S9300B的Loopback0接口,并将报文数据字段长度设为80字节。
C:\&gt; ping -l 80 10.1.1.1  Pinging 10.1.1.1 with 80 bytes of data:
  Reply from 10.1.1.1: bytes=80 time<6ms TTL=255
  Reply from 10.1.1.1: bytes=80 time&lt;1ms TTL=255
  Reply from 10.1.1.1: bytes=80 time&lt;10ms TTL=255
  Reply from 10.1.1.1: bytes=80 time&lt;18ms TTL=255
  Ping statistics for 10.1.1.1:
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
  Approximate round trip times in milli-seconds:
  Minimum = 1ms, Maximum = 18ms, Average = 8ms
  # S9300A上显示的策略路由信息如下:
  *0.3417920 S9300A PBR/7/POLICY-ROUTING:IP Policy routing success : next-hop : 150.1.1.2
  *0.3418310 S9300A PBR/7/POLICY-ROUTING:IP Policy routing success : next-hop : 150.1.1.2
  *0.3418850 S9300A PBR/7/POLICY-ROUTING:IP Policy routing success : next-hop : 150.1.1.2
  *0.3419370 S9300A PBR/7/POLICY-ROUTING:IP Policy routing success : next-hop : 150.1.1.2
  # 以上策略路由信息显示,S9300A在接收到报文后,根据策略路由确定的下一跳为150.1.1.2,也就是说将报文从接口VLANIF10转发出去。
  # 从S9300A的GE2/0/0接口直连网段一台主机Ping S9300B的Loopback0接口,并将报文数据字段长度设为1450字节。
C:\> ping -l 1450 10.1.1.1  Pinging 10.1.1.1 with 1450 bytes of data:
  Reply from 10.1.1.1: bytes=1450 time&lt;18ms TTL=255
  Reply from 10.1.1.1: bytes=1450 time&lt;140ms TTL=255
  Reply from 10.1.1.1: bytes=1450 time&lt;5ms TTL=255
  Reply from 10.1.1.1: bytes=1450 time&lt;15ms TTL=255
  Ping statistics for 10.1.1.1:
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
  Approximate round trip times in milli-seconds:
  Minimum = 5ms, Maximum = 140ms, Average = 44ms
  # S9300A上显示的策略路由信息如下:
*0.3785670 S9300 PBR/7/POLICY-ROUTING:IP Policy routing success : next-hop : 151.1.1.2  *0.3786680 S9300 PBR/7/POLICY-ROUTING:IP Policy routing success : next-hop : 151.1.1.2
  *0.3787200 S9300 PBR/7/POLICY-ROUTING:IP Policy routing success : next-hop : 151.1.1.2
  *0.3787730 S9300 PBR/7/POLICY-ROUTING:IP Policy routing success : next-hop : 151.1.1.2
  # 以上策略路由信息显示,S9300A在接收到报文后,根据策略路由确定的下一跳为151.1.1.2,也就是说将报文从接口VLANIF11转发出去
页: [1]
查看完整版本: 华为S9300上应用基于报文长度的策略路由