My Home NW Lab

逸般の誤家庭のネットワーク

Catalyst 8000V (Public Cloud版)の Section: License によるライセンス適用

Public Cloud版のCatalyst 8000Vでは、User Dataに Section: License を記述して適用するライセンス種別を指定できます。

Section: License の書式

User Dataの Section: License の書式は下記のようになっております。

Section: License
TechPackage:tech_level

tech_level には下記のライセンス種別から使用するものに置き換えます。

tech_level
network-advantage
network-essentials
network-premier

例として network-premier を指定する場合は下記のように記述します。

Section: License
TechPackage:network-premier

書式の注意点ですが TechPackagetech_level の間はスペースを入れないでください。

ドキュメント上の情報

ドキュメント上では ax, security, appx, ipbase を指定する旨の記載があります。しかし、CSR1000V時代のライセンス種別の情報のようで筆者が検証しても動作しませんでした。

www.cisco.com Configuring the License property セクションに Section: License の記述があります。

Cisco Catalyst 8000V Edge Software Installation And Configuration Guide - Day 0 Configuration (2022年12月18日時点)

ドキュメントがアップデートされていない可能性を疑って、Catalyst 8000Vの license boot level コマンドのオプションに置き換えて、ライセンスの適用確認を実機で検証しました。

Catalyst 8000VのSection: License

license boot level コマンドのオプションですが、CSR1000Vのオプションがドキュメントに記載されていた ax, security, appx, ipbase と同じである点と、Catalyst 8000VとCSR1000Vでそのオプションが異なるのは実機で確認しております。

license boot level コマンドの比較

Catalyst 8000Vの license boot level コマンド

C8000V(config)#license boot level ?
  network-advantage   License Level Network-Advantage
  network-essentials  License Level Network-Essentials
  network-premier     License Level Network-Premier

C8000V(config)#license boot level

CSR1000Vの license boot level コマンド

CSR1000V(config)#license boot level ?
  appx      Enable appx license
  ax        Enable ax(ipb+sec+appx) license
  ipbase    Enable ipbase license
  security  Enable security license

CSR1000V(config)#license boot level 

Section: License の各指定パターン

Section: License の各ライセンス種別の指定パターンを相違点の確認用に記載します。

show running-config ではライセンス反映の判別が行えなかったため、show version でライセンス反映の確認を行っております。

Section: License の未記述時 (ライセンス種別の指定なし)

比較のために Section: License を記述しなかった場合の情報を記載します。

License Level:Addon License Level: にライセンスが反映されてないのを確認できます。

c8000v01#show version | include License
licensed under the GNU General Public License ("GPL") Version 2.0.  The
documentation or "License Notice" file accompanying the IOS-XE software,
License Level: 
License Type: Perpetual
Addon License Level: 
Addon License Type: Subscription
c8000v01#

network-essentials の指定時

User Dataに network-essentials を指定した際の情報です。

Section: License
TechPackage:network-essentials

License Level:Addon License Level: に network-essentials のライセンスが反映されているのが確認できます。

c8000v01#show version | include License
licensed under the GNU General Public License ("GPL") Version 2.0.  The
documentation or "License Notice" file accompanying the IOS-XE software,
License Level: network-essentials
License Type: Perpetual
Addon License Level: dna-essentials
Addon License Type: Subscription
c8000v01#

network-advantage の指定時

User Dataに network-advantage を指定した際の情報です。

Section: License
TechPackage:network-advantage

License Level:Addon License Level: に network-advantage のライセンスが反映されているのが確認できます。

c8000v01#show version | include License
licensed under the GNU General Public License ("GPL") Version 2.0.  The
documentation or "License Notice" file accompanying the IOS-XE software,
License Level: network-advantage
License Type: Perpetual
Addon License Level: dna-advantage
Addon License Type: Subscription
c8000v01#

network-premier の指定時

User Dataに network-premier を指定した際の情報です。

Section: License
TechPackage:network-premier

License Level:Addon License Level: に network-premier のライセンスが反映されているのが確認できます。

c8000v01#show version | include License
licensed under the GNU General Public License ("GPL") Version 2.0.  The
documentation or "License Notice" file accompanying the IOS-XE software,
License Level: network-premier
License Type: Perpetual
Addon License Level: dna-premier
Addon License Type: Subscription
c8000v01#

