多平台统一管理软件接口,如何实现多平台统一管理软件接口
1484
2022-09-18
华为设备路由策略配置命令(华为设备路由策略配置命令是什么)
(一)配置过滤器命令
1. 配置地址前缀列表命令
[Huawei]ip ip-prefix a1 permit 10.1.1.0 24 //配置地址前缀列表
[Huawei]ip ip-prefix a2 deny 10.1.1.1 32
[Huawei]display ip ip-prefix //查看地址前缀列表的详细配置信息
2. 配置AS属性过滤器命令
[Huawei]ip as-path-filter 1 permit 100 //配置AS路径过滤器(100代表使用正则表达式定义匹配规则)
[Huawei]ip as-path-filter 1 deny 200
[Huawei]display ip as-path-filter //查看已配置的AS路径过滤器信息
3. 配置团体属性过滤器命令
[Huawei]ip community-filter basic a1 permit 100:1 //配置基本团体属性过滤器
[Huawei]ip community-filter advanced a2 permit _100:1* //配置高级团体属性过滤器
[Huawei]display ip community-filter //查看已配置的团体属性过滤器信息
4. 配置扩展团体属性过滤器命令
[Huawei]ip extcommunity-filter basic b1 deny rt 100:10 //扩展团体属性过滤器
[Huawei]ip extcommunity-filter advanced b2 permit 100:30
[Huawei]display ip extcommunity-filter //查看已配置的扩展团体属性过滤器信息
5. 配置RD属性过滤器命令
[Huawei]ip rd-filter 1 permit 100:2 //配置RD属性过滤器
[Huawei]display ip rd-filter //查看已配置的RD属性过滤器信息
(二)配置Route-Policy命令
1. 配置If-match子句命令
[Huawei]route-policy a1 permit node 10 //创建Route-Policy,并进入Route-Policy视图
[Huawei-route-policy]if-match as-path-filter a1 //配匹配路由信息的as-path属性过滤器
[Huawei-route-policy]if-match community-filter a2 //匹配路由信息的团体属性过滤器
[Huawei-route-policy]if-match extcommunity-filter a3 //匹配BGP路由信息的扩展团体属性
[Huawei-route-policy]if-match acl 2000 //匹配基本ACL
[Huawei-route-policy]if-match cost 100 //匹配路由信息的开销值
[Huawei-route-policy]if-match interface GigabitEthernet 0/0/1 //匹配路由信息的出接口
[Huawei-route-policy]if-match ip next-hop acl 2000 //匹配路由的下一跳
[Huawei-route-policy]if-match ip route-source acl 2000 //匹配路由的源地址
[Huawei-route-policy]if-match ip-prefix a1 //匹配地址前缀列表
[Huawei-route-policy]if-match rd-filter 1 //匹配rd属性过滤器
[Huawei-route-policy]if-match route-type external-type1 //匹配OSPF各类型路由信息
[Huawei-route-policy]if-match route-type external-type1or2
[Huawei-route-policy]if-match route-type internal
[Huawei-route-policy]if-match route-type nssa-external-type1
[Huawei-route-policy]if-match route-type is-is-level-1 //匹配IS-IS各level路由信息
[Huawei-route-policy]if-match route-type is-is-level-2
[Huawei-route-policy]if-match tag 1 //匹配路由信息的标记域
2. 配置Apply子句命令
[Huawei-route-policy]apply as-path 1 additive //设置BGP路由的AS_Path属性
[Huawei-route-policy]apply backup-interface g0/0/1 //设置备份出接口
[Huawei-route-policy]apply backup-nexthop auto //设置备份下一跳
[Huawei-route-policy]apply comm-filter 1 delete //删除指定的BGP路由的团体属性
[Huawei-route-policy]apply community none //删除全部BGP路由的团体属性
[Huawei-route-policy]apply community 1 internet //设置BGP路由的团体属性
[Huawei-route-policy]apply community 1 no-advertise
[Huawei-route-policy]apply community 1 no-export
[Huawei-route-policy]apply community 1 no-export-subconfed
[Huawei-route-policy]apply cost + 100 //设置路由的开销值
[Huawei-route-policy]apply cost 100
[Huawei-route-policy]apply cost-type external //设置IS-IS的开销类型
[Huawei-route-policy]apply cost-type internal
[Huawei-route-policy]apply cost-type type-1 //设置OSPF的开销类型
[Huawei-route-policy]apply cost-type type-2
[Huawei-route-policy]apply dampening 1 2 3 1001 //设置EBGP路由的衰减参数
[Huawei-route-policy]apply extcommunity rt 100:1 //设置BGP路由的扩展团体属性(Route-Target)
[Huawei-route-policy]apply ip-address next-hop 10.1.1.1 //设置路由的下一跳地址
[Huawei-route-policy]apply isis level-1 //设置IS-IS的路由级别
[Huawei-route-policy]apply local-preference 10 //设置BGP路由的本地优先级
[Huawei-route-policy]apply origin egp 1 //设置BGP路由的Origin属性
[Huawei-route-policy]apply origin igp
[Huawei-route-policy]apply origin incomplete
[Huawei-route-policy]apply ospf backbone //设置路由引入到OSPF的特定区域
[Huawei-route-policy]apply ospf stub-area
[Huawei-route-policy]apply preference 1 //设置路由协议的优先级
[Huawei-route-policy]apply preferred-value 1 //设置BGP路由的首选值
[Huawei-route-policy]apply tag 10 //设置路由的标记域
3. 应用Route-Policy命令
(1)rip应用Route-Policy的命令
[Huawei-rip-1]default-route originate route-policy a1 //rip中设备只有在符合指定Route-Policy时才生成缺省路由
[Huawei-rip-1]import-route bgp route-policy a1 //配置RIP从BGP协议引入路由时应用Route-Policy
[Huawei-rip-1]import-route ospf route-policy a1 //配置RIP从OSPF协议引入路由时应用Route-Policy
[Huawei-rip-1]import-route direct route-policy a1 //配置RIP从直连协议引入路由时应用Route-Policy
[Huawei-rip-1]preference 10 route-policy a1 //配置RIP路由通过route-policy对特定的路由设置优先级
(2)IS-IS应用Route-Policy的命令
[Huawei-isis-1]default-route-advertise route-policy a2 //当路由表存在满足Route-Policy的外部路由时才向IS-IS域发布缺省路由
[Huawei-isis-1]filter-policy route-policy a2 export //向外发布自己从其他路由协议引入的路时由应用Route-Policy
[Huawei-isis-1]filter-policy route-policy a2 import //对接收的路由应用Route-Policy
[Huawei-isis-1]import-route ospf route-policy a2 //引入其他路由协议的路由信息时应用Route-Policy
[Huawei-isis-1]import-route isis level-1 into level-2 filter-policy route-policy a2 //配置Level-1路由向Level-2区域渗透时应用Route-Policy
[Huawei-isis-1]import-route isis level-2 into level-1 filter-policy route-policy a2 //配置Level-2路由向Level-1区域渗透时应用Route-Policy
[Huawei-isis-1]preference route-policy a2 //配置IS-IS协议优先级时应用Route-Policy
(3)OSPF应用Route-Policy命令
[Huawei-ospf-1]default-route-advertise route-policy a3 //当路由表中有匹配的非OSPF产生的缺省路由表项时,按Route-Policy所配置的参数发布缺省路由
[Huawei-ospf-1]filter-policy route-policy a3 import //配置对OSPF接收的路由应用Route-Policy
[Huawei-ospf-1]import-route ospf route-policy a3 //配置对OSPF引入的路由应用Route-Policy
[Huawei-ospf-1]preference 10 route-policy a3 //配置OSPF协议路由的优先级时应用Route-Policy
[Huawei-ospf-1-area-0.0.0.0]filter route-policy a3 export //配置对区域内出方向的Type-3 LSA(Summary LSA)应用Route-Policy
[Huawei-ospf-1-area-0.0.0.0]filter route-policy a3 import //配置对区域内入方向的Type-3 LSA应用Route-Policy
(4)BGP应用Route-Policy命令
[Huawei]bgp 100
[Huawei-bgp]ipv4-family unicast
[Huawei-bgp-af-ipv4]aggregate 10.1.1.0 24 attribute-policy a1 detail-suppressed origin-policy a2 suppress-policy a3 //配置在BGP路由表中创建一条聚合路由时应用Route-Policy
[Huawei-bgp-af-ipv4]dampening route-policy a4 //配置BGP路由衰减时应用Route-Policy
[Huawei-bgp-af-ipv4]import-route ospf 1 route-policy a4 //配置BGP引入其他协议路由信息时应用Route-Policy
[Huawei-bgp-af-ipv4]network 10.1.1.0 24 route-policy a4 //配置BGP引入本地路由时应用Route-Policy
[Huawei-bgp-af-ipv4]nexthop recursive-lookup route-policy a4 //配置BGP路由按照Route-Policy来进行下一跳迭代
[Huawei-bgp-af-ipv4]peer 10.1.1.1 default-route-advertise route-policy a4 //向对等体发送缺省路由时应用Route-Policy
[Huawei-bgp-af-ipv4]peer 10.1.1.1 route-policy a4 import //配置为来自对等体的路由指定Route-Policy,对接收的路由进行控制
[Huawei-bgp-af-ipv4]peer 10.1.1.1 route-policy a4 export //配置为来自对等体的路由发布的路由指定Route-Policy,对发布的路由进行控制
[Huawei-bgp-af-ipv4]preference route-policy a4 //配置按照Route-Policy设置BGP协议优先级
(5)组播应用Route-Policy命令
[Huawei]ip rpf-route-static 10.1.1.1 24 route-policy a5 GigabitEthernet 0/0/1 //通过指定route-policy参数配置组播静态路由的匹配规则
(6)BGP/MPLS IP VPN应用Route-Policy命令
[Huawei]ip vpn-instance 1
[Huawei-vpn-instance-1]export route-policy a5 //配置将当前VPN实例相应地址族与一条出方向Route-Policy进行关联
[Huawei-vpn-instance-1]import route-policy a5 //将当前VPN实例相应地址族与一条入方向Route-Policy进行关联
(7)[Huawei]display route-policy //查看路由策略的详细配置信息
(三)配置Filter-Policy命令
1. 对接收的路由应用路由过滤器命令
(1)配置RIP对接收的路由进行过滤
[Huawei-rip-1]filter-policy 2000 import //基于ACL过滤学到的路由信息
[Huawei-rip-1]filter-policy gateway a1 import //基于目的地址前缀过滤邻居发布的路由信息
[Huawei-rip-1]filter-policy ip-prefix a2 import //基于目的地址前缀的过滤
(2)配置OSPF对接收的路由进行过滤, 对OSPF计算出来的路由进行过滤,不能对发布和接收的LSA进行过滤,只有通过过滤的路由才被添加到路由表中,没有通过过滤的路由不会被添加进OSPF路由表,但不影响对外发布出去
[Huawei-ospf-1]filter-policy 2000 import
[Huawei-ospf-1]filter-policy ip-prefix a1 import
[Huawei-ospf-1]filter-policy route-policy a2 import
(3)配置IS-IS对接收的路由进行过滤
[Huawei-isis-1]filter-policy 2000 import
[Huawei-isis-1]filter-policy ip-prefix a1 import
[Huawei-isis-1]filter-policy route-policy a2 import
(4)控制BGP从全局接收路由
[Huawei]bgp 100
[Huawei-bgp]ipv4-family unicast
[Huawei-bgp-af-ipv4]filter-policy 2000 import
(5)控制BGP从特定对等体接收路由
[Huawei-bgp-af-ipv4]peer 10.1.1.1 filter-policy 2000 import //基于访问控制列表ACL
[Huawei-bgp-af-ipv4]peer 10.1.1.1 ip-prefix a1 import //基于前缀列表
[Huawei-bgp-af-ipv4]peer 10.1.1.1 as-path-filter a2 import //基于AS路径过滤器
[Huawei-bgp-af-ipv4]peer 10.1.1.1 route-policy a3 import //基于Route-Policy
[Huawei-bgp-af-ipv4]peer 10.1.1.1 route-limit 1 //设置允许从对等体收到的路由数量
2. 对发布的路由应用路由过滤器
(1)配置RIP对发布的路由进行过滤
[Huawei-rip-1]filter-policy 2000 export //基于ACL对引入的路由信息向外发布时进行过滤
[Huawei-rip-1]filter-policy gateway a1 export //基于目的地址前缀对引入的路由信息向外发布时进行过滤
[Huawei-rip-1]filter-policy ip-prefix a2 export //基于目的地址前缀对引入的路由信息向外发布时进行过滤
(2)配置OSPF对发布的路由进行过滤: import-route命令不能引入外部路由的缺省路由;OSPF对引入的路由进行过滤,是指OSPF只将满足条件的外部路由生成的Type5 LSA发布出去
[Huawei-ospf-1]filter-policy 2000 export eximport
[Huawei-ospf-1]filter-policy route-policy a2 export
(3)配置IS-IS对接收的路由进行过滤
[Huawei-isis-1]filter-policy 2000 export
[Huawei-isis-1]filter-policy ip-prefix a1 export
[Huawei-isis-1]filter-policy route-policy a2 export
(4)控制BGP从全局接收路由
[Huawei]bgp 100
[Huawei-bgp]ipv4-family unicast
[Huawei-bgp-af-ipv4]filter-policy 2000 export
(5)控制BGP从特定对等体接收路由
[Huawei-bgp-af-ipv4]peer 10.1.1.1 filter-policy 2000 export //基于访问控制列表ACL
[Huawei-bgp-af-ipv4]peer 10.1.1.1 ip-prefix a1 export //基于前缀列表
[Huawei-bgp-af-ipv4]peer 10.1.1.1 as-path-filter a2 export //基于AS路径过滤器
[Huawei-bgp-af-ipv4]peer 10.1.1.1 route-policy a3 export //基于Route-Policy
(四)配置路由策略生效时间
[Huawei]route-policy-change notify-delay 1 //设置路由策略应用延迟时间,范围是1秒~180秒
(五)清除地址前缀列表统计数据
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~