以前に CML で起動前にコンフィグを設定しておく というメモに記載した通り、CML2 ではノードの起動前に予めコンフィグを設定しておくことが出来ます。 この事前に設定されたコンフィグを含め、ラボ全体のトポロジーをエクスポート / インポートすることが出来ます。 今回はその手順をメモしておきます。
前提となるラボ
今回は以下のトポロジーを作成しました。
IOSv1
hostname IOSv-1
!
interface GigabitEthernet0/0
ip vrf forwarding management
ip address dhcp
no shutdown
!
interface GigabitEthernet0/1
ip address 10.0.0.1 255.255.255.0
no shutdown
!
end
IOSv2
hostname IOSv-2
!
interface GigabitEthernet0/0
ip vrf forwarding management
ip address dhcp
no shutdown
!
interface GigabitEthernet0/1
ip address 10.0.0.2 255.255.255.0
no shutdown
!
end
エクスポート手順
ラボの構成をエクスポートするには、ラボを選択した状態で SIMULATE
→ DOWNLOAD LAB
を選択します。 これでラボの構成が .yaml ファイルとして保存されます。 このファイルには EDIT CONFIG
に事前設定したコンフィグも含まれます。
かなり長いですが、実際にエクスポートした .yaml ファイルは以下です。
lab:
description: ''
notes: ''
timestamp: 1634779391.2947512
title: Lab-1
version: 0.0.4
nodes:
- id: n0
label: unmanaged-switch-0
node_definition: unmanaged_switch
x: -250
y: -100
configuration: ''
tags: []
interfaces:
- id: i0
slot: 0
label: port0
type: physical
- id: i1
slot: 1
label: port1
type: physical
- id: i2
slot: 2
label: port2
type: physical
- id: i3
slot: 3
label: port3
type: physical
- id: i4
slot: 4
label: port4
type: physical
- id: i5
slot: 5
label: port5
type: physical
- id: i6
slot: 6
label: port6
type: physical
- id: i7
slot: 7
label: port7
type: physical
- id: n1
label: ext-conn-0
node_definition: external_connector
x: -250
y: -200
configuration: bridge0
tags: []
interfaces:
- id: i0
slot: 0
label: port
type: physical
- id: n2
label: IOSv-1
node_definition: iosv
x: -400
y: 0
configuration: |-
hostname IOSv-1
!
interface GigabitEthernet0/0
ip vrf forwarding management
ip address dhcp
no shutdown
!
interface GigabitEthernet0/1
ip address 10.0.0.1 255.255.255.0
no shutdown
!
end
image_definition: iosv-159-3-m3
tags: []
interfaces:
- id: i0
label: Loopback0
type: loopback
- id: i1
slot: 0
label: GigabitEthernet0/0
type: physical
- id: i2
slot: 1
label: GigabitEthernet0/1
type: physical
- id: i3
slot: 2
label: GigabitEthernet0/2
type: physical
- id: i4
slot: 3
label: GigabitEthernet0/3
type: physical
- id: n3
label: IOSv-2
node_definition: iosv
x: -100
y: 0
configuration: |-
hostname IOSv-2
!
interface GigabitEthernet0/0
ip vrf forwarding management
ip address dhcp
no shutdown
!
interface GigabitEthernet0/1
ip address 10.0.0.2 255.255.255.0
no shutdown
!
end
image_definition: iosv-159-3-m3
tags: []
interfaces:
- id: i0
label: Loopback0
type: loopback
- id: i1
slot: 0
label: GigabitEthernet0/0
type: physical
- id: i2
slot: 1
label: GigabitEthernet0/1
type: physical
- id: i3
slot: 2
label: GigabitEthernet0/2
type: physical
- id: i4
slot: 3
label: GigabitEthernet0/3
type: physical
links:
- id: l0
i1: i0
n1: n1
i2: i0
n2: n0
- id: l1
i1: i1
n1: n0
i2: i1
n2: n2
- id: l2
i1: i2
n1: n0
i2: i1
n2: n3
- id: l3
i1: i2
n1: n2
i2: i2
n2: n3
インポート手順
エクスポートした .yaml ファイルをインポートするにはダッシュボード (CML2 のトップ画面) 右上にある IMPORT
をクリックします。
ラボの構成ファイルを選択するよう促されるのでエクスポートした .yaml ファイルをアップロードします。
アップロードが完了したら IMPORT
をクリックします。
インポートが完了しました。 GO TO LAB
をクリックします。
インポートされたラボが表示されます。
コメント