• 全部
  • 經驗案例
  • 典型配置
  • 技術公告
  • FAQ
  • 漏洞說明
  • 全部
  • 全部
  • 大數據引擎
  • 知了引擎
產品線
搜索
取消
案例類型
發布者
是否解決
是否官方
時間
搜索引擎
匹配模式
高級搜索

交換機二層端口引流案列

2025-03-05提問
  • 0關注
  • 0收藏,553瀏覽
粉絲:5人 關注:4人

問題描述:

求一份案例,核心交換機下掛幾個接入交換機,旁掛一個web防火牆,上行出口接一個路由器。現在不改變原有網絡架構的情況,把接入交換機的流量引到web防火牆處理,web防火牆和交換機是二層部署,接口為trunk類型,允許所有vlan通過

最佳答案

粉絲:104人 關注:0人

您好,參考案例


組網及說明


如圖,交換機的int vlan 10和防火牆的RAGG1.10處於同一網段,交換機的int vlan20、路由器的GE0/0以及防火牆的RAGG1.20處於同一網段。  

現在客戶需要實現如下需求:防火牆工作正常的時候,終端前往邊界路由器的流量需要經過防火牆,但是當防火牆異常的時候,流量直接從交換機轉發給防火牆。

在交換機和路由器上通過配置靜態路由結合track NQA,使防火牆正常的時候路由指向防火牆,當防火牆出問題後,路由不再指向防火牆,直接在交換機轉發。

配置步驟

防火牆配置:

interface Route-Aggregation1.10

 ip address 192.168.10.1 255.255.255.0

 vlan-type dot1q vid 10

#

interface Route-Aggregation1.20

 ip address 192.168.20.1 255.255.255.0

 vlan-type dot1q vid 20

#

interface GigabitEthernet1/0/0

 port link-mode route

 port link-aggregation group 1

#

interface GigabitEthernet1/0/1

 port link-mode route

 port link-aggregation group 1

#

security-zone name Trust

 import interface Route-Aggregation1.10

#

security-zone name Untrust

 import interface Route-Aggregation1.20

#

 ip route-static 0.0.0.0 0 192.168.20.3

 ip route-static 192.168.100.0 24 192.168.10.2

#

security-policy ip

 rule 0 name permit-all

  action pass

  source-zone untrust

  source-zone trust

  source-zone local

  destination-zone untrust

  destination-zone trust

  destination-zone local


交換機配置

track 1 nqa entry fw 1 reaction 1 //track nqa狀態

#

nqa entry fw 1    //配置nqa,探測10.1是否可達,頻率1秒(100厘秒),探測三次

 type icmp-echo

  destination ip 192.168.10.1

  frequency 100

  reaction 1 checked-element probe-fail threshold-type consecutive 3 action-type trigger-only

#

 nqa schedule fw 1 start-time now lifetime forever  //開啟nqa探測

#

interface Bridge-Aggregation1

 port link-type trunk

 port trunk permit vlan 1 10 20

#

interface Vlan-interface10

 ip address 192.168.10.2 255.255.255.0

#

interface Vlan-interface20

 ip address 192.168.20.2 255.255.255.0

#

interface Vlan-interface100

 ip address 192.168.100.1 255.255.255.0

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 10 20

 port link-aggregation group 1

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 10 20

 port link-aggregation group 1

#

 ip route-static 0.0.0.0 0 192.168.10.1 track 1   //配置靜態路由指向防火牆並調用track,當nqa探測失敗的時候自動失效

 ip route-static 0.0.0.0 0 192.168.20.3 preference 70   //配置浮動路由指向路由器,當上麵的靜態路由失效的時候生效


路由器配置

track 1 nqa entry fw 1 reaction 1 //track nqa狀態

#

nqa entry fw 1    //配置nqa,探測20.1是否可達,頻率1秒(100厘秒),探測三次

 type icmp-echo

  destination ip 192.168.20.1

  frequency 100

  reaction 1 checked-element probe-fail threshold-type consecutive 3 action-type trigger-only

#

 nqa schedule fw 1 start-time now lifetime forever   //開啟nqa探測

#

interface LoopBack0   //模擬的外網地址

 ip address 100.100.100.100 255.255.255.255

#

interface GigabitEthernet0/0

 port link-mode route

 ip address 192.168.20.3 255.255.255.0

