Cisco ASA防火墙PBR策略路由配置

1 FAQ

1.1 什么是PBR

全称policy-base routing (策略路由)

官方解释 :
PBR is an alternative to routing protocols and allows you to configure a policy for unicast traffic flows,
which provides more control over routing than a routing protocol does and avoids the need to configure
interface-level traffic classification. PBR can route unicast traffic along a different path than a routing
protocol would use. PBR can provide:
• Equal access
• Protocol-sensitive routing
• Source-sensitive routing
• Routing based on interactive rather than batch traffic
简单来说就是数据包按我们指定的下一跳转发,比路由表优先。
算是特权吗? yeah,特权

1.2 PBR能用于组播流量吗?

不能用于组播,只能用于单播流量。

1.3 PBR能调用在出向接口吗?

不能。 只能调用在入向接口

1.4 PBR能对交换机本地始发的流量生效吗?

可以。需要指定全局调用

1.5 PBR有啥缺点吗?

缺点那是一大堆。随便举2个

  • CPU消耗大
  • 不利于排错(排错时会因为有pbr而造成困扰,“你个球的不按套路出牌“)

2 配置步骤

2.1 创建ACL匹配流量

2.2 创建route-map,调用ACL,设置下一跳

2.3 接口下调用route-map

3 配置实例

3.1 define acl

access-list PBR-ACL extended permit ip host 192.168.1.2 any

3.2 define route-map

route-map PBR permit 10 
match ip address PBR-ACL <-- Specify the generated Access-List 
set ip next-hop 192.168.2.252 <-- Specify next-hop (IP of Router2)

3.3 apply to interface


interface GigabitEthernet0/0 

policy-route route-map PBR <-- Apply route-map to incoming Interface

验证命令

asav# show policy-route        <-- Check the presence of PBR (Set Route-map PBR on Interface GigabitEthernet0/0) 

Interface Route map 

GigabitEthernet0/0 PBR 

 

 

asav# show route-map           <-- Check Route-map (PBR-ACL Specify Next-hop 192.6.2.252) 

route-map PBR, permit, sequence 10 

  Match clauses: 

    ip address (access-lists): PBR-ACL 

 

  Set clauses: 

    ip next-hop 192.168.2.252 

 

 

asav# show access- list PBR-ACL      <-- Confirm packets matching PBR-ACL 

access-list PBR-ACL; 1 elements; name hash: 0x9e175fdb 

access-list PBR-ACL line 1 extended permit ip host 192.168.1.2  any (hitcnt =5) 0xddb23923

 

可以参考文档:
https://www.cisco.com/c/ja_jp/td/docs/security/asa/asa914/configuration/general/asa-914-general-config/route-policy-based.html

 

 

 
### 华为交换机PBR策略路由配置方法 #### 1. 基本概念 PBR (Policy-Based Routing),即基于策略路由,在华为设备上的应用主要针对本地始发流量,而非接口转发流量。对于某些特定型号的支持情况有所不同,如果实验效果不符合预期,则建议考虑使用MQC(模块化QoS命令行)作为替代方案[^1]。 #### 2. 配置流程概述 为了实现有效的PBR功能,通常需要定义分类器(Classifier)用于匹配符合条件的数据包;同时也要设定相应的行为(Behavior),比如指定新的下一跳地址或出口接口等操作。最后一步则是创建并关联流策略(Traffic Policy),将其应用于全局模式下或是具体端口之上[^3]。 #### 3. 实际案例展示 下面给出一段具体的配置实例: ```shell [HUAWEI] policy-based-route pbr_example permit node 10 [HUAWEI-pbr-10] if-match acl 3000 [HUAWEI-pbr-pbr_example-10] apply next-hop 192.168.1.1 [HUAWEI-pbr-pbr_example-10] quit [HUAWEI] traffic-policy pbr_policy outbound interface GigabitEthernet0/0/1 inbound [HUAWEI-interface-GigabitEthernet0/0/1] packet-filter acl_number 3000 inbound ``` 上述代码片段展示了如何设置一个名为`pbr_example` 的PBR节点,并通过ACL编号`3000` 来筛选目标数据包,进而改变其下一跳至 `192.168.1.1`. 此外还涉及到将此规则绑定到GE0/0/1 接口上生效的过程[^2]. 需要注意的是当所指派的新路径不可达时可能会造成所谓的“黑洞现象”,因此推荐利用Track NQA机制来进行连通性监测以提高系统的稳定性与可靠性[^4].
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值