1、华为策略路由配置实例华为策略路由配置实例1、组网需求20.1.20.1/24贷司 20.1.30JZ24图1策略路由组网示例图如上图1所示,公司用户通过Switch双归属到外部网络设备。其中,一条是低速链路,网关为10.1.20.1/24 ;另外一条是高速链路,网关为10.1.30.1/24 。公司希望上送外部网络的报文中,IP优先级为4、5、6、7的报文通过高速链路传输,而IP优先级为0、1、2、3的报文则通过低速链路传输。2、配置思路1、 创建VLAN并配置各接口,实现公司和外部网络设备互连。2、 配置ACL规则,分别匹配IP优先级4、5、6、7,以及IP优先级0、1、2、3、3、 配置流
2、分类,匹配规则为上述 ACL规则,使设备可以对报文进行区分。4、 配置流行为,使满足不同规则的报文分别被重定向到 10.1.20.1/24和10.1.30.1/24。5、 配置流策略,绑定上述流分类和流行为,并应用到接口 GE2/0/1的入方向上, 实现策略路由。3、操作步骤3.1、创建VLAN并配置各接口#在 Switch 上创建 VLAN100 和 VLAN200 。 system-viewHUAWEI sysname SwitchSwitch vian batch 100 200#配置 Switch 上接口 GE1/0/1、GE1/0/2 和 GE2/0/1 的接口类型为 Trunk ,
3、 并加入 VLAN100 和 VLAN200。Switch in terface gigabitethernet 1/0/1Switch-GigabitEthernet1/0/1port lin k-type trunkSwitch-GigabitEthernet1/0/1port trunk allow-pass vlan 100 200Switch-GigabitEthernet1/0/1quitSwitch in terface gigabitethernet 1/0/2Switch-GigabitEthernet1/0/2port lin k-type trunkSwitch-Giga
4、bitEthernet1/0/2port trunk allow-pass vlan 100 200Switch-GigabitEthernet1/0/2quitSwitch in terface gigabitethernet 2/0/1Switch-GigabitEthernet2/0/1port lin k-type trunkSwitch-GigabitEthernet2/0/1port trunk allow-pass vlan 100 200Switch-GigabitEthernet2/0/1quit配置LSW 与Switch对接的接口为Trunk类型接口,并加入 VLAN100
5、和VLAN200。#创建VLANIF100 和VLANIF200,并配置各虚拟接口 IP地址Switch in terface via nif 100Switch-Via nif100 ip address 10.1.20.2 24Switch-Via nif100 quitSwitch in terface via nif 200Switch-Via nif200 ip address 10.1.30.2 24Switch-Via nif200 quit3.2、配置ACL规贝UIP优先#在Switch上创建编码为3001、3002的高级ACL,规则分别为允许级0、1、2、3和允许IP优先级4
6、、5、6、7的报文通过Switch aci 3001Switch-aci-adv-3001Switch-aci-adv-3001Switch-aci-adv-3001Switch-aci-adv-3001Switch-aci-adv-3001Switch aci 3002Switch-aci-adv-3002ruie permit ip precede nee 0ruie permit ip precede nee 1ruie permit ip precede nee 2ruie permit ip precede nee 3 quitruie permit ip precede nee 4
7、Switch-acl-adv-3002rule permit ip precede nee 5Switch-acl-adv-3002rule permit ip precede nee 6Switch-acl-adv-3002rule permit ip precede nee 7Switch-acl-adv-3002quit3.3、配置流分类在Switch上创建流分类cl、c2,匹配规则分别为 ACL 3001和 ACL 3002。Switch traffic classifier c1 operator andSwitch-classifier-c1if-match acl 3001Swi
8、tch-classifier-c1quitSwitch traffic classifier c2 operator andSwitch-classifier-c2if-match acl 3002Switch-classifier-c2quit3.4、配置流行为#在Switch上创建流行为b1、b2,并分别指疋重疋向到网段10.1.20.1/24 和10.1.30.1/24 的动作。Switch traffic behavior b1Switch-behavior-b1redirect ip-n exthop 10.1.20.1Switch-behavior-b1quitSwitch tra
9、ffic behavior b2Switch-behavior-b2redirect ip-n exthop 10.1.30.1Switch-behavior-b2 quit3.5、配置流策略并应用到接口上 Switch traffic policy plSwitch in terface gigabitethernet 2/0/1traffic-policy p1 inboundreturnSwitch-GigabitEthernet2/0/1 Switch-GigabitEthernet2/0/13.6、验证配置结果 #查看ACL规则的配置信息。 display acl 3001Adva
10、need ACL 3001,4 rulesAcls step is 5rule 5 permit ip precede nee rout ine (match-co un ter 0)rule 10 permit ip precede nee priority (match-co un ter 0)rule 15 permit ip precede nee immediate (match-co un ter 0)rule 20 permit ip precede nee flash (match-co un ter 0) display acl 3002Adva need ACL 3002,
11、 4 rulesAcls step is 5rule 5 permit ip precede nee flash-override (match-co un ter 0)rule 10 permit ip precede nee critical (match-co un ter 0)rule 15 permit ip precede nee internet (match-co un ter 0)rule 20 permit ip precede nee n etwork (match-co un ter 0)#查看流分类的配置信息。 display traffic classifier u
12、ser-defi nedUser Defined Classifier In formati on:Classifier: clPrecede nee: 5Operator: ANDRule(s) : if-match acl 3001Classifier: c2Precede nee: 10Operator: ANDRule(s) : if-match acl 3002Total classifier number is 2#查看流策略的配置信息。 display traffic policy user-defi ned plUser Defined Traffic Policy In fo
13、rmati on:Policy: p1Classifier: c1Operator: ANDBehavior: b1Redirect: no forcedRedirect ip-n exthop10.1.20.1Classifier: c2Operator: ANDBehavior: b2Redirect: no forcedRedirect ip-n exthop10.1.30.14、配置文件Switch的配置文件sys name Switch#vlan batch 100 200#acl number 3001rule 5 permit ip precede nee routi nerul
14、e 10 permit ip precede nee priorityrule 15 permit ip precede nee immediaterule 20 permit ip precede nee flash#acl number 3002rule 5 permit ip precede nee flash-overriderule 10 permit ip precede nee criticalrule 15 permit ip precede nee in ternetrule 20 permit ip precede nee n etwork#traffic classifi
15、er c1 operator and precede nee 5if-match acl 3001traffic classifier c2 operator and precede nee 10if-match acl 3002#traffic behavior blredirect ip-nexthop 10.1.20.1traffic behavior b2redirect ip-nexthop 10.1.30.1#traffic policy p1 match-order configclassifier c1 behavior b1classifier c2 behavior b2#
16、in terface Via nif100ip address 10.1.20.2 255.255.255.0#in terface Via nif200ip address 10.1.30.2 255.255.255.0#in terface GigabitEthernet1/0/1port lin k-type trunkport trunk aiiow-pass vian 100 200#in terface GigabitEthernet1/0/2port lin k-type trunkport trunk aiiow-pass vian 100 200in terface GigabitEthernet2/0/1port lin k-type trunkport trunk allow-pass vlan 100 200traffic-policy p1 inbound#return此文档可自行编辑修改,如有侵权请告知删除,感谢您的支持,我们会努力把内容做得更好
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1