#

 ip route-static 192.168.100.0 24 192.168.20.1 track 1  //配置靜態路由指向防火牆並調用track,當nqa探測失敗的時候自動失效

 ip route-static 192.168.100.0 24 192.168.20.2 preference 70   //配置浮動路由指向交換機,當上麵的靜態路由失效的時候生效


測試結果

正常情況下的交換機路由表

[SW]dis ip ro

 

Destinations : 21       Routes : 21

 

Destination/Mask   Proto   Pre Cost        NextHop         Interface

0.0.0.0/0          Static  60  0           192.168.10.1    Vlan10

......

正常情況下的路由器路由表

[RT]dis ip ro

 

Destinations : 14       Routes : 14

 

Destination/Mask   Proto   Pre Cost        NextHop         Interface

......

192.168.100.0/24   Static  60  0           192.168.20.1    GE0/0

......

PC(192.168.100.2)測試訪問100.100.100.100

[PC]ping 100.100.100.100

Ping 100.100.100.100 (100.100.100.100): 56 data bytes, press CTRL_C to break

56 bytes from 100.100.100.100: icmp_seq=0 ttl=253 time=3.000 ms

56 bytes from 100.100.100.100: icmp_seq=1 ttl=253 time=3.000 ms

56 bytes from 100.100.100.100: icmp_seq=2 ttl=253 time=3.000 ms

56 bytes from 100.100.100.100: icmp_seq=3 ttl=253 time=2.000 ms

56 bytes from 100.100.100.100: icmp_seq=4 ttl=253 time=4.000 ms

 

--- Ping statistics for 100.100.100.100 ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 2.000/3.000/4.000/0.632 ms

此時防火牆能夠看到會話,說明流量經過防火牆

[FW]dis session table ipv4 source-ip 192.168.100.2 destination-ip 100.100.100.100 verbose

Slot 1:

Initiator:

  Source      IP/port: 192.168.100.2/225

  Destination IP/port: 100.100.100.100/2048

  DS-Lite tunnel peer: -

  VPN instance/VLAN ID/Inline ID: -/-/-

  Protocol: ICMP(1)

  Inbound interface: Route-Aggregation1.10

  Source security zone: Trust

Responder:

  Source      IP/port: 100.100.100.100/225

  Destination IP/port: 192.168.100.2/0

  DS-Lite tunnel peer: -

  VPN instance/VLAN ID/Inline ID: -/-/-

  Protocol: ICMP(1)

  Inbound interface: Route-Aggregation1.20

  Source security zone: Untrust

State: ICMP_REPLY

Application: ICMP

Rule ID: 0

Rule name: permit-all

Start time: 2020-04-30 03:10:17  TTL: 26s

Initiator->Responder:            0 packets          0 bytes

Responder->Initiator:            0 packets          0 bytes

 

Total sessions found: 1


當防火牆故障的時候,track使靜態路由失效

%Apr 30 03:25:36:153 2020 SW NQA/6/NQA_ENTRY_PROBE_RESULT: Reaction entry 1 of NQA entry admin-name fw operation-tag 1: probe-fail.

dis track 1

Track ID: 1

  State: Negative

  Duration: 0 days 0 hours 0 minutes 15 seconds

  Tracked object type: NQA

  Notification delay: Positive 0, Negative 0 (in seconds)

  Tracked object:

    NQA entry: fw 1

    Reaction: 1

    Remote IP/URL: 192.168.10.1                                               

    Local IP: --                                                          

    Interface: --

%Apr 30 03:25:41:279 2020 RT NQA/6/NQA_ENTRY_PROBE_RESULT: Reaction entry 1 of NQA entry admin-name fw operation-tag 1: probe-fail.

dis track 1

Track ID: 1

  State: Negative

  Duration: 0 days 0 hours 2 minutes 43 seconds

  Tracked object type: NQA

  Notification delay: Positive 0, Negative 0 (in seconds)

  Tracked object:

    NQA entry: fw 1

    Reaction: 1

    Remote IP/URL: 192.168.20.1                                               

    Local IP: --                                                          

    Interface: --

此時看靜態路由,發現SW、RT的路由已切換不走防火牆

dis ip ro

 

Destinations : 21       Routes : 21

 

Destination/Mask   Proto   Pre Cost        NextHop         Interface

0.0.0.0/0          Static  70  0           192.168.20.3    Vlan20

