03-Context配置
本章節下載: 03-Context配置 (465.33 KB)
通過虛擬化技術將一台物理設備劃分成多台邏輯設備,每台邏輯設備就稱為一個Context。每個Context擁有自己專屬的軟硬件資源,獨立運行。
對於用戶來說,每個Context就是一台獨立的設備,方便管理和維護;對於管理者來說,可以將一台物理設備虛擬成多台邏輯設備供不同的分支機構使用,可以保護現有投資,提高組網靈活性。
如圖1-1所示,LAN 1、LAN 2和LAN 3是三個不同的局域網,它們通過同一台設備Device連接到外網。通過虛擬化技術,能讓一台設備當三台設備使用。具體做法是,在Device上創建三個Context(Context 1、Context 2、Context 3),分別負責LAN 1、LAN 2、LAN 3的安全接入。LAN 1、LAN 2、LAN 3的網絡管理員可以(也隻能)分別登錄到自己的設備進行配置、保存、重啟等操作,不會影響其它網絡的使用,其效果等同於LAN 1、LAN 2和LAN 3分別通過各自的設備Device 1、Device 2、Device 3接入Internet。
圖1-1 Context組網示意圖
· 設備支持Context功能後,整台物理設備就是一個Context,稱為缺省Context,如圖1-1中的Device。當用戶登錄物理設備時,實際登錄的就是缺省Context。用戶在物理設備上的配置實質就是對缺省Context的配置。缺省Context的名稱為Admin,編號為1。缺省Context不需要創建,不能刪除。
· 與缺省Context相對應的是非缺省Context,如圖1-1中的Context 1、Context 2、Context 3。非缺省Context是管理員在設備上通過命令行創建的,可分配給不同的接入網絡使用。
· 缺省Context擁有對整台物理設備的所有權限,它可以使用和管理設備所有的資源。缺省Context下可以創建/刪除非缺省Context,給非缺省Context分配CPU資源/磁盤/內存空間、接口、VLAN,沒有分配的CPU資源/磁盤/內存空間、接口、VLAN由缺省Context使用和管理。
· 非缺省Context下不可再創建/刪除非缺省Context,它隻能使用缺省Context分配給自己的資源,並在缺省Context指定的資源限製範圍內工作,不能搶占其他Context或者係統剩餘的資源。
· 非缺省Context下不支持共享口的報文捕獲功能,關於報文捕獲功能的詳細描述請參見“網絡管理和監控配置指導”中的“報文捕獲配置”。
本特性的支持情況與設備型號有關,請以設備的實際情況為準。
係列 |
型號 |
說明 |
F50X0係列 |
F5010、F5020、F5020-GM、F5030、F5030-6GW、F5030-6GW-G、F5040、F5060、F5080、F5000-A、F5000-C、F5000-S、F5000-M |
支持 |
F5000-CN係列 |
F5000-CN30、F5000-CN60 |
支持 |
F5000-AI係列 |
F5000-AI-15、F5000-AI-20、F5000-AI-40 |
支持 |
F5000-V係列 |
F5000-V30 |
支持 |
F1000-AI係列 |
F1000-AI-03、F1000-AI-05、F1000-AI-10、F1000-AI-15 |
不支持 |
F1000-AI-20、F1000-AI-25、F1000-AI-30、F1000-AI-35、F1000-AI-50、F1000-AI-55、F1000-AI-60、F1000-AI-65、F1000-AI-70、F1000-AI-75、F1000-AI-80、F1000-AI-90 |
支持 |
|
F1000-L係列 |
F1003-L、F1003-L-C、F1003-L-S、F1005-L、F1010-L |
不支持 |
F10X0係列 |
F1003-C、F1003-M、F1003-S、F1005、F1005-GM、F1010、F1010-GM |
不支持 |
F1020、F1020-GM、F1030、F1030-GM、F1050、F1060、F1070、F1070-GM、F1070-GM-L、F1080、F1090 |
支持 |
|
F1000-V係列 |
F1000-V50、F1000-V60、F1000-V70、F1000-V90 |
支持 |
F1000-SASE係列 |
F1000-SASE100 、F1000-SASE200 |
不支持 |
F1000-AK係列 |
F1000-AK108、F1000-AK109、F1000-AK110、F1000-AK115、F1000-AK120、F1000-AK125、F1000-AK710、F1000-AK1010、F1000-AK1015、F1000-AK1020、F1000-AK1025、F1000-AK1030、F1000-AK1105、F1000-AK1110、F1000-AK1115、F1000-AK1120、F1000-AK1130、F1000-AK1140、F1000-AK1150、F1000-AK1160、F1000-AK1170、F1000-AK1180、F1000-AK9109、F1000-AK9110、F1000-AK9120、F1000-AK9210、F1000-AK9150 |
不支持 |
F1000-AK130、F1000-AK135、F1000-AK140、F1000-AK145、F1000-AK150、F1000-AK155、F1000-AK160、F1000-AK165、F1000-AK170、F1000-AK175、F1000-AK180、F1000-AK185、F1000-GM-AK370、F1000-GM-AK380、F1000-AK711、F1000-AK1125、F1000-AK1205、F1000-AK1212、F1000-AK1215、F1000-AK1222、F1000-AK1232、F1000-AK1235、F1000-AK1242、F1000-AK1252、F1000-AK1262、F1000-AK1272、F1000-AK1305、F1000-AK1312、F1000-AK1315、F1000-AK1322、F1000-AK1332、F1000-AK1342、F1000-AK1352、F1000-AK1362、F1000-AK1414、F1000-AK1424、F1000-AK1434、F1000-AK1505、F1000-AK1514、F1000-AK1515、F1000-AK1524、F1000-AK1534、F1000-AK1614、F1000-AK9160、F1000-AK9180、F1000-AK9190 |
支持 |
|
插卡 |
IM-NGFWX-IV、LSCM1FWDSD0、LSCM2FWDSD0、LSPM6FWD、LSPM6FWDB、LSQM1FWDSC0、LSQM2FWDSC0、LSU3FWCEA0、LSUM1FWCEAB0、LSUM1FWDEC0、LSWM1FWD0、LSX1FWCEA1、LSXM1FWDF1 |
支持 |
vFW係列 |
vFW1000、vFW2000、vFW-E-Cloud |
不支持 |
對於本文列出的命令,缺省Context均支持,非缺省Context隻支持display context interface、display context reboot、reset context reboot命令。
非缺省Context中的DPI業務功能使用缺省Context中的應用層檢測引擎對報文進行匹配,當創建、刪除、關閉和重啟非缺省Context時,缺省Context中的應用層檢測引擎會重新激活,激活期間設備上的所有Context均不能對報文進行DPI業務處理。
Context配置任務如下:
(1) 創建Context
(2) (可選)為Context分配接口和VLAN資源
(3) (可選)限製Context的資源使用
(4) 啟動Context
(5) (可選)為Context分配CPU/磁盤/內存資源
(6) 訪問和管理Context
(7) (可選)配置Context限速功能
(8) (可選)配置CPU核的攻擊防範閾值
(9) (可選)收集各Context的日誌信息
(10) (可選)配置Context支持跨VPC流量互通
創建Context相當於構造了一台新的設備。
創建Context時,通過vlan-unshared參數可選擇是否和其它Context共享VLAN:
· 如果選擇和其它Context共享VLAN,需要在缺省Context內創建並配置VLAN,再分配給非缺省Context。共享VLAN由多個Context共同所有。VLAN 1為係統缺省VLAN,由缺省Context獨有,不能分配給非缺省Context。此種方式的非缺省Context不支持將以太網接口切換為二層模式,也不支持將二層以太網接口獨占方式分配給此種非缺省Context。
· 如果選擇不和其它Context共享VLAN,請登錄該Context,並使用vlan命令創建VLAN 2~VLAN 4094。VLAN 1為缺省VLAN,用戶不能手工創建和刪除。Context各自使用和管理VLAN,互不幹擾。
(1) 進入係統視圖。
system-view
(2) 創建Context,並進入Context視圖。
context context-name [ id context-id ] [ vlan-unshared ]
缺省情況下,設備上存在缺省Context,名稱為Admin,編號為1。
(3) (可選)配置Context的描述信息。
description text
缺省情況下,缺省Context描述信息為DefaultContext。非缺省Context沒有配置描述信息。
設備上的所有接口都屬於缺省Context,不屬於任何非缺省Context。請給非缺省Context分配接口,它才能和網絡中的其它設備通信。
為了提高設備接口的利用率,在給Context分配接口時,可以選擇:
· 獨占方式分配(不帶share參數)。使用該方式分配的接口僅歸該Context所有、使用。用戶登錄該Context後,能查看到該接口,並執行接口支持的所有命令。
· 共享方式分配(帶share參數):表示將一個接口分配給多個Context使用,這些Context共享這個物理接口,但是在各個Context內會創建一個同名的虛接口,這些虛接口具有不同的MAC地址和IP地址。設備從共享的物理接口接收報文後交給對應的虛擬接口處理;出方向,虛擬接口處理完報文後,會交給共享的物理接口發送。使用該方式,可以提高設備接口的利用率。通過共享方式分配的接口:
¡ 在缺省Context內仍然存在該接口,該接口可執行接口支持的所有命令;
¡ 在非缺省Context內,會新建一個同名接口,用戶登錄這些Context後,能查看到該接口,但隻能執行description以及網絡/安全相關的命令。
當設備運行在IRF模式時,禁止將IRF物理端口分配給Context。
聚合接口的成員接口不能分配給Context。
冗餘口的成員接口不能分配給Context,當冗餘口的成員接口為子接口時,其子接口的主接口也不能分配給Context。
邏輯接口(如子接口、聚合接口等)僅支持共享方式分配,物理接口支持獨占和共享兩種方式分配。
如果子接口已經被分配,則不能再分配其父接口;如果父接口已經被分配,則不能再分配其子接口。
如果接口已經被共享分配,則不能再獨占分配。需將共享分配配置取消後,才能獨占分配。
為使非缺省Context之間可以互通,必須在缺省Context中將物理接口或邏輯接口以共享方式分配給非缺省Context。
(1) 進入係統視圖。
system-view
(2) 進入Context視圖。
context context-name
(3) 為Context分配接口。
¡ 非連續接口配置。
allocate interface { interface-type interface-number }&<1-24> [ share ]
¡ 連續接口配置。
allocate interface interface-type interface-number1 to interface-type interface-number2 [ share ]
缺省情況下,設備上的所有接口都屬於缺省Context,不屬於任何非缺省Context。
創建Context時,如果不選擇vlan-unshared參數,則表示和其它Context共享VLAN。
對於共享VLAN,請先在缺省Context內創建VLAN,再通過allocate vlan命令將指定VLAN分配給指定的Context使用。
VLAN 1不能被共享。
端口的缺省VLAN不能被共享。
已經創建了VLAN接口的VLAN不能被共享。
(1) 進入係統視圖。
system-view
(2) 進入Context視圖。
context context-name
(3) 為Context分配VLAN。
¡ 非連續VLAN配置。
allocate vlan vlan-id&<1-24>
¡ 連續VLAN配置。
allocate vlan vlan-id1 to vlan-id2
缺省情況下,沒有為Context分配VLAN。
為了防止一個Context發送的報文過多而導致其它Context發送的報文被丟棄,需要限製Context出方向的吞吐量。
(1) 進入係統視圖。
system-view
(2) 進入Context視圖。
context context-name
(3) 設置Context出方向的吞吐量限製。
capability throughput { kbps | pps } value
缺省情況下,各Context出方向不做吞吐量限製,按實際能力轉發。
一個Context內可以配置多個安全策略規則。如果不加限製,會出現大量規則占用過多的內存的情況,影響Context的其它功能正常運行。所以,請根據需要為Context設置安全策略規則總數限製。當規則總數達到限製值時,後續不能新增規則。
關於安全策略的詳細描述請參見“安全配置指導”中的“安全策略”。
如果設置的最大值比當前存在的規則總數小,配置仍會成功,多出的規則不會刪除,依然生效,但不能新增規則。
(1) 進入係統視圖。
system-view
(2) 進入Context視圖。
context context-name
(3) 設置Context的安全策略規則總數限製。
capability security-policy-rule maximum max-value
缺省情況下,未對Context的安全策略規則總數進行限製。
如果一個Context建立了太多會話表會導致其他Context的會話由於內存不夠而無法建立,為了防止這種情況,需要限製Context建立會話表的數量。
Context會話並發數限製對本機流量不生效,例如:FTP、Telnet、SSH、HTTP和HTTP類型的七層負載均衡等業務。
如果設置的最大值比當前存在的會話總數小,配置仍會成功,但不允許新建會話,且已經創建的會話不會被刪除,依然生效。直到已建立的會話通過老化機製使得會話總數低於配置的最大值後,係統才允許新建會話。
(1) 進入係統視圖。
system-view
(2) 進入Context視圖。
context context-name
(3) 設置Context的單播會話並發數限製。
capability session maximum max-number
缺省情況下,未對Context允許的單播會話並發數進行限製。
如果一個Context的會話新建速率過快會導致其他Context由於CPU處理能力不夠而無法建立會話,為了防止這種情況,需要限製Context的會話新建速率。
Context會話新建速率限製對本機流量不生效,例如:FTP、Telnet、SSH、HTTP和HTTP類型的七層負載均衡等業務。
(1) 進入係統視圖。
system-view
(2) 進入Context視圖。
context context-name
(3) 設置Context的會話新建速率限製。
capability session rate max-value
缺省情況下,未對Context允許的會話新建速率進行限製。
目前SSL VPN的用戶數目由設備License控製,設備全部用戶總數不能超過License控製,如果一個Context的用戶總數到達了License限製,則會出現其他Context用戶無法上線的問題,因此需要限製Context的上線用戶數,同時設備全部用戶總數仍受License控製。
如果設置的數值小於當前Context的SSL VPN登錄用戶總數,則配置可以成功,但不再允許新的用戶登錄,且已經登錄的用戶不會被刪除,依然生效。直到已登錄的用戶通過老化機製下線或用戶主動下線,使得用戶總數低於配置的最大值後,係統才允許新的用戶登錄。
(1) 進入係統視圖。
system-view
(2) 進入Context視圖。
context context-name
(3) 設置Context的SSL VPN登錄用戶數限製。
capability sslvpn-user maximum max-number
缺省情況下,未對Context的SSL VPN登錄用戶總數進行限製,由設備上SSL VPN Licence使用情況決定。
Context創建後需要啟動,才能完成新Context的初始化,相當於上電啟動。啟動後,用戶可以登錄到該Context執行配置。
正常程序啟動Context時,設備會先做一些檢查(比如Context的主、備進程能否正常啟動),滿足條件後,才啟動Context,該命令會保證主備的Context狀態一致,如果某成員設備上的Context啟動失敗,則會導致所有該Context進程啟動失敗。正常程序啟動的Context能更好的保證Context的業務正常運行,所以,通常情況下,使用context start命令啟動Context即可。force參數用於以下場景:在IRF環境,如果主備倒換或者配置恢複過程中出現內存不足,會導致部分Context雖然可以處理業務,但因為它們的主、備進程狀態不一致,這些Context一直停留在updating或者inactive狀態。當內存資源恢複後,執行context start force命令,設備會在不中斷業務的情況下,盡可能修複不正常的Conext進程,讓這些Context恢複到正常狀態。
在使用context start force前,用戶可以通過display context、display system internal context configuration-status、display system internal context id contex-id running-status命令查看Context的運行情況。
(1) 進入係統視圖。
system-view
(2) 進入Context視圖。
context context-name
(3) 啟動Context。
context start [ force ]
缺省情況下,Context會共享設備上的CPU/磁盤/內存資源,為了防止一個Context過多的占用CPU/磁盤/內存,而導致其它Context無法運行,需要限製Context對CPU/磁盤/內存資源的使用。
當CPU無法滿足所有Context的處理需求時,係統將按照CPU權重值為每個Context分配處理時間。通過調整Context的權重,可以使指定的Context獲得更多的CPU資源,保證關鍵業務的運行。例如:在三個Context中,將處理關鍵業務的Context的CPU權重設置為2,其餘兩個Context的CPU權重設置為1,則當CPU處理能力不足時,將為關鍵業務Context提供2倍於其它Context的處理時間。
(1) 進入係統視圖。
system-view
(2) 進入Context視圖。
context context-name
(3) 指定Context的CPU權重。
limit-resource cpu weight weight-value
缺省情況下,Context的CPU權重為10。
建議在Context正常啟動後再為Context分配磁盤空間上限,如果Context僅創建但未啟動,那麼磁盤使用值為0,此時如果配置磁盤空間上限的值小於Context啟動後正常實際使用的值,可能導致Context不能正常啟動。
本命令的支持情況與設備型號有關,請以設備的實際情況為準。
係列 |
型號 |
說明 |
F50X0係列 |
F5010、F5020、F5020-GM、F5030、F5030-6GW、F5030-6GW-G、F5040、F5060、F5080、F5000-A、F5000-C、F5000-S、F5000-M |
支持 |
F5000-CN係列 |
F5000-CN30、F5000-CN60 |
支持 |
F5000-AI係列 |
F5000-AI-15 |
不支持 |
F5000-AI-20、F5000-AI-40 |
支持 |
|
F5000-V係列 |
F5000-V30 |
支持 |
F1000-AI係列 |
F1000-AI-10、F1000-AI-15、F1000-AI-25、F1000-AI-35、F1000-AI-55、F1000-AI-60、F1000-AI-65、F1000-AI-70、F1000-AI-75、F1000-AI-80、F1000-AI-90 |
不支持 |
F1000-AI-03、F1000-AI-05、F1000-AI-20、F1000-AI-30、F1000-AI-50 |
支持 |
|
F1000-L係列 |
F1003-L、F1003-L-C、F1003-L-S、F1005-L、F1010-L |
不支持 |
F10X0係列 |
F1005、F1005-GM、F1010、F1010-GM、F1020、F1020-GM、F1030、F1030-GM、F1050、F1060、F1070、F1070-GM、F1070-GM-L、F1080 |
支持 |
F1003-C、F1003-M、F1003-S、F1090 |
不支持 |
|
F1000-V係列 |
F1000-V50、F1000-V60、F1000-V90 |
不支持 |
F1000-V70 |
支持 |
|
F1000-SASE係列 |
F1000-SASE100 |
支持 |
F1000-SASE200 |
不支持 |
|
F1000-AK係列 |
F1000-AK108、F1000-AK109、F1000-AK110、F1000-AK115、F1000-AK120、F1000-AK125、F1000-AK130、F1000-AK135、F1000-AK140、F1000-AK145、F1000-AK150、F1000-AK155、F1000-AK160、F1000-AK165、F1000-AK170、F1000-AK175、F1000-AK180、F1000-AK185、F1000-GM-AK370、F1000-GM-AK380、F1000-AK710、F1000-AK711、F1000-AK1010、F1000-AK1015、F1000-AK1020、F1000-AK1025、F1000-AK1030、F1000-AK1105、F1000-AK1110、F1000-AK1115、F1000-AK1120、F1000-AK1130、F1000-AK1140、F1000-AK1150、F1000-AK1160、F1000-AK1170、F1000-AK1180、F1000-AK1212、F1000-AK1222、F1000-AK1232、F1000-AK1312、F1000-AK1322、F1000-AK1332、F1000-AK9110、F1000-AK9210 |
支持 |
F1000-AK1125、F1000-AK1205、F1000-AK1215、F1000-AK1235、F1000-AK1242、F1000-AK1252、F1000-AK1262、F1000-AK1272、F1000-AK1305、F1000-AK1315、F1000-AK1342、F1000-AK1352、F1000-AK1362、F1000-AK1414、F1000-AK1424、F1000-AK1434、F1000-AK1505、F1000-AK1514、F1000-AK1515、F1000-AK1524、F1000-AK1534、F1000-AK1614、F1000-AK9109、F1000-AK9120、F1000-AK9150、F1000-AK9160、F1000-AK9180、F1000-AK9190 |
不支持 |
|
插卡 |
IM-NGFWX-IV、LSCM1FWDSD0、LSCM2FWDSD0、LSPM6FWD、LSPM6FWDB、LSQM1FWDSC0、LSQM2FWDSC0、LSU3FWCEA0、LSUM1FWCEAB0、LSUM1FWDEC0、LSWM1FWD0、LSX1FWCEA1、LSXM1FWDF1 |
支持 |
vFW係列 |
vFW1000、vFW2000、vFW-E-Cloud |
不支持 |
(1) 進入係統視圖。
system-view
(2) 進入Context視圖。
context context-name
(3) 顯示Context對磁盤資源的使用情況。
display context resource disk
(4) 配置Context可使用的磁盤空間上限。
limit-resource disk slot slot-number cpu cpu-number ratio limit-ratio
缺省情況下,Context可以使用物理設備上的所有空閑磁盤空間。
如果設備上有多塊磁盤,該命令對所有磁盤生效。
本命令的支持情況與設備的型號有關,具體請參見命令參考。
建議在Context正常啟動後再為Context分配內存空間上限,如果Context僅創建未啟動,可能會由於內存不足,造成Context無法正常啟動。在Context啟動後,配置的內存上限值還不應過小,以免Context內業務申請不到內存後引起功能不正常。
(1) 進入係統視圖。
system-view
(2) 進入Context視圖。
context context-name
(3) 顯示Context對內存資源的使用情況。
display context resource memory
(4) 配置Context可使用的內存空間上限。
limit-resource memory slot slot-number cpu cpu-number ratio limit-ratio
缺省情況下,所有Context共享物理設備上的所有內存空間,每個Context可使用的內存空間上限為空閑內存空間值。
隻要用戶和設備之間路由可達,就能使用switchto context命令,通過設備和Context的內部連接,登錄Context。
除了上述方式,用戶還可以通過Context上的接口,使用該Context的IP地址進行Telnet/SSH登錄。
(1) 進入係統視圖。
system-view
(2) 登錄Context。
switchto context context-name
用戶登錄Context後,可以在Context的用戶視圖執行quit命令來退出登錄。此時,命令視圖將從當前Context的用戶視圖返回到缺省Context的係統視圖。
如果一個Context接收和處理的廣播報文過多,將會導致其他Context處理業務能力的下降,因此需要限製Context接收廣播報文的數量。
Context對入方向廣播報文進行限速是通過整機接收報文限速和單個Context接收報文限速共同實現。當廣播報文總速率和單個Context廣播報文速率均達到各自閾值後,發往此Context的廣播報文會被設備丟棄,否則不會被丟棄。
此功能僅限製入方向報文的速率。
此功能僅對使用共享接口且處於Active狀態的Context生效。
當整機或單個Context廣播限速閾值為零時表示不對廣播報文限速。
(1) 進入係統視圖。
system-view
(2) 配置所有Context入方向廣播報文的總速率限製。
context-capability inbound broadcast total pps threshold
缺省情況下,所有Context入方向廣播報文總速率限製與設備型號有關,具體信息請參見命令參考手冊。
(3) 配置缺省Context入方向廣播報文的速率限製。
context-capability inbound broadcast single pps threshold
缺省情況下,缺省Context入方向廣播報文限速速率為廣播報文總速率閾值除以使用共享接口且處於Active狀態的Context的總數。
(4) 進入Context視圖。
context context-name
(5) 配置單個非缺省Context入方向廣播報文的速率限製。
context-capability inbound broadcast single pps threshold
缺省情況下,單個非缺省Context入方向廣播報文限速速率為廣播報文總速率閾值除以使用共享接口且處於Active狀態的Context的總數。
如果一個Context接收和處理的組播報文過多,將會導致其他Context處理業務能力的下降,因此需要限製Context接收組播報文的數量。
Context對入方向組播報文進行限速是通過整機接收報文限速和單個Context接收報文限速共同實現。當組播報文總速率和單個Context組播報文速率均達到各自閾值後,發往此Context的組播報文會被設備丟棄,否則不會被丟棄。
此功能僅限製入方向報文的速率。
此功能僅對使用共享接口且處於Active狀態的Context生效。
當整機或單個Context組播限速閾值為零時表示不對組播報文進行限速。
(1) 進入係統視圖。
system-view
(2) 配置所有Context入方向組播報文的總速率限製。
context-capability inbound multicast total pps threshold
缺省情況下,所有Context入方向組播報文總速率限製與設備型號有關,具體信息請參見命令參考手冊。
(3) 配置缺省Context入方向組播報文的速率限製。
context-capability inbound multicast single pps threshold
缺省情況下,缺省Context入方向組播報文限速速率為組播報文總速率閾值除以使用共享接口且處於Active狀態的Context的總數。
(4) 進入Context視圖。
context context-name
(5) 配置單個非缺省Context入方向組播報文的速率限製。
context-capability inbound multicast single pps threshold
缺省情況下,單個非缺省Context入方向組播報文限速速率為組播報文總速率閾值除以使用共享接口且處於Active狀態的Context的總數。
開啟此功能後,當Context接收到的廣播報文或組播報文因達到係統設置的閾值而被丟棄時,設備將會對丟棄的報文生成日誌信息。此日誌信息將會被輸出到信息中心模塊處理,信息中心模塊的配置將決定日誌信息的發送規則和發送方向。有關信息中心的詳細介紹,請參見“網絡管理和監控配置指導”中的“信息中心”。
(1) 進入係統視圖。
system-view
(2) 開啟Context入方向報文限速丟包日誌功能。
context-capability inbound drop-logging enable
缺省情況下,Context入方向報文限速丟包日誌功能處於關閉狀態。
此功能對所有Context入方向上的所有報文(包括廣播報文、組播報文和單播報文)均生效。
當某CPU核的利用率達到此攻擊防範閾值,並且驅動公共隊列已滿時,係統則認為該CPU核受到了攻擊。這時,係統將按照配置的單核CPU攻擊防範動作(通過attack-defense cpu-core action命令配置)對報文進行相應的處理。
有關attack-defense cpu-core action命令詳細介紹,請參見“安全命令參考”中的“攻擊檢測與防範”。
本命令的支持情況與設備型號有關,請以設備的實際情況為準。
係列 |
型號 |
說明 |
F50X0係列 |
F5010、F5020、F5020-GM、F5040、F5000-C、F5000-S |
不支持 |
F5030、F5030-6GW、F5030-6GW-G、F5060、F5080、F5000-A、F5000-M |
支持 |
|
F5000-CN係列 |
F5000-CN30、F5000-CN60 |
支持 |
F5000-AI係列 |
F5000-AI-15、F5000-AI-20、F5000-AI-40 |
支持 |
F5000-V係列 |
F5000-V30 |
支持 |
F1000-AI係列 |
F1000-AI-03、F1000-AI-05、F1000-AI-10、F1000-AI-15、F1000-AI-20、F1000-AI-25、F1000-AI-30、F1000-AI-35、F1000-AI-50、F1000-AI-55 |
不支持 |
F1000-AI-60、F1000-AI-65、F1000-AI-70、F1000-AI-75、F1000-AI-80、F1000-AI-90 |
支持 |
|
F1000-L係列 |
F1003-L、F1003-L-C、F1003-L-S、F1005-L、F1010-L |
不支持 |
F10X0係列 |
F1003-C、F1003-M、F1003-S、F1005、F1005-GM、F1010、F1010-GM、F1020、F1020-GM、F1030、F1030-GM、F1050、F1060、F1070、F1070-GM、F1070-GM-L、F1080 |
不支持 |
F1090 |
支持 |
|
F1000-V係列 |
F1000-V50、F1000-V70 |
不支持 |
F1000-V60、F1000-V90 |
支持 |
|
F1000-SASE係列 |
F1000-SASE100 、F1000-SASE200 |
不支持 |
F1000-AK係列 |
F1000-AK108、F1000-AK109、F1000-AK110、F1000-AK115、F1000-AK120、F1000-AK125、F1000-AK130、F1000-AK135、F1000-AK140、F1000-AK145、F1000-AK150、F1000-AK155、F1000-AK160、F1000-AK165、F1000-AK170、F1000-AK175、F1000-AK180、F1000-AK185、F1000-GM-AK370、F1000-GM-AK380、F1000-AK710、F1000-AK711、F1000-AK1010、F1000-AK1015、F1000-AK1020、F1000-AK1025、F1000-AK1030、F1000-AK1105、F1000-AK1110、F1000-AK1115、F1000-AK1120、F1000-AK1130、F1000-AK1140、F1000-AK1150、F1000-AK1160、F1000-AK1170、F1000-AK1180、F1000-AK1212、F1000-AK1222、F1000-AK1232、F1000-AK1242、F1000-AK1252、F1000-AK1262、F1000-AK1272、F1000-AK1312、F1000-AK1322、F1000-AK1332、F1000-AK9110、F1000-AK9210 |
不支持 |
F1000-AK1125、F1000-AK1205、F1000-AK1215、F1000-AK1235、F1000-AK1305、F1000-AK1315、F1000-AK1342、F1000-AK1352、F1000-AK1362、F1000-AK1414、F1000-AK1424、F1000-AK1434、F1000-AK1505、F1000-AK1514、F1000-AK1515、F1000-AK1524、F1000-AK1534、F1000-AK1614、F1000-AK9109、F1000-AK9120、F1000-AK9150、F1000-AK9160、F1000-AK9180、F1000-AK9190 |
支持 |
|
插卡 |
IM-NGFWX-IV、LSCM1FWDSD0、LSCM2FWDSD0、LSPM6FWD、LSPM6FWDB、LSQM1FWDSC0、LSQM2FWDSC0、LSU3FWCEA0、LSUM1FWCEAB0、LSUM1FWDEC0、LSWM1FWD0、LSX1FWCEA1、LSXM1FWDF1 |
不支持 |
vFW係列 |
vFW1000、vFW2000、vFW-E-Cloud |
不支持 |
(1) 進入係統視圖。
system-view
(2) 配置設備入方向所有報文對CPU核的攻擊防範閾值。
context-capability inbound unicast total cpu-usage threshold
缺省情況下,設備入方向所有報文對CPU核的攻擊防範閾值為95%。
此功能可以收集logfile文件夾和diagfile文件夾下的所有文件。
請在用戶視圖下執行本命令,收集各Context的日誌信息
tar context [ name context-name ] log file filename
在VPC(Virtual Private Cloud,虛擬私有雲)場景中,不同租戶被不同的VPC隔離。設備上使用VPN實例與VPC進行一一對應,這樣既可以保證不同VPC租戶之間流量的隔離,又可以實現不同VPC租戶之間流量的互通。
圖1-2 Context中跨VPC流量互通示意圖
如圖1-2所示,不同VPC之間流量隔離和互通的實現機製如下:
· 在設備上創建不同的VPN實例用於區分和隔離VPC之間的流量。
· 在設備上為VPN實例配置靜態路由,將路由出接口配置為LoopBack接口,可實現VPC間流量的互通。
跨VPN實例轉發流量隻支持類似安全策略這種報文過濾和阻斷的業務,不支持類似NAT、負載均衡等這種修改IP地址的業務。僅支持靜態路由配置。
推薦使用設備的物理子接口或者邏輯子接口與VPC租戶進行連接。
(1) 進入係統視圖。
system-view
(2) 創建VPN實例,並與接口關聯。
有關創建VPN實例並與接口關聯的具體操作,請參見“VPN實例配置指導”中的“VPN實例”。
(3) 為VPN實例配置靜態路由,路由出接口為LoopBack接口。
有關為VPN實例配置靜態路由的具體操作,請參見“三層技術-IP路由配置指導”中的“靜態路由”和“IPv6靜態路由”。
在完成Context相關配置後,在任意視圖下執行display命令,可以顯示配置後Context的運行情況,通過查看顯示信息,來驗證配置的效果。
在用戶視圖下,用戶可以執行reset命令清除Context相關信息。
表1-1 缺省Context上可執行的顯示和維護
操作 |
命令 |
顯示Context的相關信息 |
display context [ name context-name ] [ verbose ] |
顯示Context內可分配業務資源的使用情況 |
display context [ name context-name ] capability [ security-policy | session [ slot slot-number ] | sslvpn-user ] |
顯示Context入方向廣播報文的速率限製的統計信息 |
display context name context-name capability inbound broadcast slot slot-number |
顯示Context入方向組播報文的速率限製的統計信息 |
display context name context-name capability inbound multicast slot slot-number |
顯示CPU核受到攻擊的相關統計信息 |
display capability inbound unicast slot slot-number |
顯示各Context的配置信息 |
display context [ name context-name ] configuration [ file filename ] |
顯示為Context分配的接口列表 |
display context [ name context-name ] interface |
顯示Context對CPU/磁盤/內存資源的使用情況 |
display context [ name context-name ] resource [ cpu | disk | memory ] [ slot slot-number cpu cpu-number ] |
顯示Context內資源的統計信息 |
display context [ name context-name ] statistics [ file filename ] |
顯示Context的VLAN列表 |
display context [ name context-name ] vlan |
顯示非缺省Context的重啟信息 |
display context name context-name reboot show-number [ offset ] |
顯示所有Context內SSL VPN在線用戶數 |
display context online-users sslvpn |
清除Context入方向廣播報文的速率限製的統計信息 |
reset context name context-name capability inbound broadcast slot slot-number |
清除Context入方向組播報文的速率限製的統計信息 |
reset context name context-name capability inbound multicast slot slot-number |
清除非缺省Context的重啟信息 |
reset context [ name context-name ] reboot |
表1-2 非缺省Context上可執行的顯示和維護
操作 |
命令 |
顯示Context的接口列表 |
display context [ name context-name ] interface |
顯示本Context的重啟信息 |
display context reboot show-number [ offset ] |
清除本Context的重啟信息 |
reset context reboot |
將設備Device虛擬成三台獨立的Device:Context cnt1、Context cnt2、Context cnt3,並分給三個不同的用戶網絡進行安全防護。要求在用戶側看來,各自的接入設備是獨享的。
· LAN 1、LAN 2、LAN 3分別屬於公司A、公司B、公司C,現各公司的網絡均需要進行安全防護。公司A使用的網段為192.168.1.0/24,公司B使用的網段為192.168.2.0/24,公司C使用的網段為192.168.3.0/24。
· 公司A的用戶多,業務需求複雜,因此需要給Context cnt1提供較大的磁盤/內存空間使用上限,以便保存配置文件、啟動文件和係統信息等;對公司B使用係統缺省的磁盤空間即可;公司C人員規模小,上網流量比較少,對接入Device的配置及性能要求較低,因此對Context cnt3提供較低的CPU權重。
· GigabitEthernet1/0/1和GigabitEthernet1/0/4分配給Context cnt1、GigabitEthernet1/0/2和GigabitEthernet1/0/5分配給Context cnt2、GigabitEthernet1/0/3和GigabitEthernet1/0/6分配給Context cnt3。
圖1-3 Context基本組網配置組網圖
(1) 創建並配置Context cnt1,供公司A使用
# 創建Context cnt1,設置描述信息。
<Device> system-view
[Device] context cnt1
[Device-context-2-cnt1] description context-1
# 配置Context cnt1的磁盤和內存使用上限均為60%、CPU權重為8,具體配置步驟如下。
[Device-context-2-cnt1] limit-resource disk slot 1 cpu 0 ratio 60
[Device-context-2-cnt1] limit-resource memory slot 1 cpu 0 ratio 60
[Device-context-2-cnt1] limit-resource cpu weight 8
# 將接口GigabitEthernet1/0/1和GigabitEthernet1/0/4分配給Context cnt1。
[Device-context-2-cnt1] allocate interface gigabitethernet 1/0/1 gigabitethernet 1/0/4
Configuration of the interfaces will be lost. Continue? [Y/N]:y
# 啟動Context cnt1。
[Device-context-2-cnt1] context start
It will take some time to start the context...
Context started successfully.
[Device-context-2-cnt1] quit
# 切換到Context cnt1。
[Device] switchto context cnt1
******************************************************************************
* Copyright (c) 2004-2021 New H3C Technologies Co., Ltd. All rights reserved.*
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
******************************************************************************
<H3C> system-view
# 配置Telnet功能,保證管理用戶可以正常登錄設備,具體配置步驟請參考“基礎配置指導”中的“登錄設備”。
# 將Context cnt1的名稱修改為cnt1,以便和其它Context區別。
[H3C] sysname cnt1
# 配置接口GigabitEthernet1/0/1的IP地址為192.168.1.251,供公司A的管理用戶遠程登錄。
[cnt1] interface gigabitethernet 1/0/1
[cnt1-GigabitEthernet1/0/1] ip address 192.168.1.251 24
# 從自定義Context cnt1返回缺省Context。
[cnt1-GigabitEthernet1/0/1] return
<cnt1> quit
[Device]
(2) 創建並配置Context cnt2,供公司B使用
# 創建Context cnt2,設置描述信息
[Device] context cnt2
[Device-context-3-cnt2] description context-2
# 將接口GigabitEthernet1/0/2和GigabitEthernet1/0/5分配給Context cnt2。
[Device-context-3-cnt2] allocate interface gigabitethernet 1/0/2 gigabitethernet 1/0/5
Configuration of the interfaces will be lost. Continue? [Y/N]:y
# 啟動Context cnt2。
[Device-context-3-cnt2] context start
It will take some time to start the context...
Context started successfully.
[Device-context-3-cnt2] quit
# 切換到Context cnt2。
[Device] switchto context cnt2
******************************************************************************
* Copyright (c) 2004-2021 New H3C Technologies Co., Ltd. All rights reserved.*
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
******************************************************************************
<H3C> system-view
# 配置Telnet功能,保證管理用戶可以正常登錄設備,具體配置步驟請參考“基礎配置指導”中的“登錄設備”。
# 將Context cnt2的名稱修改為cnt2,以便和其它Context區別。
[H3C] sysname cnt2
# 配置接口GigabitEthernet1/0/2的IP地址為192.168.2.251,供公司B的管理用戶遠程登錄。
[cnt2] interface gigabitethernet 1/0/2
[cnt2-GigabitEthernet1/0/2] ip address 192.168.2.251 24
# 從自定義Context cnt2返回缺省Context。
[cnt2-GigabitEthernet1/0/2] return
<cnt2> quit
[Device]
(3) 創建並配置Context cnt3,供公司C使用
# 創建Context cnt3,設置描述信息
[Device] context cnt3
[Device-context-4-cnt3] description context-3
#配置Context cnt3的CPU權重為2。
[Device-context-4-cnt3] limit-resource cpu weight 2
# 將接口GigabitEthernet1/0/3和GigabitEthernet1/0/6分配給Context cnt3。
[Device-context-4-cnt3] allocate interface gigabitethernet 1/0/3 gigabitethernet 1/0/6
Configuration of the interfaces will be lost. Continue? [Y/N]:y
# 啟動Context cnt3。
[Device-context-4-cnt3] context start
It will take some time to start the context...
Context started successfully.
[Device-context-4-cnt3] quit
# 切換到Context cnt3。
[Device] switchto context cnt3
******************************************************************************
* Copyright (c) 2004-2021 New H3C Technologies Co., Ltd. All rights reserved.*
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
******************************************************************************
<H3C> system-view
# 配置Telnet功能,保證管理用戶可以正常登錄設備,具體配置步驟請參考“基礎配置指導”中的“登錄設備”。
# 將Context cnt3的名稱修改為cnt3,以便和其它Context區別。
[H3C] sysname cnt3
# 配置接口GigabitEthernet1/0/3的IP地址為192.168.3.251,供公司C的管理用戶遠程登錄。
[cnt3] interface gigabitethernet 1/0/3
[cnt3-GigabitEthernet1/0/3] ip address 192.168.3.251 24
# 從自定義Context cnt3返回缺省Context。
[cnt3-GigabitEthernet1/0/3] return
<cnt3> quit
[Device]
(1) 查看Context是否存在並且運轉正常。(此時,Device上應該有四台處於正常工作active狀態的Context)
[Device] display context
ID Name Status Description
1 Admin active DefaultContext
2 cnt1 active context-1
3 cnt2 active context-2
4 cnt3 active context-3
(2) 模擬公司A的管理用戶登錄到Context cnt1,可以查看本設備的當前配置。
C:\> telnet 192.168.1.251
******************************************************************************
* Copyright (c) 2004-2021 New H3C Technologies Co., Ltd. All rights reserved.*
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
******************************************************************************
<cnt1> display current-configuration
……
設備上的非缺省Context在對VPC租戶訪問公有雲的流量進行安全防護的同時,也可以使不同VPC之間的流量安全互通。
圖1-4 Context支持跨VPC流量互通配置組網圖
(1) 創建並配置Context cnt1,供VPC1和VPC2使用。
創建名稱為cnt1的Context,並為其分配CPU、內存、磁盤和接口資源,其具體配置步驟請參見“Context基本組網配置舉例”中的相關內容,本舉例不再贅述。
(2) 切換到Context cnt1。
<Device> system-view
[Device] switchto context cnt1
******************************************************************************
* Copyright (c) 2004-2020 New H3C Technologies Co., Ltd. All rights reserved.*
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
******************************************************************************
<H3C> system-view
# 配置Telnet功能,保證管理用戶可以正常登錄設備,具體配置步驟請參考“基礎配置指導”中的“登錄設備”。
# 將Context cnt1的名稱修改為cnt1,以便和其它Context區別。
[H3C] sysname cnt1
(3) 創建VPN實例,並將接口關聯VPN實例。
# 請根據組網中規劃的信息,創建VPN實例、LoopBack接口和以太網子接口,在以太網子接口上終結最外層VLAN ID,具體配置步驟如下。
[cnt1] ip vpn-instance vpc1
[cnt1-vpn-instance-vpc1] quit
[cnt1] ip vpn-instance vpc2
[cnt1-vpn-instance-vpc2] quit
[cnt1] interface loopback 1
[cnt1-LoopBack1] ip binding vpn-instance vpc1
[cnt1-LoopBack1] ip address 10.0.1.1 255.255.255.255
[cnt1-LoopBack1] quit
[cnt1] interface loopback 2
[cnt1-LoopBack2] ip binding vpn-instance vpc2
[cnt1-LoopBack2] ip address 10.0.2.1 255.255.255.255
[cnt1-LoopBack2] quit
[cnt1] interface gigabitethernet 1/0/1.1
[cnt1-GigabitEthernet1/0/1.1] ip binding vpn-instance vpc1
[cnt1-GigabitEthernet1/0/1.1] ip address 10.10.0.1 255.255.255.0
[cnt1-GigabitEthernet1/0/1.1] vlan-type dot1q vid 10
[cnt1-GigabitEthernet1/0/1.1] quit
[cnt1] interface gigabitethernet 1/0/1.2
[cnt1-GigabitEthernet1/0/1.2] ip binding vpn-instance vpc2
[cnt1-GigabitEthernet1/0/1.2] ip address 10.20.0.1 255.255.255.0
[cnt1-GigabitEthernet1/0/1.2] vlan-type dot1q vid 20
[cnt1-GigabitEthernet1/0/1.2] quit
(4) 配置靜態路由,保證路由可達
本舉例僅以靜態路由方式配置路由信息。實際組網中,請根據具體情況選擇相應的路由配置方式。
# 請根據組網圖中規劃的信息,配置靜態路由使VPC 1和VPC 2之間路由可達,具體配置步驟如下。
[cnt1] ip route-static vpn-instance vpc1 10.20.0.0 24 loopback1 10.0.2.1
[cnt1] ip route-static vpn-instance vpc2 10.10.0.0 24 loopback2 10.0.1.1
(5) 配置安全域。
# 將LoopBack接口和以太網子接口加入安全域。
[cnt1] security-zone name trust
[cnt1-security-zone-Trust] import interface loopback1
[cnt1-security-zone-Trust] import interface gigabitethernet 1/0/1.1
[cnt1-security-zone-Trust] quit
[cnt1] security-zone name untrust
[cnt1-security-zone-Untrust] import interface loopback2
[cnt1-security-zone-Untrust] import interface gigabitethernet 1/0/1.2
[cnt1-security-zone-Untrust] quit
(6) 配置安全策略保證VPC之間的流量互通。
[cnt1] security-policy ip
[cnt1-security-policy-ip] rule name vpc1
[cnt1-security-policy-ip-0-vpc1] action pass
[cnt1-security-policy-ip-0-vpc1] vrf vpc1
[cnt1-security-policy-ip-0-vpc1] source-zone trust
[cnt1-security-policy-ip-0-vpc1] destination-zone untrust
[cnt1-security-policy-ip-0-vpc1] quit
[cnt1-security-policy-ip] rule name vpc2
[cnt1-security-policy-ip-1-vpc2] action pass
[cnt1-security-policy-ip-1-vpc2] vrf vpc2
[cnt1-security-policy-ip-1-vpc2] source-zone untrust
[cnt1-security-policy-ip-1-vpc2] destination-zone trust
[cnt1-security-policy-ip-1-vpc2] quit
[cnt1-security-policy-ip] quit
# 在租戶A上可以Ping通租戶B。
C:\> ping 10.20.0.2
Pinging 10.20.0.2 with 32 bytes of data:
Reply from 10.20.0.2: bytes=32 time=19ms TTL=254
Reply from 10.20.0.2: bytes=32 time<1ms TTL=254
Reply from 10.20.0.2: bytes=32 time<1ms TTL=254
Reply from 10.20.0.2: bytes=32 time<1ms TTL=254
Ping statistics for 10.20.0.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 19ms, Average = 4ms
設備Device作為bobty下载软件 中心的出口網關,對內部網絡的信息安全進行防護,其中Device隻有一個公網接口GigabitEthernet1/0/1。現有相互獨立的租戶A和B需要使用bobty下载软件 中心的計算資源,具體組網需求如下:
· 將Device虛擬成兩台獨立的Device:Context cnt1和Context cnt2,並分給租戶A和B進行安全防護。其中,Context cnt1以共享方式使用接口GigabitEthernet1/0/1,以獨占方式使用接口GigabitEthernet1/0/2;Context cnt2以共享方式使用接口GigabitEthernet1/0/1,以獨占方式使用接口GigabitEthernet1/0/3。
· 在共享接口GigabitEthernet1/0/1上配置NAT內部服務器,使租戶A和B可以利用獨立的公網IP地址訪問Server A和Server B。
圖1-5 通過Context實現bobty下载软件 中心網關配置組網圖
(1) 配置接口IP地址
# 根據組網圖中規劃的信息,配置接口GigabitEthernet1/0/1的IP地址,具體配置步驟如下。
<Device> system-view
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] ip address 1.1.1.1 24
[Device-GigabitEthernet1/0/1] quit
(2) 創建並配置Context cnt1,供租戶A使用
# 創建Context cnt1,設置描述信息。
[Device] context cnt1
[Device-context-2-cnt1] description context-1
# 以共享方式將接口GigabitEthernet1/0/1分配給Context cnt1。
[Device-context-2-cnt1] allocate interface gigabitethernet 1/0/1 share
# 以獨占方式將接口GigabitEthernet1/0/2分配給Context cnt1。
[Device-context-2-cnt1] allocate interface gigabitethernet 1/0/2
Configuration of the interfaces will be lost. Continue? [Y/N]:y
# 啟動Context cnt1。
[Device-context-2-cnt1] context start
It will take some time to start the context...
Context started successfully.
[Device-context-2-cnt1] quit
# 切換到Context cnt1。
[Device] switchto context cnt1
******************************************************************************
* Copyright (c) 2004-2021 New H3C Technologies Co., Ltd. All rights reserved.*
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
******************************************************************************
<H3C> system-view
# 將Context cnt1的名稱修改為cnt1,以便和其它Context區別。
[H3C] sysname cnt1
# 配置接口GigabitEthernet1/0/2的IP地址為10.1.1.1/24。
[cnt1] interface gigabitethernet 1/0/2
[cnt1-GigabitEthernet1/0/2] ip address 10.1.1.1 24
[cnt1-GigabitEthernet1/0/2] quit
# 將接口GigabitEthernet1/0/1和GigabitEthernet1/0/2分別加入Untrust和Trust安全域。
[cnt1] security-zone name untrust
[cnt1-security-zone-Untrust] import interface gigabitethernet 1/0/1
[cnt1-security-zone-Untrust] quit
[cnt1] security-zone name trust
[cnt1-security-zone-Trust] import interface gigabitethernet 1/0/2
[cnt1-security-zone-Trust] quit
# 配置安全策略保證租戶A能成功訪問Server A。
[cnt1] security-policy ip
[cnt1-security-policy-ip] rule name untrust-trust
[cnt1-security-policy-ip-0-untrust-trust] action pass
[cnt1-security-policy-ip-0-untrust-trust] source-zone untrust
[cnt1-security-policy-ip-0-untrust-trust] destination-zone trust
[cnt1-security-policy-ip-0-untrust-trust] source-ip-host 2.2.2.2
[cnt1-security-policy-ip-0-untrust-trust] destination-ip-host 10.1.1.2
[cnt1-security-policy-ip-0-untrust-trust] quit
[cnt1-security-policy-ip] quit
# 從自定義Context cnt1返回缺省Context。
[cnt1] quit
<cnt1> quit
[Device]
(3) 創建並配置Context cnt2,供租戶B使用
# 創建Context cnt2,設置描述信息。
[Device] context cnt2
[Device-context-3-cnt2] description context-2
# 以共享方式將接口GigabitEthernet1/0/1分配給Context cnt2。
[Device-context-3-cnt2] allocate interface gigabitethernet 1/0/1 share
# 以獨占方式將接口GigabitEthernet1/0/3分配給Context cnt2。
[Device-context-3-cnt2] allocate interface gigabitethernet 1/0/3
Configuration of the interfaces will be lost. Continue? [Y/N]:y
# 啟動Context cnt2。
[Device-context-3-cnt2] context start
It will take some time to start the context...
Context started successfully.
[Device-context-3-cnt2] quit
# 切換到Context cnt2。
[Device] switchto context cnt2
******************************************************************************
* Copyright (c) 2004-2021 New H3C Technologies Co., Ltd. All rights reserved.*
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
******************************************************************************
<H3C> system-view
# 將Context cnt2的名稱修改為cnt2,以便和其它Context區別。
[H3C] sysname cnt2
# 配置接口GigabitEthernet1/0/3的IP地址為10.1.2.1/24。
[cnt2] interface gigabitethernet 1/0/3
[cnt2-GigabitEthernet1/0/3] ip address 10.1.2.1 24
[cnt2-GigabitEthernet1/0/3] quit
# 將接口GigabitEthernet1/0/1和GigabitEthernet1/0/3分別加入Untrust和Trust安全域。
[cnt2] security-zone name untrust
[cnt2-security-zone-Untrust] import interface gigabitethernet 1/0/1
[cnt2-security-zone-Untrust] quit
[cnt2] security-zone name trust
[cnt2-security-zone-Trust] import interface gigabitethernet 1/0/3
[cnt2-security-zone-Trust] quit
# 配置安全策略保證租戶B能成功訪問Server B。
[cnt2] security-policy ip
[cnt2-security-policy-ip] rule name untrust-trust
[cnt2-security-policy-ip-0-untrust-trust] action pass
[cnt2-security-policy-ip-0-untrust-trust] source-zone untrust
[cnt2-security-policy-ip-0-untrust-trust] destination-zone trust
[cnt2-security-policy-ip-0-untrust-trust] source-ip-host 3.3.3.3
[cnt2-security-policy-ip-0-untrust-trust] destination-ip-host 10.1.2.2
[cnt2-security-policy-ip-0-untrust-trust] quit
[cnt2-security-policy-ip] quit
# 從自定義Context cnt2返回缺省Context。
[cnt2] quit
<cnt2> quit
[Device]
(4) 配置NAT內部服務器。
# 在接口GigabitEthernet1/0/1上配置NAT內部服務器,允許外部通過http://1.1.1.2:8080地址訪問Server A,通過http://1.1.1.3:8080地址訪問Server B。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] nat server protocol tcp global 1.1.1.2 8080 inside 10.1.1.2 http
[Device-GigabitEthernet1/0/1] nat server protocol tcp global 1.1.1.3 8080 inside 10.1.2.2 http
[Device-GigabitEthernet1/0/1] quit
(1) 查看Context是否存在並且運轉正常。(此時,Device上應該有三台處於正常工作active狀態的Context)
[Device] display context
ID Name Status Description
1 Admin active DefaultContext
2 cnt1 active context-1
3 cnt2 active context-2
(2) 租戶A可以通過http://1.1.1.2:8080地址訪問Server A,租戶B可以通過http://1.1.1.3:8080地址訪問Server B。
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!