Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> 電腦軟體教學 >> 網路工具

Cisco 策略路由(PBR)配置實例:依來源 IP 指定下一跳

編輯:網路工具

概念說明

Policy-Based Routing (PBR) 允許根據來源位址、應用類型等條件,修改封包的下一跳位址或標記 QoS 優先權,而非單純依目的地路由表轉送。

建議做法:使用 PBR 為外發封包標記 IP Precedence,配合 QoS 原則實現流量優先級控制。

配置範例

需求:

  • 來源 192.168.1.0/24 → 下一跳 192.168.100.1
  • 來源 192.168.2.0/24 → 下一跳 192.168.100.2
  • 其他來源 → 正常路由

指令腳本

access-list 10 permit 192.168.1.0
access-list 20 permit 192.168.2.0
!
interface Ethernet0
 ip policy route-map nexthop
!
route-map nexthop permit 10
 match ip address 10
 set ip next-hop 192.168.100.1
!
route-map nexthop permit 20
 match ip address 20
 set ip next-hop 192.168.100.2
!
route-map nexthop permit 30
! 順序 30 無 set 動作,符合者走正常路由

關鍵點

  • route-map 依序號處理,permit 30 作為預設動作(不修改下一跳)。
  • PBR 僅影響進入介面的封包,需在 interface 下綁定 ip policy route-map。
  • 搭配 set ip precedence 可標記 QoS 優先權。
Copyright © Windows教程網 All Rights Reserved