......

dis ip ro

 

Destinations : 14       Routes : 14

 

......

192.168.100.0/24   Static  70  0           192.168.20.2    GE0/0

......

PC仍然能夠ping通100.100.100.100

ping 100.100.100.100

Ping 100.100.100.100 (100.100.100.100): 56 data bytes, press CTRL_C to break

56 bytes from 100.100.100.100: icmp_seq=0 ttl=254 time=2.000 ms

56 bytes from 100.100.100.100: icmp_seq=1 ttl=254 time=1.000 ms

56 bytes from 100.100.100.100: icmp_seq=2 ttl=254 time=1.000 ms

56 bytes from 100.100.100.100: icmp_seq=3 ttl=254 time=1.000 ms

56 bytes from 100.100.100.100: icmp_seq=4 ttl=254 time=2.000 ms

 

--- Ping statistics for 100.100.100.100 ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 1.000/1.400/2.000/0.490 ms

此時由於流量不經過防火牆,防火牆上沒有會話

[FW-Route-Aggregation1.10]dis session table ipv4 source-ip 192.168.100.2 destination-ip 100.100.100.100 verbose

Slot 1:

Total sessions found: 0


暫無評論

1 個回答

你是WAF防火牆嗎?

那你用的位置都不對,旁掛沒什麼用


暫無評論

編輯答案

你正在編輯答案

如果你要對問題或其他回答進行點評或詢問,請使用評論功能。

分享擴散:

提出建議

    +

親~登錄後才可以操作哦!

確定

親~檢測到您登陸的賬號未在http://hclhub.h3c.com進行注冊

注冊後可訪問此模塊

跳轉hclhub

你的郵箱還未認證,請認證郵箱或綁定手機後進行當前操作

舉報

×

侵犯我的權益 >
對根叔社區有害的內容 >
辱罵、歧視、挑釁等(不友善)

侵犯我的權益

×

泄露了我的隱私 >
侵犯了我企業的權益 >
抄襲了我的內容 >
誹謗我 >
辱罵、歧視、挑釁等(不友善)
騷擾我

泄露了我的隱私

×

您好,當您發現根叔知了上有泄漏您隱私的內容時,您可以向根叔知了進行舉報。 請您把以下內容通過郵件發送到pub.zhiliao@h3c.com 郵箱,我們會盡快處理。
  • 1. 您認為哪些內容泄露了您的隱私?(請在郵件中列出您舉報的內容、鏈接地址,並給出簡短的說明)
  • 2. 您是誰?(身份證明材料,可以是身份證或護照等證件)

侵犯了我企業的權益

×

您好,當您發現根叔知了上有關於您企業的造謠與誹謗、商業侵權等內容時,您可以向根叔知了進行舉報。 請您把以下內容通過郵件發送到 pub.zhiliao@h3c.com 郵箱,我們會在審核後盡快給您答複。
  • 1. 您舉報的內容是什麼?(請在郵件中列出您舉報的內容和鏈接地址)
  • 2. 您是誰?(身份證明材料,可以是身份證或護照等證件)
  • 3. 是哪家企業?(營業執照,單位登記證明等證件)
  • 4. 您與該企業的關係是?(您是企業法人或被授權人,需提供企業委托授權書)
我們認為知名企業應該坦然接受公眾討論,對於答案中不準確的部分,我們歡迎您以正式或非正式身份在根叔知了上進行澄清。

抄襲了我的內容

×

原文鏈接或出處

誹謗我

×

您好,當您發現根叔知了上有誹謗您的內容時,您可以向根叔知了進行舉報。 請您把以下內容通過郵件發送到pub.zhiliao@h3c.com 郵箱,我們會盡快處理。
  • 1. 您舉報的內容以及侵犯了您什麼權益?(請在郵件中列出您舉報的內容、鏈接地址,並給出簡短的說明)
  • 2. 您是誰?(身份證明材料,可以是身份證或護照等證件)
我們認為知名企業應該坦然接受公眾討論,對於答案中不準確的部分,我們歡迎您以正式或非正式身份在根叔知了上進行澄清。

對根叔社區有害的內容

×

垃圾廣告信息
色情、暴力、血腥等違反法律法規的內容
政治敏感
不規範轉載 >
辱罵、歧視、挑釁等(不友善)
騷擾我
誘導投票

不規範轉載

×

舉報說明