设为首页 收藏本站
查看: 2785|回复: 0

[经验分享] 华为S9300上应用基于报文长度的策略路由

[复制链接]

尚未签到

发表于 2018-7-26 13:16:08 | 显示全部楼层 |阅读模式
组网要求:  对大小为64~1400字节的报文设置150.1.1.2作为下一跳地址。
  对大小为1401~1500字节的报文设置151.1.1.2作为下一跳地址。
  所有其它长度的报文都按基于目的地址的方法路由。

基于报文长度的策略路由配置思路如下:   

  首先指定各接口的IP地址。
  配置动态路由协议,此处使用RIP协议。
  配置策略路由,包括匹配规则和动作。
操作步骤:  配置S9300A
  # 配置各接口的IP地址。
<Quidway> system-view  [Quidway] sysname S9300A
  [S9300A] vlan batch 10 to 11
  [S9300A] interface gigabitethernet 1/0/1
  [S9300A-GigabitEthernet1/0/1] port hybrid tagged vlan 10
  [S9300A-GigabitEthernet1/0/1] quit
  [S9300A] interface vlanif 10
  [S9300A-Vlanif10] ip address 150.1.1.1 255.255.255.0
  [S9300A-Vlanif10] quit
  [S9300A] interface gigabitethernet 1/0/2
  [S9300A-GigabitEthernet1/0/2] port hybrid tagged vlan 11
  [S9300A-GigabitEthernet1/0/2] quit
  [S9300A] interface vlanif 11
  [S9300A-Vlanif11] ip address 151.1.1.1 255.255.255.0
  [S9300A-Vlanif11] quit
  # 配置RIP路由协议。
[S9300A] rip  [S9300A-rip-1] network 150.1.0.0
  [S9300A-rip-1] network 151.1.0.0
  [S9300A-rip-1] quit
  # 配置名称为policy1的策略路由。
[S9300A] policy-based-route policy1 permit node 10  [S9300A-policy-based-route-policy1-10] if-match packet-length 64 1400
  [S9300A-policy-based-route-policy1-10] apply ip-address next-hop 150.1.1.2
  [S9300A-policy-based-route-policy1-10] quit
  [S9300A] policy-based-route policy1 permit node 20
  [S9300A-policy-based-route-policy1-20] if-match packet-length 1401 1500
  [S9300A-policy-based-route-policy1-20] apply ip-address next-hop 151.1.1.2
  [S9300A-policy-based-route-policy1-20] quit
  # 使能策略路由。
[S9300A] ip local policy-based-route policy1  配置S9300B
<Quidway> system-view  [Quidway] sysname S9300B
  [S9300B] vlan batch 10 11
  [S9300B] interface gigabitethernet 1/0/1
  [S9300B-GigabitEthernet1/0/1] port hybrid tagged vlan 10
  [S9300B-GigabitEthernet1/0/1] quit
  [S9300B] interface vlanif 10
  [S9300B-Vlanif10] ip address 150.1.1.2 255.255.255.0
  [S9300B-Vlanif10] quit
  [S9300B] interface gigabitethernet 1/0/2
  [S9300B-GigabitEthernet1/0/2] port hybrid tagged vlan 11
  [S9300B-GigabitEthernet1/0/2] quit
  [S9300B] interface vlanif 11
  [S9300B-Vlanif11] ip address 151.1.1.2 255.255.255.0
  [S9300B-Vlanif11] quit
  [S9300B] rip
  [S9300B-rip-1] network 10.0.0.0
  [S9300B-rip-1] network 150.1.0.0
  [S9300B-rip-1] network 151.1.0.0
  [S9300B-rip-1] 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、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-541637-1-1.html 上篇帖子: H3C 华为配置FTP服务器 下篇帖子: 华为H3C的VLAN比思科的VLAN真心复杂
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表