預計完成時間:30 分鐘
可操作元件擁有者:INV/PNET
我們提供二進位檔,可自動產生 Operations Suite Infrastructure (OI) 交換器和防火牆所需的設定檔。這必須可從 GDC tar 檔案或部署用的特定 OI 構件 (例如IT_component_bundle.tar.gz) 取得。
二進位檔為 occonfigtool。並使用 YAML 檔案做為輸入內容。如要瞭解規格,請參閱這篇文章。
如需將二進位檔帶入環境的操作說明,請參閱「下載檔案」和「將 GDC 下載內容轉移至實體隔離環境」。
2.3.1. YAML 規格
| 屬性 |
說明 |
值 |
|---|---|---|
domain字串 |
營運中心的網域字尾。 | 示例: - opscenter.local |
featuresFeatureOptions |
您可以在佈建 OI 部署作業時啟用這些功能。功能選項請參閱「功能選項」。 | 示例: - multisite, no-firewall, etc. |
segmentsSegmentInfo |
用於設定 OI 的區隔相關資訊。 |
2.3.1.1. 功能選項
「功能」分頁會顯示可在 OI 部署作業中啟用的所有功能。支援的功能如下:
| 功能 |
說明 |
用量 |
|---|---|---|
banner字串 |
登入橫幅,會新增至所有 OCCORE 交換器和防火牆,以及 Operations Suite Facility (OIF) 交換器。 |
banner: | |
multisitebool |
產生 2 個完整的 OC IT 設定和所有站點間設定 |
multisite: true |
virtualbool |
產生虛擬 OI 的設定 |
virtual: true |
no-firewallbool |
啟用不需要 OCCORE 防火牆的部署選項。 在這個部署方法中,前端 VRF (GDCH-DATA-TRANSIT/ GDCH-MGMT-TRANSIT) 不存在,所有互連工作階段都由 OC-DATA VRF 和 HW-INFRA VRF 直接處理。 |
no-firewall: true |
deny-all-aclsbool |
產生所有 ACL 設定,並明確將最後一條規則設為拒絕所有要求。 |
deny-all-acls: true |
L3-WANbool |
產生用於與 L3-WAN 對等互連的 OCIT 設定。包括前門 VRF、防火牆迴路連結和路徑政策。 |
deny-all-acls: true |
crypto-servicesbool |
產生設定,支援用於加密相關裝置及其管理的獨立 VLAN 和子網路。這不會在交換器本身啟用任何加密功能。 |
crypto-services: true |
2.3.1.2. 區隔資訊
區隔資訊提供建構所有設定所需的輸入內容。系統會為每個區隔提供下列屬性做為輸入內容:
| 屬性 |
說明 |
用量 |
||||||
|---|---|---|---|---|---|---|---|---|
segmentType字串 |
segmentType 參數為必要參數,且為 core 或 oc 片段。網站必須有兩個區隔,且各為 core 和 oc 類型。
|
|
||||||
InstanceIDint |
表示網站。每個網站都必須有專屬的例項 ID 如果不是多網站 OI 部署作業,系統預設會將例項 ID 值設為 `1` (如果未提供)。 |
segments: |
2.3.1.3. 核心資訊
核心資訊提供所有必要的輸入內容,可建構下列項目的設定:
- occoresw01
- occoresw02
- occorefw01
- occorefw02
| 屬性 |
說明 |
值 |
||||||
|---|---|---|---|---|---|---|---|---|
bgpmap |
用於 core 和 gdch-transit BGP 自治系統 (AS) 的自治系統編號 (ASN)。
|
範例:bgp: |
||||||
uplinkSpeeduint32 |
(選用) 提供連線的上傳速度 (10 或 100)。
|
值:10、100預設值: 10範例: uplinkSpeed: 100 |
||||||
remoteUplinkSpeeduint32 |
(選用) 提供所有遠端連線的上傳速度 (10 或 100)。
|
值:10、100預設值: 10範例: remoteUplinkSpeed: 100 |
||||||
cidrs[]CIDR |
用於 OIR 網路的 CIDR 清單。 |
值:/20 網路位址 範例: cidrs: |
||||||
cablesCSV字串 |
電纜線的 CSV 檔案路徑 這個檔案提供 OCCORE 機架中的 OI 連線資訊 core 類型的每個區段都有專屬的電纜線檔案。 |
範例:cablesCSV: /path/to/cables1.csv |
||||||
devicesCSV字串 |
devices.csv 檔案的路徑 這個檔案提供 OCCORE 機架中的裝置資訊 每個 core 類型的區段都有專屬的裝置檔案。 |
範例:devicesCSV: /path/to/devices1.csv |
||||||
2.3.1.4. OC 資訊
核心資訊提供所有必要輸入內容,可建構作業套件設施 (OIF) 交換器 (OCSW) 的設定:
| 屬性 |
說明 |
值 |
||||
|---|---|---|---|---|---|---|
bgpmap |
用於 oc BGP 自治系統 (AS) 的自治系統編號 (ASN)。
|
範例:bgp: |
||||
uplinkSpeeduint32 |
(選用) 提供連線的上傳速度 (10 或 100)。
|
值:10、100預設值: 10範例: uplinkSpeed: 100 |
||||
remoteUplinkSpeeduint32 |
(選用) 提供所有遠端連線的上傳速度 (10 或 100)。
|
值:10、100預設值: 10範例: remoteUplinkSpeed: 100 |
||||
onlyRemoteOCbool |
選用:將本機 OC 執行個體視為遠端 OC 執行個體。也就是說,相同執行個體 ID 的 OC-CORE 交換器會使用遠端上行鏈路連線至 OC 交換器。這也適用於 OC 交換器,也就是說,OC 交換器會使用遠端上行鏈路連線至 OC-CORE 交換器。 |
值:true、false預設值: false範例: onlyRemoteOC: true |
||||
cidrs[ ] CIDR |
用於 OIR 網路的 CIDR 清單。 |
值:/20 網路位址 範例: cidrs: |
||||
workstationsPerSwitchuint32 |
為 OIR 網路佈建的工作站數量。這會設定從 Eth1/1 介面開始的介面數量。每個區隔最多可有 40 個值。如未指定這個欄位,系統會為工作站設定介面 1 到 10。 |
值:1 到 40 範例: workstationsPerSwitch: 15 |
||||
2.3.2. CLI 選項
| 選項 |
說明 |
值 |
|---|---|---|
-o--ocit-file |
用於產生 OI 設定的輸入 YAML 檔案 | 示例: - occonfigtool generate ocit config -o example_ocit.yaml |
-c--conn-file |
用於產生互連設定的輸入互連檔案。詳情請參閱:附錄 A | 示例: - occonfigtool generate ocit config -o example_ocit.yaml -c interconnect.yaml |
-d--debug |
這個標記選項用於產生偵錯記錄,會顯示內部資料結構,且不會產生任何輸出檔案 | 示例: - occonfigtool generate ocit config -o example_ocit.yaml -d |
-f--output-folder |
產生所有設定檔,並將其放在指定名稱的資料夾中 | 示例: - occonfigtool generate ocit config -o example_ocit.yaml -f configs |
-s--simplify-configs |
將 ACL 設定與其他設定放在同一個檔案中,簡化交換器設定 | 示例: - occonfigtool generate ocit config -o example_ocit.yaml -s
occonfigtool generate ocit config -o example_ocit.yaml -c interconnect.yaml -s |
2.3.3. 產生輸入檔案範例
如要取得基準輸入 YAML 檔案,請執行下列指令:
occonfigtool generate ocit example -o ocit.yaml
輸出範例如下:
domain: opscenter.local
segments:
- segmentType: core
instanceID: 1
cablesCSV: /path/to/cables.csv
bgp:
asn:
core: 65535
gdch-transit: 65515
uplinkSpeed: 10
cidrs:
- 172.21.0.0/20
- segmentType: oc
instanceID: 1
cablesCSV: /path/to/cables.csv
bgp:
asn:
oc: 65525
uplinkSpeed: 10
cidrs:
- 172.21.32.0/20
2.3.4. 視需要更新輸入檔案
然後修改 ocit.yaml 檔案,反映所有必要變更。如有需要,請參閱 YAML 規格。
主要確認事項是 BGP ASN 和網路 CIDR 區塊。
2.3.5. 產生基本設定
使用更新後的 ocit.yaml 檔案執行 occonfigtool,產生設定。執行下列指令:
產生的設定檔會加上前置字串,格式如下:
<segment_type><device_type><instance_id><device_id>。
occonfigtool generate ocit config -o ./ocit.yaml
輸出內容範例:
Configuration written to coresw101.base.opscenter.local.cfg
Configuration written to coresw102.base.opscenter.local.cfg
Configuration written to corefw101.base.opscenter.local.cfg
Configuration written to corefw102.base.opscenter.local.cfg
Configuration written to coresw101.acl.opscenter.local.cfg
Configuration written to coresw102.acl.opscenter.local.cfg
Configuration written to ocsw101.base.opscenter.local.cfg
Configuration written to ocsw102.base.opscenter.local.cfg
Configuration written to ocsw101.acl.opscenter.local.cfg
Configuration written to ocsw102.acl.opscenter.local.cfg
Configuration written to ocit-topology-exchange-1.common.opscenter.local.yaml
Configuration written to ocinfo.common.opscenter.local.txt
SHA1 sums written to configs.shasum.ocit.txt (use "shasum -c configs.shasum.ocit.txt" on receiving side to verify integrity)
2.3.5.1. 產生多網站部署的基本設定
請確認 ocit.yaml 檔案中有兩個執行個體,如範例檔案所示。multisite 特徵標記必須設為 true:
domain: opscenter.local
features:
multisite: true
segments:
- segmentType: core
instanceID: 1
cablesCSV: /path/to/cables1.csv
devicesCSV: /path/to/devices1.csv
bgp:
asn:
core: 65072
gdch-transit: 65515
uplinkSpeed: 10
cidrs:
- 10.1.0.0/20
- segmentType: oc
instanceID: 1
bgp:
asn:
oc: 65072
uplinkSpeed: 10
cidrs:
- 10.1.32.0/20
- segmentType: core
instanceID: 2
cablesCSV: /path/to/cables2.csv
devicesCSV: /path/to/devices2.csv
bgp:
asn:
core: 65073
gdch-transit: 65525
uplinkSpeed: 10
cidrs:
- 10.2.0.0/20
- segmentType: oc
instanceID: 2
bgp:
asn:
oc: 65073
uplinkSpeed: 10
cidrs:
- 10.2.32.0/20
輸出內容範例:
Configuration written to coresw101.base.opscenter.local.cfg
Configuration written to coresw102.base.opscenter.local.cfg
Configuration written to corefw101.base.opscenter.local.cfg
Configuration written to corefw102.base.opscenter.local.cfg
Configuration written to coresw101.acl.opscenter.local.cfg
Configuration written to coresw102.acl.opscenter.local.cfg
Configuration written to ocsw101.base.opscenter.local.cfg
Configuration written to ocsw102.base.opscenter.local.cfg
Configuration written to ocsw101.acl.opscenter.local.cfg
Configuration written to ocsw102.acl.opscenter.local.cfg
Configuration written to coresw201.base.opscenter.local.cfg
Configuration written to coresw202.base.opscenter.local.cfg
Configuration written to corefw201.base.opscenter.local.cfg
Configuration written to corefw202.base.opscenter.local.cfg
Configuration written to coresw201.acl.opscenter.local.cfg
Configuration written to coresw202.acl.opscenter.local.cfg
Configuration written to ocsw201.base.opscenter.local.cfg
Configuration written to ocsw202.base.opscenter.local.cfg
Configuration written to ocsw201.acl.opscenter.local.cfg
Configuration written to ocsw202.acl.opscenter.local.cfg
Configuration written to ocit-topology-exchange-1.common.opscenter.local.yaml
Configuration written to ocit-topology-exchange-2.common.opscenter.local.yaml
Configuration written to ocinfo.common.opscenter.local.txt
SHA1 sums written to configs.shasum.ocit.txt (use "shasum -c configs.shasum.ocit.txt" on receiving side to verify integrity)
系統必須將設定檔儲存至目前的工作目錄。如果在產生設定時啟用 output-folder CLI 選項,系統會產生輸出檔案並儲存至該資料夾路徑。
產生設定檔的指令如下:
occonfigtool generate ocit config -o ocit.yaml -f path/to/configs
輸出內容範例:
Configuration written to ./path/to/configs/site-1/base/coresw101.base.opscenter.local.cfg
Configuration written to ./path/to/configs/site-1/base/coresw102.base.opscenter.local.cfg
Configuration written to ./path/to/configs/site-1/base/corefw101.base.opscenter.local.cfg
Configuration written to ./path/to/configs/site-1/base/corefw102.base.opscenter.local.cfg
Configuration written to ./path/to/configs/site-1/base/acl/coresw101.acl.opscenter.local.cfg
Configuration written to ./path/to/configs/site-1/base/acl/coresw102.acl.opscenter.local.cfg
Configuration written to ./path/to/configs/site-1/base/ocsw101.base.opscenter.local.cfg
Configuration written to ./path/to/configs/site-1/base/ocsw102.base.opscenter.local.cfg
Configuration written to ./path/to/configs/site-1/base/acl/ocsw101.acl.opscenter.local.cfg
Configuration written to ./path/to/configs/site-1/base/acl/ocsw102.acl.opscenter.local.cfg
Configuration written to ./path/to/configs/site-2/base/coresw201.base.opscenter.local.cfg
Configuration written to ./path/to/configs/site-2/base/coresw202.base.opscenter.local.cfg
Configuration written to ./path/to/configs/site-2/base/corefw201.base.opscenter.local.cfg
Configuration written to ./path/to/configs/site-2/base/corefw202.base.opscenter.local.cfg
Configuration written to ./path/to/configs/site-2/base/acl/coresw201.acl.opscenter.local.cfg
Configuration written to ./path/to/configs/site-2/base/acl/coresw202.acl.opscenter.local.cfg
Configuration written to ./path/to/configs/site-2/base/ocsw201.base.opscenter.local.cfg
Configuration written to ./path/to/configs/site-2/base/ocsw202.base.opscenter.local.cfg
Configuration written to ./path/to/configs/site-2/base/acl/ocsw201.acl.opscenter.local.cfg
Configuration written to ./path/to/configs/site-2/base/acl/ocsw202.acl.opscenter.local.cfg
Configuration written to ./path/to/configs/site-1/ocit-topology-exchange-1.common.opscenter.local.yaml
Configuration written to ./path/to/configs/site-2/ocit-topology-exchange-2.common.opscenter.local.yaml
Configuration written to ./path/to/configs/ocinfo.common.opscenter.local.txt
SHA1 sums written to path/to/configs/configs.shasum.ocit.txt (use "shasum -c path/to/configs/configs.shasum.ocit.txt" on receiving side to verify integrity)
如需詳細步驟,請參閱下一節。
2.3.5.2. 產生 L3-WAN 連線的基本設定
設定及宣告 L3-WAN 連線。以下範例顯示已完成的 YAML 檔案,其中包含 L3-WAN 連線的正確設定:
domain: opscenter.local
features:
L3-WAN: true
segments:
- segmentType: core
instanceID: 1
cablesCSV: /path/to/cables.csv
devicesCSV: /path/to/devices.csv
bgp:
asn:
core: 65535
gdch-transit: 4200002002
wan-transit: 65000
uplinkSpeed: 10
cidrs:
- 172.21.0.0/20
- segmentType: oc
instanceID: 1
bgp:
asn:
oc: 65525
uplinkSpeed: 10
cidrs:
- 172.21.32.0/20