検証時の情報

検証時の環境情報を控えておきます。

項目 情報
Public Cloud AWS
AMI Cisco Catalyst 8000V Edge Software - BYOL
Version 17.09.01a

Terraformのコード

検証時はUser Dataの頻繁な書き換えが発生するため、Terraformでシングル構成のCatalyst 8000Vをデプロイしてライセンス反映の確認を行っておりました。

検証時の構成図

参考までにTerraformのコードを掲載します。

  • Catalyst 8000VにログインするためのSSH公開鍵 ( "ssh-rsa ABCDEF...." の部分)をご自身のものに置き換えてください。

  • コード内では TechPackage:network-premier を指定しているため適宜修正してください。

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

provider "aws" {
  region = "ap-northeast-1"
  default_tags {
    tags = {
      ENV = "TEST"
    }
  }
}

resource "aws_key_pair" "keypair" {
  key_name   = "keypair_for_terraform"
  # TODO: Change Public Key
  public_key = "ssh-rsa ABCDEF...."
}

data "aws_ami" "c8000v" {
  most_recent = true
  owners      = ["aws-marketplace"]

  filter {
    name   = "name"
    values = ["Cisco-C8K-*"]
  }

  filter {
    name   = "description"
    values = ["Cisco-C8K-.17.09.01a"]
  }

  filter {
    name   = "product-code"
    values = ["3ycwqehancx46bkpb3xkifiz5"]
  }

  filter {
    name   = "state"
    values = ["available"]
  }
}

resource "aws_vpc" "myvpc" {
  cidr_block           = "10.253.0.0/16"
  enable_dns_hostnames = true
  tags = {
    Name = "myvpc"
  }
}

resource "aws_subnet" "subnet-public-1a" {
  vpc_id                  = aws_vpc.myvpc.id
  cidr_block              = "10.253.0.0/24"
  availability_zone       = "ap-northeast-1a"
  map_public_ip_on_launch = true
  tags = {
    Name = "subnet-public-1a"
  }
}

resource "aws_internet_gateway" "igw" {
  vpc_id = aws_vpc.myvpc.id
}

resource "aws_route_table" "rt-public" {
  vpc_id = aws_vpc.myvpc.id
  route {
    cidr_block = "0.0.0.0/0"
    gateway_id = aws_internet_gateway.igw.id
  }
  tags = {
    Name = "rt-public"
  }
}

resource "aws_route_table_association" "rtassoc-public-1a" {
  subnet_id      = aws_subnet.subnet-public-1a.id
  route_table_id = aws_route_table.rt-public.id
}

resource "aws_security_group" "secgrp-public" {
  name        = "secgrp-public"
  description = "For Public Subnet"
  vpc_id      = aws_vpc.myvpc.id
  ingress {
    description = "SSH"
    from_port   = 0
    to_port     = 22
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
  egress {
    from_port   = 0
    to_port     = 0
    protocol    = "-1"
    cidr_blocks = ["0.0.0.0/0"]
  }
  tags = {
    Name = "secgrp-public"
  }
}

resource "aws_network_interface" "eni-c8000v01-gi1" {
  subnet_id         = aws_subnet.subnet-public-1a.id
  security_groups   = [aws_security_group.secgrp-public.id]
  source_dest_check = false
  tags = {
    Name = "eni-c8000v01-gi1"
  }
}

resource "aws_eip" "eip-c8000v01" {
  vpc               = true
  network_interface = aws_network_interface.eni-c8000v01-gi1.id
  depends_on        = [aws_internet_gateway.igw]
  tags = {
    Name = "eip-c8000v01"
  }
}

resource "aws_instance" "c8000v01" {
  ami           = data.aws_ami.c8000v.image_id
  instance_type = "t3.medium"
  key_name      = aws_key_pair.keypair.id
  network_interface {
    network_interface_id = aws_network_interface.eni-c8000v01-gi1.id
    device_index         = 0
  }
  user_data = <<EOF
Section: License
TechPackage:network-premier

Section: IOS configuration
hostname c8000v01

EOF
  tags = {
    Name = "c8000v01"
  }
}