交換機型號:
Slot Type State Subslot Soft Ver Patch Ver
1 S5130S-28S-EI Master 0 S5130S-28S-EI6113 None
配置
# 目的 想要把10.2.9.0/24的外網流量重定向到1分廠的出口路由器,內網流量不重定向
#一分廠的路由表已經配置好了。把默認路由改成:
#ip route-static0.0.0.0 0 10.255.255.2 description **一分廠 **
#流量是按照預期從一分廠走的。
#現在想單獨把 10.2.9.0/24的外網流量重定向到1分廠的出口路由器,內網流量不重定向,配置如下:
acl advanced 3003
rule 15 deny ip source 10.2.9.0 0.0.0.255 destination 10.2.2.0 0.0.0.255
rule 20 deny ip source 10.2.9.0 0.0.0.255 destination 10.2.3.0 0.0.0.255
rule 25 deny ip source 10.2.9.0 0.0.0.255 destination 10.2.4.0 0.0.0.255
rule 30 deny ip source 10.2.9.0 0.0.0.255 destination 10.2.5.0 0.0.0.255
rule 35 deny ip source 10.2.9.0 0.0.0.255 destination 10.2.6.0 0.0.0.255
rule 40 deny ip source 10.2.9.0 0.0.0.255 destination 10.2.7.0 0.0.0.255
rule 45 deny ip source 10.2.9.0 0.0.0.255 destination 10.2.8.0 0.0.0.255
rule 50 permit ip source 10.2.9.0 0.0.0.255
#
traffic classifier test operator and
if-match acl 3003
#
traffic behavior test
redirect interface Ten-GigabitEthernet1/0/28 # 一分廠互聯接口
#
qos policy test
classifier test behavior test
vlan 4000
vlan 2009
interface Vlan-interface2009
ip address 10.2.9.1 255.255.255.0
interface Vlan-interface4000
ip address 10.255.255.1 255.255.255.254
interface Ten-GigabitEthernet1/0/28
description To_yifenchang_HuLian
port access vlan 4000
interface GigabitEthernet1/0/12
port access vlan 2009
stp edged-port
qos apply policy test inbound
ip route-static 0.0.0.0 0 10.2.2.1 description ** 外網 **
ip route-static 10.1.0.0 16 10.255.255.2 description **一分廠 **
現象:
10.2.9.0/24的外網流量沒有按照預期走一分廠。
配置方向qos apply policy test inbound 時候,pc 10.2.9.2 ping不通10.2.9.1.
配置方向qos apply policy test outbound 時候,pc 10.2.9.2 的流量沒有被重定向。
想請教下,問題出在哪裏了?什麼命令可以查看重定向的流量有沒有走interface Ten-GigabitEthernet1/0/28口?
(0)
最佳答案
根據您的需求,需要將10.2.9.0/24的外網流量重定向到一分廠出口路由器,同時放行內網流量。建議如下配置方案:
acl advanced 3003
rule 10 deny ip source 10.2.9.0 0.0.0.255 destination 10.0.0.0 0.255.255.255 # 拒絕所有10.x內網
rule 15 deny ip source 10.2.9.0 0.0.0.255 destination 172.16.0.0 0.15.255.255 # 拒絕172.16-31.x
rule 20 deny ip source 10.2.9.0 0.0.0.255 destination 192.168.0.0 0.0.255.255 # 拒絕192.168.x
rule 1000 permit ip source 10.2.9.0 0.0.0.255 # 允許剩餘的外網流量
配置說明:
1. 前三條規則拒絕發往私有地址段(10.0.0.0/8、172.16.0.0/12、192.168.0.0/16)的流量
2. 最後一條規則允許所有其他外網流量
3. 通配符掩碼已修正:10.0.0.0/8對應0.255.255.255,不是0.0.0.255
4. 需要關聯策略路由實現重定向:
policy-based-route PBR permit node 10
if-match acl 3003
apply next-hop 10.255.255.2
interface GigabitEthernetX/X/X
ip policy-based-route PBR
注:實際生效需要保證策略路由的優先級高於默認路由,且需在流量入口接口應用策略。
(0)
感謝! 設備不支持PBR ,所以采用了qos。您提到 “需要保證策略路由的優先級高於默認路由” 這個應該怎麼做?需要怎麼寫路由?
親~登錄後才可以操作哦!
確定你的郵箱還未認證,請認證郵箱或綁定手機後進行當前操作
舉報
×
侵犯我的權益
×
侵犯了我企業的權益
×
抄襲了我的內容
×
原文鏈接或出處
誹謗我
×
對根叔社區有害的內容
×
不規範轉載
×
舉報說明
感謝! 設備不支持PBR ,所以采用了qos。您提到 “需要保證策略路由的優先級高於默認路由” 這個應該怎麼做?需要怎麼寫路由?