CML 2.9.0をOVAファイルからインストールしてみた

ProxmoxでもOVFやOVAをインポートできるようになったし、CML 2.9.0がリリースされたし、そこら辺のことを書きます。

OVF (Open Virtualization Format) は、
仮想マシンのデータを入れる「フォーマット(形式)」
→ OVF = バラバラの荷物を箱に入れた状態

OVA (Open Virtualization Appliance) は、
OVFのデータをひとまとめにした「1つのファイル」
OVA = 箱をラッピングして1つにまとめた状態

0. 事前準備

My Account でライセンスキーを控えておきます。
Home > My Orders
learningnetworkstore.cisco.com

[View License(s)]をクリックしてライセンスキーを控えておきます
続けて”Download”をクリックします。CML 2.9.0のインストールに必要なファイルをダウンロードするサイト(要CiscoログインID)にジャンプします。

CML 2.9.0 OVA、ISOをダウンロード

余談ですが、CML-Personal本来は$199.00です。ちょいちょいセールを開催しているので安くなった時を見計らって購入するとお得です。私は毎年、Cyber MondayのセールでCMLを購入しています。昨年は34%OFFで購入することができました。

1. Proxmox VE 8.3 でGUIが便利になった

CLIからしかインポートできなかったOVF,OVAGUI(Web)でインポートできるようになったそうです。
やったね!

https://pve.proxmox.com/wiki/Roadmap#Proxmox_VE_8.3 Highlights ~ 途中省略 ~ More streamlined guest import from files in Open Virtualization Format (OVF) and Open Virtualization Appliances (OVA). OVF and OVA files can be directly imported from file-based storages in the GUI. This makes it easier to import virtual appliances and simplifies migration from hypervisors supporting OVF/OVA export. Users can upload OVA files from their local machine or download them from a URL. The improved OVF/OVA importer now also recognizes the guest OS type, NICs, boot order, and boot type.

前回(https://chimay-wh.hatenablog.com/entry/2024/11/29/230904)は、Proxmox VE 8.1.3を使っていたので
OVAを使ってインポートできなかったのですが、今回はProxmox VE 8.4.0 で環境構築をします。

(。´・ω・)ん? インポートなくね?

Importメニューがない

どうやら何かしないと使えないらしい

2. Importメニューの追加

ストレージにディレクトリを追加します。

Datacenter > Storage > Directory で[Add]をクリック

ID, Directory, Content を入力し[Add]をクリック

Importメニュー追加完了

これでCML 2.9.0のOVAファイルをインポートできます。

3. OVAファイルのインポート

Datacenter > ホスト > import(ホスト) > Import で[Upload]をクリック

OVAファイルを選択し、[開く]をクリック

[Upload]をクリック

TASK OK と表示されたら右上の[×]で閉じます

Datacenter > ホスト > import(ホスト) > Import >OVAファイル選択し、[Import]をクリック

Generalタブで必要事項を入力し、[Advancedタブ]をクリック

VM ID : ご自由に
Memory : メモリの余裕は心の余裕
CPU Type : host
Name : ご自由に

AdvancedタブのSCSI ControllerでVMware PVSCSIを選択し[Import]をクリック

TASK OK と表示されたら右上の[×]で閉じます

Datacenter > ホスト > local(ホスト) > ISO Images で[Upload]をクリック

ISOファイルを選択し[開く]をクリック/figcaption>

[Upload]をクリック

TASK OK と表示されたら右上の[×]で閉じます

Datacenter > ホスト > VM ID(Hostname) > Hardware で[Add]をクリック

CD/DVD Drive を選択

ISOイメージを指定して[Add]をクリック

Bus/Device : SCSI
Use CD/DVD disc image file (iso) を選択
Storage : local
ISO image : refplat-20250616-fcs.iso

これでCML 2.9.0をインストールする準備が整いました。VMを起動するとインストールが始まります。

Datacenter > ホスト > VM ID(Hostname) > Hardware で[Start]をクリック

4. CML 2.9.0 セットアップ

以前からの手順とほぼ変わりません。途中新しいoption選択できますよ、というのがあるくらいです。

油断していて最初の画面を取り損ないました CML 2.8.0 と変わりません
放置しているとお馴染みの画面で止まります。
CML 2 Initial System Configuration で[Continue]をクリック

EULA(End User License Agreement)に同意

CML2のセットアップ概要説明が表示、[Continue]をクリック

Brrief_Help ショートカットキーの説明が表示、[Continue]をクリック

clusteringしようがしまいが、Standaloneでデプロイしますよ、[Continue]をクリック

hostnameを定義して、[Continue]をクリック

sysadminのパスワードを定義(英字キーボードになっているので記号を使う場合は要注意)

adminのパスワードを定義。(英字キーボードになっているので記号を使う場合は要注意)

CML2で使用するNICのIP方式選択画面(固定IP使いたいので[Static]を選択し[Continue]をクリック

IPv4アドレス、gatewayDNSを定義し、[Continue]をクリック

多分今までこのOption選択はなかった記憶です。OpenSSH と PATtyを後からON/OFFできるようです。

とりあえず両方有効にせず[Continue]をクリック

この設定でインストールしますよ?良いですかね?で、[Continue]をクリック

ISOファイルをCML2にコピーします。終わったらVMからISO外してOKです。[Continue]をクリック

ISOファイルをCML2にコピーしている様子が表示

全然10分も必要ない!めっちゃ早く終わりました!

初期セットアップ完了XX秒以内に指定のIPでCML2が使えます

CML 2.9.0 インストール完了

4.1. CML2 Licensing

見慣れたログイン画面は変わらず

CML-FREE と表示

ライセンスキーを登録しないとFREE-TIERのままのようです

[choose the Product Configuration]をクリック

CML-PER-BASEを選択し、[SAVE]をクリック

CML-Pが選択されましたが、未登録状態なので[REGISTER...]をクリック

ライセンスキーをコピペして、[REGISTER]をクリック

Licensing完了

画面右下の[✓ OK]をクリックするとSystem All Greeeeen!!

5. CML 2.9.0 を使ってみよう

CML 2.9.0でDockerがサポートされました

developer.cisco.com

こんなにたくさんのコンテナが使えます

これだけあれば、Routing & Switching だけでなく認証の検証、セキュリティの検証など実施できる幅が各段に広がります。

CML 2.9.0で提供されているイメージのバージョンも見ると新しいものが多いです。

CML 2.9.0で使用されているイメージのバージョン

CML2はご存じの通りhttpsでアクセスするブラウザのツールです。そのブラウザの中で更にブラウザを開くことができます。予告Youtubeで存在は知っていたものの、実際に自分で操作して目の当たりにすると感動しました。

CML2(Chrome)の中でFirefoxが起動!!(日本語文字化けしますが)

次に驚いたのは、FRRの起動の早さです!
((꜆꜄ ˙꒳˙)꜆꜄꜆ポチ(FRRを選択して右クリック[Start])で即起動完了!

FRR(Docker)は爆速で起動!!

お試しで使ってみて分かったことは、CML2をフル活用するには十分なリソース必要ということです。XRv9000動かしたかったのですが、CPUがパワー不足で4コア程度ではエラーになり起動できませんでしたし、Diskもそれなりに消費しています。

CML 2.9.0 リソース使用状況

GitHubにも色々あるようなので、少しづつ検証していきます。
github.com

最後までお読みいただきありがとうございました。

Vagrantを使ってVirtualBoxでCentos7を構築してみた

1. はじめに

2025年の書初めです。もうすぐ一月終わって豆撒きの季節がきます。何も成果を上げずに一ヶ月が経とうという現実に目を背けたくなります。

仮想マシンを立てては壊し、立てては壊しをよくするのですが、毎度GUI操作が面倒だなーと思っています。 毎度ISOファイルをダウンロードし、保存しようとしたら既に持っていたりして、我ながら管理の雑さ加減に呆れます。
何か良い方法ないかなーと思っていたら良い物がありました。
そう「Vagrant」です。これをある程度使いこなせれば、煩わしい作業が楽になるのでは?と淡い期待を抱いて検証を始めました。

2. Vagrantとは

仮想化ソフトウェア(VirtualBoxVMwareなど)を代理で操作して仮想マシンをセットアップしてくれるツールです。
(1) vagrant init コマンドでVagrantfileを作成し
(2) Vagrantfile を編集して
(3) vagrant up コマンドで仮想マシンをデプロイ

簡単にこの3ステップで仮想マシンをデプロイできます。

しかも、かなり多くのLinuxディストリビューションWindowsに対応しています。 以下のリンク先をご覧いただければ分かります。
HashiCorp Cloud Platform

今回は、VirtualBox with Vagrantで、Centos7を簡単セットアップする検証をします。

3. VirtualBox インストール

以下のリンク先からVirtualBoxをダウンロードします
Oracle VM VirtualBox - ダウンロード| Oracle Technology Network | オラクル | Oracle 日本 2025/01/26時点の最新リリースは、v7.0.22です。

ダウンロードしたら、VirtualBox-7.0.22-165102-Win.exeを管理者として実行でインストールします。 次へ、次へ、...、install、Finish、みたいな感じで特に難しいことはありません。

4. Vagrant インストール

以下のリンク先からVagrantをダウンロードします。
Install | Vagrant | HashiCorp Developer
コマンドプロンプトでCPUのアーキテクチャを確認します。

c:\>set processor
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 154 Stepping 4, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=9a04

c:\>

"PROCESSOR_ARCHITECTURE=AMD64"ということが分かったので、Vagrantも左の”AMD64”をダウンロードします。 次へ、次へ、...、install、Finish、みたいな感じで特に難しいことはありません。
最後に再起動要求があったかも知れません。いきなり再起動ではなくてタイミングを自分で選べたような気がします。

インストール後はPathを切っておきます。
(1) 「Windowsキー」+「Pauseキー」で詳細情報を開きます。
(2) システムの詳細設定をクリックします。
(3) 環境変数をクリックします。
(4) 環境変数ウィンドウの上段「環境変数」で「Path」を選択して、編集をクリックします。
(5) 「新規」をクリックし「C:\Program Files (x86)\Vagrant\bin」を入力して「OK」をクリックします。
(6) 環境変数ウィンドウの「OK」をクリックし、システムのプロパティで「OK」をクリックします。

コマンドプロンプトでPathが切れていることが確認できます。

c:\>vagrant -v
Vagrant 2.4.3

c:\>

5. 仮想マシンの条件

今回は、サポートが切れたCentos7をデプロイします。
Tera Termで操作ログを記録したいので、Tera Term接続に使うHost-onlyのNICが欲しいです。また、物理NICをブリッジ接続してパソコン外部の機器と接続するNICも欲しいです。
つまり、このような使い方をする仮想マシンをデプロイしようとしています。

図1 作りたい仮想マシンと物理デバイスの関係

余談ですが、Vagrantを使うとDefaultで、NATインターフェースを1つ作成してくれます。

つまり今回は以下の3つをデプロイするような「Vagrantfile」を編集する必要があります。
(1) NAT Network(Defaultで作成してくれるので、記載の必要はなし!)
(2) Host-only networking
(3) Bridged networking

VirtualBoxにおけるそれぞれのネットワークはマニュアルに詳しく書いてあるので説明は割愛します。 Virtual Networking
パソコンのどのインターフェースをブリッジ接続するかを調べる必要がある。
PowerShellでブリッジ接続したい「イーサネット4」のInterfaceDescriptionを調べておきます。
※ 今回使いたいUSB-NICが「イーサネット4」でした。

PS C:\> Get-NetAdapter | Where-Object { $_.InterfaceDescription -eq "Realtek USB GbE Family Controller" } | Select-Object Name, InterfaceDescription, ifIndex, Status, LinkSpeed


Name                 : イーサネット 4
InterfaceDescription : Realtek USB GbE Family Controller
ifIndex              : 92
Status               : Up
LinkSpeed            : 1 Gbps



PS C:\>

ブリッジ接続するのは、「Realtek USB GbE Family Controller」であることが分かりました。
仮想マシンのストレージは、シンプロビジョニングで128GBにしてくれるようです。
メモリとCPUは好きに指定出来るようなので、2048MBのメモリと2コアのvCPUとします。

Name:SNMPv3-Mgr-Centos7-Vagrant  <<<< 仮想マシンのホスト名でなく、VirtualBoxの管理名(指定しないとクソダサ名が付くので自分が分かる名前を付けます)
CPU :2core
RAM :2048mb
HDD :128GB                       <<<< 勝手にシンプロビジョニングされる
NIC1:NAT(10.0.2.15/24)           <<<< 勝手に作られる
NIC2:Host-only(192.168.56.20/24) <<<< Tera Term 接続用
NIC3:Bridged (172.16.0.1/24)     <<<< Realtek USB GbE Family Controller を経由してパソコン外部と接続する

6. Vagrant仮想マシンをデプロイ

PowerShellを起動して、仮想マシンをデプロイするディレクトリを作成します。プロジェクトディレクトリと呼ぶらしいです。
プロジェクトディレクトリ「C:\WORK\CentOS\CentOS7」

PS C:\> mkdir C:\WORK\CentOS\CentOS7


    ディレクトリ: C:\WORK\CentOS


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        2025/01/26     20:31                CentOS7


PS C:\> cd C:\WORK\CentOS\CentOS7

プロジェクトディレクトリに移動します。

PS C:\> cd C:\WORK\CentOS\CentOS7
PS C:\WORK\CentOS\CentOS7> dir
PS C:\WORK\CentOS\CentOS7>

vagrant init コマンドを使って「CentOS7」の「Vagrantfile」を生成します。

PS C:\WORK\CentOS\CentOS7> vagrant init generic/centos7 --box-version 4.3.12
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
PS C:\WORK\CentOS\CentOS7>
PS C:\WORK\CentOS\CentOS7> dir


    ディレクトリ: C:\WORK\CentOS\CentOS7


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        2025/01/26     20:35           3502 Vagrantfile


PS C:\WORK\CentOS\CentOS7>

Vagrantfile が生成されるので、これを編集します。

【生成されたVagrantfile】

# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://vagrantcloud.com/search.
  config.vm.box = "generic/centos7"
  config.vm.box_version = "4.3.12"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # NOTE: This will enable public access to the opened port
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine and only allow access
  # via 127.0.0.1 to disable public access
  # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"

  # Disable the default share of the current code directory. Doing this
  # provides improved isolation between the vagrant box and your host
  # by making sure your Vagrantfile isn't accessible to the vagrant box.
  # If you use this you may want to enable additional shared subfolders as
  # shown above.
  # config.vm.synced_folder ".", "/vagrant", disabled: true

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  # config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
  # end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Enable provisioning with a shell script. Additional provisioners such as
  # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2
  # SHELL
end

生成された「Vagrantfile」はコピーして「Vagrantfile - org」としておく(単なるバックアップです)

試行錯誤して「Vagrantfile」はこうなりました。

【編集後のVagrantfile(必要なものだけを記載しました)】

Vagrant.configure("2") do |config|
  config.vm.box = "generic/centos7"

# NIC 1 - NAT 10.0.2.15/24 virtualbox default 

# NIC 2 - Host-only Ethernet Adapter : For control this VM to SSH
  config.vm.network "private_network", ip: "192.168.56.20"

# NIC 3 - Bridge Ethernet Adapter : For connecting with your training partner in crime
  config.vm.network "public_network", ip: "172.16.0.1", netmask: "255.255.255.0", bridge: "Realtek USB GbE Family Controller"

# VirtualMachine's information
  config.vm.provider "virtualbox" do |vb|

# VirtualBox's console admin name
    vb.name = "SNMPv3-Mgr-Centos7-Vagrant"

# VirtualMachine's memory
    vb.memory = "2048"

# VirtualMachine's CPU
    vb.cpus = 2
  end
end

プロジェクトディレクトリには、バックアップした「Vagrantfile -org」と実際に使う「Vagrantfile」が存在しています。

PS C:\WORK\CentOS\CentOS7> dir


    ディレクトリ: C:\WORK\CentOS\CentOS7


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        2025/01/26     20:51            733 Vagrantfile
-a----        2025/01/26     20:35           3502 Vagrantfile - org


PS C:\WORK\CentOS\CentOS7>

この状態で、「vagrant up」コマンドを実行します。
初めて実行する場合は、バックグラウンドでISOをダウンロードしているようで少し時間がかかりますが、放置していればデプロイが完了します。

PS C:\WORK\CentOS\CentOS7> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'generic/centos7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'generic/centos7' version '4.3.12' is up to date...
==> default: Setting the name of the VM: SNMPv3-Mgr-Centos7-Vagrant
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
    default: Adapter 3: bridged
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)

~ 途中省略 ~

==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default:
    default: Guest Additions Version: 5.2.44
    default: VirtualBox Version: 7.0
==> default: Configuring and enabling network interfaces...
PS C:\WORK\CentOS\CentOS7>

これでもうVirtualBoxを使ったデプロイが完了して、仮想マシンが起動しています。
名前を付けたはずなのに、「default」というのが気になりますが、Vagrantが認識している名前が「default」なだけです。

PS C:\WORK\CentOS\CentOS7> vagrant status
Current machine states:

default                   running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
PS C:\WORK\CentOS\CentOS7>

VirtualBoxを起動すると、仮想マシンが起動していることが確認できます。

図2 VirtualBox - SNMPv3-Mgr-Centos7-Vagrant 実行中
指定した通りになっていることが分かります。

Name:SNMPv3-Mgr-Centos7-Vagrant  
CPU :2core
RAM :2048mb
HDD :128GB(Default)
NIC1:NAT(Default)
NIC2:ホストオンリーアダプター
NIC3:ブリッジアダプター "Realtek USB GbE Family Controller"

7. 仮想マシンssh接続

vagrant ssh」コマンドでssh接続できます。
ID/Passwdは「vagrant/vagrant」なのですが、このコマンドでログインすると認証なしで接続できます。

PS C:\WORK\CentOS\CentOS7> vagrant ssh
[vagrant@centos7 ~]$
[vagrant@centos7 ~]$ uname -n
centos7.localdomain
[vagrant@centos7 ~]$ ip -br a
lo               UNKNOWN        127.0.0.1/8
eth0             UP             10.0.2.15/24
eth1             UP             192.168.56.20/24 fe80::a00:27ff:fe08:1866/64
eth2             UP             172.16.0.1/24 fe80::a00:27ff:fef6:4123/64
[vagrant@centos7 ~]$

操作ログを記録したいので、Tera Termで接続します。
ID/Passwdは「vagrant/vagrant」なのですが、ログインできません。

図3 パスワード認証失敗

Vagrant仮想マシンをデプロイすると、SSHをするにはパスワード認証ではなく、
秘密鍵を使った認証だけが出来るようになっています。

PS C:\WORK\CentOS\CentOS7> vagrant ssh-config
Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile C:/WORK/CentOS/CentOS7/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL
  PubkeyAcceptedKeyTypes +ssh-rsa
  HostKeyAlgorithms +ssh-rsa

PS C:\WORK\CentOS\CentOS7>

秘密鍵のありかは...↓
「 C:/WORK/CentOS/CentOS7/.vagrant/machines/default/virtualbox/private_key 」です。

図4 秘密鍵を選択する「...」

図5 秘密鍵(private_key)を選んで「開く」

図6 秘密鍵が選択された

図7 Tera Termでsshログインに成功

ヽ(; ゚д゚)ノ ビクッ!!
何か見覚えのないIPでアクセスされている!?何事?

Last login: Sun Jan 26 12:09:45 2025 from 10.0.2.2

10.0.2.2 って誰?

VirtualBoxのマニュアルに書いてありました。
Chapter 9. Advanced Topics

攻撃された訳ではなく、PowerShellからログインしていた己でしたw

図8 「だ~れだ?」「えっ!?誰?・・・俺かww」(ボケてから引用した画像)

毎度、秘密鍵を指定してログインするのは面倒なので、パスワード認証に変更します。

sudo sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config

/etc/ssh/sshd_config を編集したので、サービスを再起動します。

[vagrant@centos7 ~]$ sudo systemctl restart sshd
[vagrant@centos7 ~]$
[vagrant@centos7 ~]$ sudo systemctl status sshd
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2025-01-26 12:35:21 UTC; 12s ago
     Docs: man:sshd(8)
           man:sshd_config(5)
 Main PID: 2950 (sshd)
   CGroup: /system.slice/sshd.service
           mq2950 /usr/sbin/sshd -D -u0

Jan 26 12:35:21 centos7.localdomain systemd[1]: Stopped OpenSSH server daemon.
Jan 26 12:35:21 centos7.localdomain systemd[1]: Starting OpenSSH server daemon...
Jan 26 12:35:21 centos7.localdomain sshd[2950]: Server listening on 0.0.0.0 port 22.
Jan 26 12:35:21 centos7.localdomain sshd[2950]: Server listening on :: port 22.
Jan 26 12:35:21 centos7.localdomain systemd[1]: Started OpenSSH server daemon.
[vagrant@centos7 ~]$

これで、以後はパスワード認証でログインできるようになります。

8. おわりに

Vagrantは面倒なGUI操作を減らして簡単に仮想マシンをデプロイするのに大変便利です。 GUI操作だと1台づつしか作れませんが、VagrantCLI操作なので並行して何台も仮想マシンをデプロイすることもできるのではないでしょうか。(試してはいませんが)

最後までお読みいただき、ありがとうございました。

CML2 Free TierをProxmoxに構築してみた

1.はじめに

CML2のライセンスが切れた! 私は毎年、Cyber MondayのセールでCMLを購入しています。
昨年は11/27、一昨年は11/29といった感じで11月末の恒例行事でした。
今年は若干ズレて12/3の深夜です。ちょっと間が空いてしまいます。 今買うの得策ではない!だが、検証はしたい!

運の良いことに最近無償版のCMLが提供されました。これを使えば良いということで早速試してみます。
https://learningnetwork.cisco.com/s/question/0D56e0000E3OcmbCQC/cml-28-free-tier

2.実行環境

箱:CPU-1sockets,20cores, MEM-64GB
Proxmox VE 8.1.3
CML Release 2.8.0 Free Tier

3.準備

CiscoからCMLのソフトウェアをダウンロードします。
https://software.cisco.com/download/home/286193282/type/286326381/release/2.8.0%20Free%20Tier
※ 要Ciscoアカウントによるログイン
① cml2_f_2.8.0-6_amd64-32-iso.zip
→ CML2.8.0 Free-Tierのイメージ
② refplat-20241016-freetier-iso.zip
→ ノードイメージ
※ ZIPは解凍します。

4.CML登録

  1. 先ほどダウンロードしたファイルをProxmoxにアップロードします。
    [local(host)] > [ISO Images] > [Upload] > Select File > Upload

    アップロード完了後のポップアップ画面は閉じます。

    ファイルをアップロード完了した状態はこのようになります。

    ① cml2_f_2.8.0-6_amd64-32-iso
    ② refplat-20241016-freetier-iso

  2. ノード作成
    [Node] -> [Create VM]

3.ホスト名登録
CML2.8.0.FREEとしました

4.OS設定
先ほどダウンロードしたcml2_2.8.0-6_amd64-32.isoを登録します。

5.System設定
BIOS はOVMF(UEFI)とし、EFI Storageはlocal-lvmを選択します。

6.Disks設定
Disk Sizeを設定します。今回はお試しなので100GBとしています。

7.CPU設定
Socket,Coresも必要な分を割り当てます。また、Typeはhostにします。

8.Memory設定
必要な容量をMemoryに設定します。
64GB割り当てたいので、1024×64=65536

9.Network設定
Bridge(vmbr0)、Model(VirtIO (paravirtualized)を設定します。

10.設定確認 設定内容が問題ないか確認し、[Finish]で完了します。


CD/DVDが足りないのに気付きました!

11.ノードイメージ用のISOを追加するの失念しておりました。追加します。

初期セットアップの準備が出来ました!

5.CML初期セットアップ

ノードを起動すればセットアップが走ります。
VM ID(hostname)> Console > Start Now

インストールシェルの実行を見守ります。放置していれば、初期セットアップ画面で止まるはずです。

キター!

ココまで来ればもう出来たも同然です!

規約に同意します。

続行します。

Brief Help も続行します。

クラスタリングとか今はどうでもいい!無視します!続行です。

ホスト名を入力して続行します。
Default ホスト名はDefault cml-controllerです。 cml2.8.0freeと名付けました。

怒られました。チッ(・д・)

改めてホスト名は、cml-freeと名付けました。

罠があります。キーボードに気を付けて!
パスワードに記号を使う場合は要注意です! 私のセットアップは日本語キーボードを使っていましたが、USキーボードでセットアップが進んでいました。

sysadmin(CMLのメンテナンスで使うユーザ)のパスワードを入力します。

admin(通常使うユーザ)のパスワードを入力します。

CMLのネットワークを設定します。DefaultはDHCPですが、私は固定IPを使いたいので変更します。

IPv4を設定します。ご自身の利用環境に合わせてください。
例)IP 192.168.2.21, 255.255.255.0, GW 192.168.2.1, DNS 8.8.8.8

間違いがないか最後の確認です。

用が済んだらノードイメージのISOは削除してね!(ry

ステータスバーあると安心しますね。終わるのを待ちます。

お急ぎの方はカウントダウンが終わる前に< OK >押下します。
CMLを利用するためのURLも表示されます。

CMLのセットアップが完了しました。

6.CMLログイン

ブラウザからログインします。

https:// CML初期セットアップで指定したIPアドレス/

ログイン成功!

必須では無いようですが、登録しておくとお得な情報を連絡してくれると思います。

7.ノードイメージ追加

Release 2.8.0 Free Tier で提供されるイメージはこれです。

これでも十分検証はできるのですが、私はIOS-XRを使いたいのでイメージを追加します。
追加するイメージは頑張って入手してください。
手前味噌で恐縮ですが、これを見ながら実施すれば追加できるはずです。
chimay-wh.hatenablog.com

と思ったのですが、その前に一手間必要なようです。

Release 2.8.0 Free Tier には、赤枠のIOS XRv 9000はありません。
キャプチャ取り忘れてしまいました。

追加の一手間とは、NODE DEFINITIONSを追加することです。

スライドバーを見れば分かると思いますが、手入力で定義するのは出来なくはなさそうだけど、面倒なのは目に見えています。時間は有限なので、ググって楽をしましょう。

ググれば、iosxrv9000の定義ファイルは手に入ります。
内容は以下のようなものです。

【iosxrv9000.yaml】▼ググれば見つかります

id: iosxrv9000
configuration:
  generator:
    driver: iosxrv9000
  provisioning:
    volume_name: config
    media_type: iso
    files:
      - name: iosxr_config.txt
        editable: true
        content: |-
          hostname inserthostname-here
          username cisco
          group root-lr
          group cisco-support
          password cisco
          !
          username admin
          group root-lr
          group cisco-support
          password cisco
          !
          username lab
          group root-lr
          group cisco-support
          password cisco
          !
          end
device:
  interfaces:
    has_loopback_zero: true
    min_count: 3
    default_count: 4
    loopback:
      - Loopback0
    management:
      - MgmtEth0/RP0/CPU0/0
    physical:
      - MgmtEth0/RP0/CPU0/0
      - donotuse1
      - donotuse2
      - GigabitEthernet0/0/0/0
      - GigabitEthernet0/0/0/1
      - GigabitEthernet0/0/0/2
      - GigabitEthernet0/0/0/3
      - GigabitEthernet0/0/0/4
      - GigabitEthernet0/0/0/5
      - GigabitEthernet0/0/0/6
      - GigabitEthernet0/0/0/7
      - GigabitEthernet0/0/0/8
      - GigabitEthernet0/0/0/9
      - GigabitEthernet0/0/0/10
      - GigabitEthernet0/0/0/11
      - GigabitEthernet0/0/0/12
      - GigabitEthernet0/0/0/13
      - GigabitEthernet0/0/0/14
      - GigabitEthernet0/0/0/15
      - GigabitEthernet0/0/0/16
      - GigabitEthernet0/0/0/17
      - GigabitEthernet0/0/0/18
      - GigabitEthernet0/0/0/19
      - GigabitEthernet0/0/0/20
      - GigabitEthernet0/0/0/21
      - GigabitEthernet0/0/0/22
      - GigabitEthernet0/0/0/23
      - GigabitEthernet0/0/0/24
      - GigabitEthernet0/0/0/25
      - GigabitEthernet0/0/0/26
      - GigabitEthernet0/0/0/27
      - GigabitEthernet0/0/0/28
      - GigabitEthernet0/0/0/29
      - GigabitEthernet0/0/0/30
    serial_ports: 4
inherited:
  image:
    ram: true
    cpus: true
    cpu_limit: true
    data_volume: false
    boot_disk_size: false
  node:
    ram: true
    cpus: true
    cpu_limit: true
    data_volume: false
    boot_disk_size: false
general:
  description: Cisco IOS XRv 9000 Router platform
  nature: router
  read_only: true
schema_version: 0.0.1
sim:
  linux_native:
    cpus: 4
    disk_driver: virtio
    driver: iosxrv9000
    libvirt_domain_driver: kvm
    nic_driver: virtio
    ram: 20480
    cpu_limit: 100
boot:
  timeout: 3600
  completed:
    - '--- Administrative User Dialog ---'
    - '%MGBL-CVAC-4-CONFIG_DONE'
pyats:
  os: iosxr
  series: iosxrv9k
  config_extract_command: show running-config
ui:
  description: |-
    Cisco IOS XRv 9000 Router platform

    It is recommended to use 20 GB and 4 vCPUs.
    At a very minimum, 10 GB of DRAM and 2 vCPUs are required.

    ##### Note
    The first data interface is the **4th interface**:
    - The first interface is management,
    - second and third are marked as 'do not use' and should not be connected to anything
    - The next interfaces are actual data interfaces.

    [CCO Link](https://www.cisco.com/c/en/us/support/routers/ios-xrv-9000-router/tsd-products-support-series-home.html)
  group: Cisco
  icon: router
  label: IOS XRv 9000
  label_prefix: xr9kv-
  visible: true

iosxrv9000.yamlが手に入っている前提で進めます。
CMLの画面右上にある TOOLS > Node and Image Definitions をクリックします。

右上のIMPORTをクリックします。

Node Definition をクリックして、iosxrv9000.yamlを選択します。

サクッと追加されるので、GO TO NODE DEFINITIONをクリックします。

ここまでを先に実施しておかないと、イメージを追加する時にNode DefinitionからIOS XRv 9000を選べないと思うので積みます。追加がうまくいけばこうなるはずです。

あとは、IOS XRv 9000のイメージを追加すればOKです。

8.検証

IOS XRv 9000のイメージ追加もできたので、SRv6の検証をしました。
検証内容は後日公開します。鋭意作成中であります。

9.おわりに

CML Release 2.8.0 Free Tier は5ノード制限がありますが、お試しで使ってから、もっとノード増やしたいと思ったら有償ライセンスを買えば良いと思います。

ただ買うなら安くしたいですよね。一年間使えるとは言え、税抜きで$199.00は安くはないですから!

Cyber Mondayのセール活用すれば更にお安く手に入りますよ!
https://blogs.cisco.com/learning/learning-deals-2024

日本時間ですと、12月3日の午前1時から午前5時で通常の40% offで購入できます。
$199.00 ー- Cyber Monday 40% off ーー> $119.40

最後までお読みいただき、ありがとうございました。

Single-Domain SR-TE その10(On Demand Next-hop:ODN with L3VPN)

On Demand Next-hop:ODN with L3VPN が理解できたので自分のメモ用にアウトプットします。

1. On Demand Next-hop:ODN

ODNはSR-PolicyのInstance化を自動化するもので、指定の Prefix をオンデマンドに SR-TE に反映します。
今回は、Dynamic SR-TE を使ったODN(L3VPN)を検証します。

2. Topology

3. Config

◆h_N1

hostname h_N1
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
vrf A
 rd 10:1
 address-family ipv4 unicast
  import route-target
   200:1
  !
  export route-target
   100:1
  !
 !
!
interface Loopback0
 ipv4 address 1.1.1.1 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.2.1 255.255.255.0
!
interface GigabitEthernet0/0/0/1.20
 vrf A    
 ipv4 address 198.51.100.1 255.255.255.0
 encapsulation dot1q 20
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.1.3.1 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 shutdown
!
interface GigabitEthernet0/0/0/4
 shutdown
!
route-policy PASS
  pass
end-policy
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0001.00
 distribute link-state level 2
 address-family ipv4 unicast
  mpls traffic-eng level-2-only
  mpls traffic-eng router-id Loopback0
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 1
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/2
 !
!
router bgp 10
 bgp router-id 1.1.1.1
 address-family vpnv4 unicast
 !
 neighbor 6.6.6.6
  remote-as 10
  update-source Loopback0
  address-family vpnv4 unicast
  !
 !
 vrf A
  rd 10:1
  address-family ipv4 unicast
  !
  neighbor 198.51.100.100
   remote-as 100
   address-family ipv4 unicast
    route-policy PASS in
    route-policy PASS out
   !
  !
 !
!
mpls oam
!
segment-routing
 traffic-eng
  on-demand color 10
   dynamic
    metric
     type te
    !
   !
  !
  on-demand color 20
   dynamic
    metric
     type igp
    !
   !
  !
  on-demand color 30
   dynamic
    metric
     type latency
    !
   !
  !
  on-demand color 40
   dynamic
    metric
     type hopcount
    !
   !      
  !
 !
!
mpls label range table 0 1001001 1001999
end

◆h_N2

hostname h_N2
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 2.2.2.2 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.2.2 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.2.3.2 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.2.4.2 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 shutdown
!
interface GigabitEthernet0/0/0/4
 shutdown
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0002.00
 address-family ipv4 unicast
  mpls traffic-eng level-2-only
  mpls traffic-eng router-id Loopback0
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 2
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
  address-family ipv4 unicast
   metric 15
  !
 !
!
mpls oam
!
segment-routing
 traffic-eng
  interface GigabitEthernet0/0/0/2
   metric 15
  !       
 !
!
performance-measurement
 interface GigabitEthernet0/0/0/2
  delay-measurement
   advertise-delay 5
  !
 !
!
end

◆h_N3

hostname h_N3
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 3.3.3.3 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.3.3 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.2.3.3 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.3.5.3 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 ipv4 address 10.3.4.3 255.255.255.0
!
interface GigabitEthernet0/0/0/4
 shutdown
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0003.00
 address-family ipv4 unicast
  mpls traffic-eng level-2-only
  mpls traffic-eng router-id Loopback0
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 3
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
  address-family ipv4 unicast
   metric 15
  !
 !
 interface GigabitEthernet0/0/0/3
  address-family ipv4 unicast
   metric 19
  !
 !
!
mpls oam
!         
segment-routing
 traffic-eng
  interface GigabitEthernet0/0/0/2
   metric 20
  !
  interface GigabitEthernet0/0/0/3
   metric 8
  !
 !
!
performance-measurement
 interface GigabitEthernet0/0/0/2
  delay-measurement
   advertise-delay 20
  !
 !
 interface GigabitEthernet0/0/0/3
  delay-measurement
   advertise-delay 7
  !
 !
!
end 

◆h_N4

hostname h_N4
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 4.4.4.4 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.2.4.4 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.4.5.4 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.4.6.4 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 ipv4 address 10.3.4.4 255.255.255.0
!
interface GigabitEthernet0/0/0/4
 shutdown
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0004.00
 address-family ipv4 unicast
  mpls traffic-eng level-2-only
  mpls traffic-eng router-id Loopback0
 !
 interface Loopback0
  prefix-attributes anycast
  address-family ipv4 unicast
   prefix-sid index 4
  !
 !
 interface GigabitEthernet0/0/0/0
  address-family ipv4 unicast
   metric 15
  !
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
 interface GigabitEthernet0/0/0/3
  address-family ipv4 unicast
   metric 19
  !
 !
!
mpls oam  
!
segment-routing
 traffic-eng
  interface GigabitEthernet0/0/0/0
   metric 15
  !
  interface GigabitEthernet0/0/0/3
   metric 8
  !
 !
!
performance-measurement
 interface GigabitEthernet0/0/0/0
  delay-measurement
   advertise-delay 5
  !
 !
 interface GigabitEthernet0/0/0/3
  delay-measurement
   advertise-delay 7
  !
 !
!         
end

◆h_N5

hostname h_N5
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 5.5.5.5 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.3.5.5 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.4.5.5 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.5.6.5 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 shutdown
!
interface GigabitEthernet0/0/0/4
 shutdown
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0005.00
 address-family ipv4 unicast
  mpls traffic-eng level-2-only
  mpls traffic-eng router-id Loopback0
 !
 interface Loopback0
  prefix-attributes anycast
  address-family ipv4 unicast
   prefix-sid index 5
  !
 !
 interface GigabitEthernet0/0/0/0
  address-family ipv4 unicast
   metric 15
  !
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
!
mpls oam
!
segment-routing
 traffic-eng
  interface GigabitEthernet0/0/0/0
   metric 20
  !
 !
!
performance-measurement
 interface GigabitEthernet0/0/0/0
  delay-measurement
   advertise-delay 20
  !
 !
!
end

◆h_N6

hostname h_N6
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
vrf B
 rd 10:6
 address-family ipv4 unicast
  import route-target
   100:1
  !
  export route-target
   200:1
  !
 !
!
interface Loopback0
 ipv4 address 6.6.6.6 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.4.6.6 255.255.255.0
!
interface GigabitEthernet0/0/0/1.30
 vrf B
 ipv4 address 203.0.113.6 255.255.255.0
 encapsulation dot1q 30
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.5.6.6 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 shutdown
!
interface GigabitEthernet0/0/0/4
 shutdown
!
extcommunity-set opaque COLOR_10_TE
  10
end-set
!
extcommunity-set opaque COLOR_20_IGP
  20
end-set
!
extcommunity-set opaque COLOR_30_DELAY
  30
end-set
!
extcommunity-set opaque COLOR_40_HOPCOUNT
  40
end-set
!
route-policy PASS
  pass
end-policy
!
route-policy SET_COLOR_HI_BW
  set extcommunity color COLOR_20_IGP
  pass
end-policy
!
route-policy SET_COLOR_GLOBAL
  if destination in (2.2.2.10/32) then
    set extcommunity color COLOR_10_TE
  elseif destination in (2.2.2.20/32) then
    set extcommunity color COLOR_20_IGP
  elseif destination in (2.2.2.30/32) then
    set extcommunity color COLOR_30_DELAY
  elseif destination in (2.2.2.40/32) then
    set extcommunity color COLOR_40_HOPCOUNT
  endif
end-policy
!
route-policy SET_COLOR_HOPCOUNT
  set extcommunity color COLOR_40_HOPCOUNT
  pass
end-policy
!
route-policy SET_COLOR_LOW_LATENCY
  set extcommunity color COLOR_30_DELAY
  pass
end-policy
!
route-policy SET_COLOR_LOW_LATENCY_TE
  set extcommunity color COLOR_10_TE
  pass
end-policy
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0006.00
 address-family ipv4 unicast
  mpls traffic-eng level-2-only
  mpls traffic-eng router-id Loopback0
 !        
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 6
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/2
 !
!
router bgp 10
 bgp router-id 6.6.6.6
 address-family vpnv4 unicast
 !
 neighbor 1.1.1.1
  remote-as 10
  update-source Loopback0
  address-family vpnv4 unicast
   route-policy SET_COLOR_GLOBAL out
  !
 !
 vrf B
  rd 10:6 
  address-family ipv4 unicast
  !
  neighbor 203.0.113.200
   remote-as 200
   address-family ipv4 unicast
    route-policy PASS in
    route-policy PASS out
   !
  !
 !
!
mpls oam
!
segment-routing
 traffic-eng
 !
!
mpls label range table 0 1006001 1006999
end

◆h_CE1

hostname CE1
!
no ip domain lookup
!
interface Loopback0
 ip address 100.100.100.100 255.255.255.255
!
interface Loopback110
 ip address 1.1.1.10 255.255.255.255
!
interface GigabitEthernet1
 no ip address
!
interface GigabitEthernet1.10
 encapsulation dot1Q 10
 ip address 192.0.2.100 255.255.255.0
!
interface GigabitEthernet1.20
 encapsulation dot1Q 20
 ip address 198.51.100.100 255.255.255.0
!
router bgp 100
 bgp router-id 100.100.100.100
 bgp log-neighbor-changes
 network 1.1.1.10 mask 255.255.255.255
 neighbor 198.51.100.1 remote-as 10
!
line con 0
 exec-timeout 0 0
!
end

◆h_CE2

hostname CE2
!
no ip domain lookup
!
interface Loopback0
 ip address 200.200.200.200 255.255.255.255
!
interface Loopback210
 ip address 2.2.2.10 255.255.255.255
!
interface Loopback220
 ip address 2.2.2.20 255.255.255.255
!
interface Loopback230
 ip address 2.2.2.30 255.255.255.255
!
interface Loopback240
 ip address 2.2.2.40 255.255.255.255
!
interface GigabitEthernet1
 no ip address
!
interface GigabitEthernet1.10
 encapsulation dot1Q 10
 ip address 192.0.2.200 255.255.255.0
!
interface GigabitEthernet1.30
 encapsulation dot1Q 30
 ip address 203.0.113.200 255.255.255.0
!
router bgp 200
 bgp router-id 200.200.200.200
 bgp log-neighbor-changes
 network 2.2.2.10 mask 255.255.255.255
 network 2.2.2.20 mask 255.255.255.255
 neighbor 203.0.113.6 remote-as 10
!
line con 0
 exec-timeout 0 0
!
end

4.下準備(各種メトリックの仕込み)

4.1 IGP(Default 10)

IGP で interface を指定して定義します。
e.g. h_N2's GigabitEthernet0/0/0/2 で IGP(ISIS)のメトリックを定義

RP/0/RP0/CPU0:h_N2(config)#router isis 1
RP/0/RP0/CPU0:h_N2(config-isis)#interface gigabitEthernet 0/0/0/2
RP/0/RP0/CPU0:h_N2(config-isis-if)#address-family ipv4 unicast 
RP/0/RP0/CPU0:h_N2(config-isis-if-af)#metric 15
RP/0/RP0/CPU0:h_N2(config-isis-if-af)#
RP/0/RP0/CPU0:h_N2(config-isis-if-af)#commit

4.2 Latency(Default 10)

performance-measurement で interface を指定して定義します。
e.g. h_N2's GigabitEthernet0/0/0/2 で advertise-delay を定義

RP/0/RP0/CPU0:h_N2(config)#?
  performance-measurement    Enter the Performance Measurement submode
RP/0/RP0/CPU0:h_N2(config-perf-meas)#?
  interface           Enable Performance Measurement on an interface
RP/0/RP0/CPU0:h_N2(config-perf-meas)#interface gigabitEthernet 0/0/0/2
RP/0/RP0/CPU0:h_N2(config-pm-intf)#?
  delay-measurement   Enable delay-measurement on the interface
RP/0/RP0/CPU0:h_N2(config-pm-intf)#delay-measurement ?
  advertise-delay  Advertisement delay
  delay-profile    Interface delay profile
  <cr>             
RP/0/RP0/CPU0:h_N2(config-pm-intf)#delay-measurement advertise-delay ?
  <1-16777215>  Advertisement delay (uSec)
RP/0/RP0/CPU0:h_N2(config-pm-intf)#delay-measurement advertise-delay 5
RP/0/RP0/CPU0:h_N2(config-pm-intf)#show
Sat Mar 25 12:19:52.100 UTC
performance-measurement
 interface GigabitEthernet0/0/0/2
  delay-measurement
   advertise-delay 5
  !
 !
!

4.3 Traffic-engineering(TE:Default 10)

Segment Routing の Traffic-engineering で interface を指定して定義します。
e.g. h_N2's GigabitEthernet0/0/0/2 で TE のメトリックを定義

RP/0/RP0/CPU0:h_N2(config)#?  
  segment-routing            Segment Routing
RP/0/RP0/CPU0:h_N2(config)#segment-routing 
RP/0/RP0/CPU0:h_N2(config-sr)#?
  traffic-eng         Segment Routing Traffic Engineering
RP/0/RP0/CPU0:h_N2(config-sr)#traffic-eng 
RP/0/RP0/CPU0:h_N2(config-sr-te)#?
  interface           Enable SR-TE on an interface(cisco-support)
RP/0/RP0/CPU0:h_N2(config-sr-te)#interface gigabitEthernet 0/0/0/2
RP/0/RP0/CPU0:h_N2(config-sr-if)#?
  metric              Interface TE metric configuration
RP/0/RP0/CPU0:h_N2(config-sr-if)#metric 5
RP/0/RP0/CPU0:h_N2(config-sr-if)#
RP/0/RP0/CPU0:h_N2(config-sr-if)#show
Sat Mar 25 12:25:44.443 UTC
segment-routing
 traffic-eng
  interface GigabitEthernet0/0/0/2
   metric 5
  !
 !
!

RP/0/RP0/CPU0:h_N2(config-sr-if)#

残りのノードもトポロジ図で指定した通りに定義します。

5. ODN の実装

実装の流れは、①全ノードでSegment Routing の Traffic-engineering 有効にしてから ②Head-End で LSDBの情報をSR-TE DBに投入します。 また、③Head-End で ODN の Color を定義します。④ End-point で extcommunity を定義し、⑤ route-policy を用いて Color を定義します。 ⑥ SR-TE で定義したい宛先 Prefix と ODN を紐づけるための route-policy を定義して、⑦ 最後に End-point で BGP の neighbor に対して outbound 方向で ⑥の route-policy を定義します。

5.1 全ノード共通

①IGPでSegment Routing を有効にします。
忘れずに Loopback0 で prefix-sid index X を有効化します。

 router isis '.*'
  net 49.0001.0000.0000.000X.00
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface Loopback 0
   address-family ipv4 unicast
    prefix-sid index X
   !
  !
 !

②IGP で Traffic-engineering 有効にします。 ISIS の場合、IGP のレベルと TE のレベルを合わせます。今回の場合は、level-2-only です。

RP/0/RP0/CPU0:h_N2(config)#router isis 1 
RP/0/RP0/CPU0:h_N2(config-isis)#address-family ipv4 unicast 
RP/0/RP0/CPU0:h_N2(config-isis-af)#?
  mpls                            Configure MPLS routing protocol parameters
RP/0/RP0/CPU0:h_N2(config-isis-af)#mpls ?
  traffic-eng  Routing protocol commands for MPLS Traffic Engineering
RP/0/RP0/CPU0:h_N2(config-isis-af)#mpls traffic-eng ?
  level-2-only      Enable mpls traffic-eng at level 2
RP/0/RP0/CPU0:h_N2(config-isis-af)#mpls traffic-eng level-2-only 
RP/0/RP0/CPU0:h_N2(config-isis-af)#mpls ?
  traffic-eng  Routing protocol commands for MPLS Traffic Engineering
RP/0/RP0/CPU0:h_N2(config-isis-af)#mpls traffic-eng ?
  router-id         Traffic Engineering stable IP address for system
RP/0/RP0/CPU0:h_N2(config-isis-af)#mpls traffic-eng router-id ?
  Loopback         Loopback interface(s) | short name is Lo
RP/0/RP0/CPU0:h_N2(config-isis-af)#mpls traffic-eng router-id Loopback 0
RP/0/RP0/CPU0:h_N2(config-isis-af)#show
Sat Mar 25 12:43:39.055 UTC
router isis 1
 address-family ipv4 unicast
  mpls traffic-eng level-2-only
  mpls traffic-eng router-id Loopback0
 !
!

RP/0/RP0/CPU0:h_N2(config-isis-af)#

③ グローバルで Segment Routing の Traffic-engineering 有効にします。

RP/0/RP0/CPU0:h_N2(config)#?
  segment-routing            Segment Routing
RP/0/RP0/CPU0:h_N2(config)#segment-routing ?
  traffic-eng     Segment Routing Traffic Engineering
RP/0/RP0/CPU0:h_N2(config)#segment-routing traffic-eng 
RP/0/RP0/CPU0:h_N2(config-sr-te)#
RP/0/RP0/CPU0:h_N2(config-sr-te)#show 
Sat Mar 25 12:50:31.803 UTC
segment-routing
 traffic-eng
 !
!

RP/0/RP0/CPU0:h_N2(config-sr-te)#

5.2 Head-End(h_N1)

5.2.1 LSDBの情報をSR-TE DBに投入

IGP で以下のコマンドを定義します。ISIS のインターフェースレベルに合わせます。

RP/0/RP0/CPU0:h_N1(config)#router isis 1
RP/0/RP0/CPU0:h_N1(config-isis)#?
  distribute            Distribute routing information to external services
RP/0/RP0/CPU0:h_N1(config-isis)#distribute ?
  link-state  Distribute the link-state database to external services
RP/0/RP0/CPU0:h_N1(config-isis)#distribute link-state ?
  level        Set distribution for one level only
RP/0/RP0/CPU0:h_N1(config-isis)#distribute link-state level ?     
  <1-2>  Level
RP/0/RP0/CPU0:h_N1(config-isis)#distribute link-state level 2 
RP/0/RP0/CPU0:h_N1(config-isis)#

5.2.2 On Demand Next-hop:ODN の定義

ODN を以下のように定義します。
a) Color:10 / type:te
b) Color:20 / type:igp
c) Color:30 / type:latency
d) Color:40 / type:hopcount

RP/0/RP0/CPU0:h_N1(config)#segment-routing traffic-eng 
RP/0/RP0/CPU0:h_N1(config-sr-te)#?
  on-demand           On-Demand configuration
RP/0/RP0/CPU0:h_N1(config-sr-te)#on-demand ?
  color  On-Demand color configuration
RP/0/RP0/CPU0:h_N1(config-sr-te)#on-demand color ?
  <1-4294967295>  color value
RP/0/RP0/CPU0:h_N1(config-sr-te)#on-demand color 10
RP/0/RP0/CPU0:h_N1(config-sr-te-color)#?
  dynamic                  Dynamically computed path
RP/0/RP0/CPU0:h_N1(config-sr-te-color)#dynamic 
RP/0/RP0/CPU0:h_N1(config-sr-te-color-dyn)#?
  metric                 Specify the path computation metric options
RP/0/RP0/CPU0:h_N1(config-sr-te-color-dyn)#metric 
RP/0/RP0/CPU0:h_N(config-sr-te-color-dyn-mpls-metric)#type ?
  hopcount  Use the least number of hops for path computation
  igp       Use the IGP metric for path computation
  latency   Use the measured latency metric for path computation
  te        Use the TE metric for path computation
RP/0/RP0/CPU0:h_N(config-sr-te-color-dyn-mpls-metric)#type te ?
  <cr>  
RP/0/RP0/CPU0:h_N(config-sr-te-color-dyn-mpls-metric)#type te 
RP/0/RP0/CPU0:h_N(config-sr-te-color-dyn-mpls-metric)#root
RP/0/RP0/CPU0:h_N1(config)#seg tr 
RP/0/RP0/CPU0:h_N1(config-sr-te)#on-demand color 20
RP/0/RP0/CPU0:h_N1(config-sr-te-color)#dynamic metric 
RP/0/RP0/CPU0:h_N(config-sr-te-color-dyn-mpls-metric)#type igp
RP/0/RP0/CPU0:h_N(config-sr-te-color-dyn-mpls-metric)#root
RP/0/RP0/CPU0:h_N1(config)#seg tr on-demand color 30 dynamic metric type laten$
RP/0/RP0/CPU0:h_N1(config)#seg tr on-demand color 40 dy met type hopcount 
RP/0/RP0/CPU0:h_N1(config)#commit 

5.3 End-point(h_N6)

5.3.1 extended community 定義

① extended community を以下のように定義します。
COLOR_10_TE :10 → metric te 用
COLOR_20_IGP :20 → metric igp 用
COLOR_30_DELAY :30 → metric latency 用
COLOR_40_HOPCOUNT :40 → metric hopcount 用

RP/0/RP0/CPU0:h_N6(config)#?
  extcommunity-set           Define an extended community set
RP/0/RP0/CPU0:h_N6(config)#extcommunity-set ?
  opaque     MLDP opaque types
RP/0/RP0/CPU0:h_N6(config)#extcommunity-set opaque ?
  WORD  Opaque type extcommunity set name
RP/0/RP0/CPU0:h_N6(config)#extcommunity-set opaque COLOR_10_TE
RP/0/RP0/CPU0:h_N6(config-ext)#?
  <1-4294967295>  32-bit decimal number
RP/0/RP0/CPU0:h_N6(config-ext)#10
RP/0/RP0/CPU0:h_N6(config-ext)#end-set 

5.3.2 Color assignment 定義

① extended community に紐づける Color を route-policy で以下のように定義します。

a) metric TE 重視の route-policy
→ SET_COLOR_LOW_LATENCY_TE:COLOR_10_TE
b) Bandwidth 重視の route-policy
→ SET_COLOR_HI_BW :COLOR_20_IGP
c) Delay 重視の route-policy
→ SET_COLOR_LOW_LATENCY :COLOR_30_DELAY
d) hopcount 重視の route-policy → SET_COLOR_HOPCOUNT :COLOR_40_HOPCOUNT

RP/0/RP0/CPU0:h_N6(config)#?            
  route-policy               Define a route policy
RP/0/RP0/CPU0:h_N6(config)#route-policy ?
  WORD                      Route Policy name
RP/0/RP0/CPU0:h_N6(config)#route-policy SET_COLOR_LOW_LATENCY_TE 
RP/0/RP0/CPU0:h_N6(config-rpl)#?
  set               Set a route attribute
RP/0/RP0/CPU0:h_N6(config-rpl)#set ?            
  extcommunity             BGP extended community attribute
RP/0/RP0/CPU0:h_N6(config-rpl)#set extcommunity ?
  color           BGP Color extended community
RP/0/RP0/CPU0:h_N6(config-rpl)#set extcommunity color ?
  COLOR_10_TE        Opaque type extcommunity set name
  COLOR_20_IGP       Opaque type extcommunity set name
  COLOR_30_DELAY     Opaque type extcommunity set name
  COLOR_40_HOPCOUNT  Opaque type extcommunity set name
  WORD               Opaque type extcommunity set name
RP/0/RP0/CPU0:h_N6(config-rpl)#set extcommunity color COLOR_10_TE 
RP/0/RP0/CPU0:h_N6(config-rpl)#?
  pass              Pass this route for further processing
RP/0/RP0/CPU0:h_N6(config-rpl)#pass ?
  <cr>  
RP/0/RP0/CPU0:h_N6(config-rpl)#pass 
RP/0/RP0/CPU0:h_N6(config-rpl)#?
  end-policy        End of route-policy definition
RP/0/RP0/CPU0:h_N6(config-rpl)#end-policy 
RP/0/RP0/CPU0:h_N6(config)#show 
Sat Jun  3 06:16:17.133 UTC
Building configuration...
!! IOS XR Configuration 7.4.1
!
route-policy SET_COLOR_LOW_LATENCY_TE
  set extcommunity color COLOR_10_TE
  pass
end-policy
!
end

RP/0/RP0/CPU0:h_N6(config)#

5.3.3 route-policy 定義

① Prefix に応じた Color を付与する route-policy を以下のように定義します。
a) 2.2.2.10/32 は metric TE 重視の Color
b) 2.2.2.20/32 は Bandwidth 重視の Color
c) 2.2.2.30/32 は Delay 重視の Color
d) 2.2.2.40/32 は hopcount 重視の Color

これらを1つの RPL で定義するために目を通しておくとスムーズなものがあります。
community.cisco.com

RP/0/RP0/CPU0:h_N6(config)#route-policy SET_COLOR_GLOBAL 
RP/0/RP0/CPU0:h_N6(config-rpl)#?
  if                Begin if-statement
RP/0/RP0/CPU0:h_N6(config-rpl)#if ?
  destination         Destination address in the route
RP/0/RP0/CPU0:h_N6(config-rpl)#if destination ?
  in                    Member of a set
RP/0/RP0/CPU0:h_N6(config-rpl)#if destination in ?
  (          Begin inline prefix set
RP/0/RP0/CPU0:h_N6(config-rpl)#if destination in ( ?
  A.B.C.D/length  Specify an IPv4 prefix
RP/0/RP0/CPU0:h_N6(config-rpl)#if destination in ( 2.2.2.10/32 ?
  )   End inline prefix set
RP/0/RP0/CPU0:h_N6(config-rpl)#if destination in ( 2.2.2.10/32 ) ?
  then  Then clause
RP/0/RP0/CPU0:h_N6(config-rpl)#if destination in ( 2.2.2.10/32 ) then 
RP/0/RP0/CPU0:h_N6(config-rpl-if)#?
  set               Set a route attribute
RP/0/RP0/CPU0:h_N6(config-rpl-if)#set ?
  extcommunity             BGP extended community attribute
RP/0/RP0/CPU0:h_N6(config-rpl-if)#set extcommunity ?
  color           BGP Color extended community
RP/0/RP0/CPU0:h_N6(config-rpl-if)#set extcommunity color ?
  COLOR_10_TE        Opaque type extcommunity set name
  COLOR_20_IGP       Opaque type extcommunity set name
  COLOR_30_DELAY     Opaque type extcommunity set name
  COLOR_40_HOPCOUNT  Opaque type extcommunity set name
RP/0/RP0/CPU0:h_N6(config-rpl-if)#set extcommunity color COLOR_10_TE 
RP/0/RP0/CPU0:h_N6(config-rpl-if)#?
  elseif            Elseif clause
RP/0/RP0/CPU0:h_N6(config-rpl-if)#elseif ?
  destination         Destination address in the route
RP/0/RP0/CPU0:h_N6(config-rpl-if)#elseif destination ?
  in                    Member of a set
RP/0/RP0/CPU0:h_N6(config-rpl-if)#elseif destination in (2.2.2.20/32) then
RP/0/RP0/CPU0:h_N6(config-rpl-elseif)#set extcommunity color COLOR_20_IGP 
RP/0/RP0/CPU0:h_N6(config-rpl-elseif)#?
  elseif            Elseif clause
RP/0/RP0/CPU0:h_N6(config-rpl-elseif)#elseif destination in (2.2.2.30/32) then
RP/0/RP0/CPU0:h_N6(config-rpl-elseif)#set extcommunity color COLOR_30_DELAY 
RP/0/RP0/CPU0:h_N6(config-rpl-elseif)#elseif destination in (2.2.2.40/32) then
RP/0/RP0/CPU0:h_N6(config-rpl-elseif)#set extcommunity color COLOR_40_HOPCOUNT 
RP/0/RP0/CPU0:h_N6(config-rpl-elseif)#?
  endif             End of if-statement
RP/0/RP0/CPU0:h_N6(config-rpl-elseif)#endif 
RP/0/RP0/CPU0:h_N6(config-rpl)#?          
  end-policy        End of route-policy definition
RP/0/RP0/CPU0:h_N6(config-rpl)#end-policy 
RP/0/RP0/CPU0:h_N6(config)#show 
Sat Jun  3 06:38:28.106 UTC
Building configuration...
!! IOS XR Configuration 7.4.1
!
route-policy SET_COLOR_GLOBAL
  if destination in (2.2.2.10/32) then
    set extcommunity color COLOR_10_TE
  elseif destination in (2.2.2.20/32) then
    set extcommunity color COLOR_20_IGP
  elseif destination in (2.2.2.30/32) then
    set extcommunity color COLOR_30_DELAY
  elseif destination in (2.2.2.40/32) then
    set extcommunity color COLOR_40_HOPCOUNT
  endif
end-policy
!
end

RP/0/RP0/CPU0:h_N6(config)#

② BGP の neighbor の outbound 方向に route-policy を適用します。
∵ neighbor から Color Assignment をしている Egress PE への方向であるためです。

RP/0/RP0/CPU0:h_N6(config)#router bgp 10
RP/0/RP0/CPU0:h_N6(config-bgp)#neighbor 1.1.1.1
RP/0/RP0/CPU0:h_N6(config-bgp-nbr)#address-family vpnv4 unicast 
RP/0/RP0/CPU0:h_N6(config-bgp-nbr-af)#route-policy ?
  PASS                      Name of the policy
  SET_COLOR_HI_BW           Name of the policy
  SET_COLOR_GLOBAL          Name of the policy
  SET_COLOR_HOPCOUNT        Name of the policy
  SET_COLOR_LOW_LATENCY     Name of the policy
  SET_COLOR_LOW_LATENCY_TE  Name of the policy
  WORD                      Name of the policy
RP/0/RP0/CPU0:h_N6(config-bgp-nbr-af)#route-policy SET_COLOR_GLOBAL ?
  (    Specify parameter values for the policy
  in   Apply route policy to inbound routes
  out  Apply route policy to outbound routes
RP/0/RP0/CPU0:h_N6(config-bgp-nbr-af)#route-policy SET_COLOR_GLOBAL out 
RP/0/RP0/CPU0:h_N6(config-bgp-nbr-af)#show 
Sat Jun  3 06:51:22.580 UTC
router bgp 10
 neighbor 1.1.1.1
  address-family vpnv4 unicast
   route-policy SET_COLOR_GLOBAL out
  !
 !
!

RP/0/RP0/CPU0:h_N6(config-bgp-nbr-af)#

6. 検証

6.1 COLOR_10_TE 確認(metric TE 重視の Color)

2.2.2.10/32 宛の SR-TE は metric TE 重視の Color のインスタンスに割り当てられていることを確認します。

   RP/0/RP0/CPU0:h_N1#show ip interface brief 
   Sat Jun 10 13:26:28.278 UTC
   
   Interface                      IP-Address      Status          Protocol Vrf-Name
★ srte_c_10_ep_6.6.6.6           1.1.1.1         Up              Up       default 
   srte_c_20_ep_6.6.6.6           1.1.1.1         Up              Up       default 
   srte_c_30_ep_6.6.6.6           1.1.1.1         Up              Up       default 
   srte_c_40_ep_6.6.6.6           1.1.1.1         Up              Up       default 
   Loopback0                      1.1.1.1         Up              Up       default 
   MgmtEth0/RP0/CPU0/0            unassigned      Shutdown        Down     default 
   GigabitEthernet0/0/0/0         10.1.2.1        Up              Up       default 
   GigabitEthernet0/0/0/1         unassigned      Up              Up       default 
   GigabitEthernet0/0/0/1.10      unassigned      Up              Up       default 
   GigabitEthernet0/0/0/1.20      198.51.100.1    Up              Up       A       
   GigabitEthernet0/0/0/2         10.1.3.1        Up              Up       default 
   GigabitEthernet0/0/0/3         unassigned      Shutdown        Down     default 
   GigabitEthernet0/0/0/4         unassigned      Shutdown        Down     default 
   RP/0/RP0/CPU0:h_N1#

CEルータからの traceroute で 2.2.2.10/32 宛のトラフィックの流れやラベルを確認します。

CE1#traceroute 2.2.2.10 source 1.1.1.10
Type escape sequence to abort.
Tracing the route to 2.2.2.10
VRF info: (vrf in name/id, vrf out name/id)
  1 198.51.100.1 7 msec 2 msec 2 msec
  2 10.1.3.3 [MPLS: Labels 24001/16006/1006006 Exp 0] 12 msec 3 msec 4 msec
  3 10.3.4.4 [MPLS: Labels 16006/1006006 Exp 0] 6 msec 4 msec 3 msec
  4 10.4.6.6 [MPLS: Label 1006006 Exp 0] 6 msec 3 msec 4 msec
  5 203.0.113.200 5 msec *  13 msec
CE1#

設計したとおり metric:te 重視の経路を経由していることが分かります。

ODN で自動的に作られた SR-TE インスタンスを確認します。

    RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy color 10 detail 
    Sun Jun 11 04:44:30.368 UTC
    
    SR-TE policy database
    ---------------------
    
    Color: 10, End-point: 6.6.6.6
      Name: srte_c_10_ep_6.6.6.6
      Status:
★1     Admin: up  Operational: up for 1d02h (since Jun 10 02:29:41.679)
      Candidate-paths:
★2     Preference: 200 (BGP ODN) (active)
          Requested BSID: dynamic
            Protection Type: protected-preferred
            Maximum SID Depth: 10 
          Dynamic (valid)
★3         Metric Type: TE,   Path Accumulated Metric: 28 
★4           16003 [Prefix-SID, 3.3.3.3]
★4           24001 [Adjacency-SID, 10.3.4.3 - 10.3.4.4]
★4           16006 [Prefix-SID, 6.6.6.6]
        Preference: 100 (BGP ODN)
          Requested BSID: dynamic
          PCC info:
            Symbolic name: bgp_c_10_ep_6.6.6.6_discr_100
            PLSP-ID: 3
            Protection Type: protected-preferred
            Maximum SID Depth: 10 
          Dynamic (pce) (invalid)
            Metric Type: TE,   Path Accumulated Metric: 28 
      LSPs:
        LSP[0]:
          LSP-ID: 4 policy ID: 8 (active)
          Local label: 1001010
          State: Programmed
          Binding SID: 1001009
      Attributes:
        Binding SID: 1001009
        Forward Class: Not Configured
        Steering labeled-services disabled: no
        Steering BGP disabled: no
        IPv6 caps enable: yes
        Invalidation drop enabled: no
    
    RP/0/RP0/CPU0:h_N1#

★1:Admin: up Operational: up となり、SR-TE は正常です。
★2:(BGP ODN) (active) 本 SR-TE は ODN により自動的に作られたものとしてマークされます。
★3:Metric Type: TE で計算された SR-TE です。
★4:N1 → N3 → N4 → N6 と経由するよう SR-TE です。

SR-TE を転送している状況を確認します。

    RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng forwarding policy color 10 detail
    Sun Jun 11 04:52:41.491 UTC
    
    SR-TE Policy Forwarding database
    --------------------------------
    
    Color: 10, End-point: 6.6.6.6
      Name: srte_c_10_ep_6.6.6.6
      Binding SID: 1001009
      Active LSP:
        Candidate path:
          Preference: 200 (BGP ODN)
★1     Local label: 1001010
        Segment lists:
          SL[0]:
            Name: dynamic
            Switched Packets/Bytes: 12/384
              [MPLS -> MPLS]: 12/384
            Paths:
              Path[0]:
★2             Outgoing Label: 24001
                Outgoing Interfaces: GigabitEthernet0/0/0/2
                Next Hop: 10.1.3.3
                Switched Packets/Bytes: 12/384
                  [MPLS -> MPLS]: 12/384
                FRR Pure Backup: No
                ECMP/LFA Backup: No
                Internal Recursive Label: Unlabelled (recursive)
★3             Label Stack (Top -> Bottom): { 24001, 16006 }
                Path-id: 1, Weight: 64
    
      Policy Packets/Bytes Switched: 90/3180
    
    RP/0/RP0/CPU0:h_N1#

★1:Local label: 1001010
★2:Outgoing Label: 24001
★3:Label Stack (Top -> Bottom): { 24001, 16006 }

LFIB でもラベルスタックしている様子を確認できます。

RP/0/RP0/CPU0:h_N1#show mpls 
mpls  mpls-over-udp-ea  
RP/0/RP0/CPU0:h_N1#show mpls forwarding labels 1001010 detail 
Sun Jun 11 04:55:52.825 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
1001010 24001       SR TE: 8 [TE-INT]  Gi0/0/0/2    10.1.3.3        384         
     Updated: Jun 10 13:35:07.449
     Version: 218, Priority: 2
     Label Stack (Top -> Bottom): { 24001 16006 }
     NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
     MAC/Encaps: 4/12, MTU: 1500
     Outgoing Interface: GigabitEthernet0/0/0/2 (ifhandle 0x01000030)
     Packets Switched: 12

RP/0/RP0/CPU0:h_N1#

ラベル:1006006 は 2.2.2.10/32 宛であることが逆サイドの PEルータで確認できます。

RP/0/RP0/CPU0:h_N6#show mpls forwarding labels 1006006 detail 
Sun Jun 11 04:57:52.591 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
1006006 Unlabelled  2.2.2.10/32[V]     Gi0/0/0/1.30 203.0.113.200   0           
     Updated: May 21 00:50:37.108
     Path Flags: 0x6020 [  EXT ]
     Version: 25, Priority: 3
     Label Stack (Top -> Bottom): { Unlabelled }
     NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
     MAC/Encaps: 4/4, MTU: 1500
     Outgoing Interface: GigabitEthernet0/0/0/1.30 (ifhandle 0x01000040)
     Packets Switched: 0

RP/0/RP0/CPU0:h_N6#

6.2 COLOR_20_TE 確認(Bandwidth 重視の Color)

CEルータからの traceroute で 2.2.2.20/32 宛のトラフィックの流れやラベルを確認します。

CE1#traceroute 2.2.2.20 source 1.1.1.10
Type escape sequence to abort.
Tracing the route to 2.2.2.20
VRF info: (vrf in name/id, vrf out name/id)
  1 198.51.100.1 6 msec 1 msec 1 msec
  2 10.1.2.2 [MPLS: Labels 16006/1006005 Exp 0] 7 msec
    10.1.3.3 [MPLS: Labels 16006/1006005 Exp 0] 6 msec
    10.1.2.2 [MPLS: Labels 16006/1006005 Exp 0] 3 msec
  3 10.2.4.4 [MPLS: Labels 16006/1006005 Exp 0] 5 msec 3 msec
    10.3.5.5 [MPLS: Labels 16006/1006005 Exp 0] 7 msec
  4 10.4.6.6 [MPLS: Label 1006005 Exp 0] 7 msec 3 msec
    10.5.6.6 [MPLS: Label 1006005 Exp 0] 4 msec
  5 203.0.113.200 5 msec *  13 msec
CE1#

設計したとおり Bandwidth 重視の経路を経由していることが分かります。
Bandwidth 重視≒ IGP はBandwidth をベースに cost 算出

ODN で自動的に作られた SR-TE インスタンスを確認します。

    RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy color 20 detail 
    Sun Jun 11 07:03:15.126 UTC
    
    SR-TE policy database
    ---------------------
    
    Color: 20, End-point: 6.6.6.6
      Name: srte_c_20_ep_6.6.6.6
      Status:
★1     Admin: up  Operational: up for 1d06h (since Jun 10 00:23:16.386)
      Candidate-paths:
★2     Preference: 200 (BGP ODN) (active)
          Requested BSID: dynamic
            Protection Type: protected-preferred
            Maximum SID Depth: 10 
          Dynamic (valid)
★3         Metric Type: IGP,   Path Accumulated Metric: 35 
★4           16006 [Prefix-SID, 6.6.6.6]
        Preference: 100 (BGP ODN)
          Requested BSID: dynamic
          PCC info:
            Symbolic name: bgp_c_20_ep_6.6.6.6_discr_100
            PLSP-ID: 5
            Protection Type: protected-preferred
            Maximum SID Depth: 10 
          Dynamic (pce) (invalid)
          Last error: No path
            Metric Type: IGP,   Path Accumulated Metric: 35 
      LSPs:
        LSP[0]:
          LSP-ID: 3 policy ID: 10 (active)
          Local label: 1001007
          State: Programmed
          Binding SID: 1001017
      Attributes:
        Binding SID: 1001017
        Forward Class: Not Configured
        Steering labeled-services disabled: no
        Steering BGP disabled: no
        IPv6 caps enable: yes
        Invalidation drop enabled: no
    
    RP/0/RP0/CPU0:h_N1#

★1:Admin: up Operational: up となり、SR-TE は正常です。
★2:(BGP ODN) (active) 本 SR-TE は ODN により自動的に作られたものとしてマークされます。
★3:Metric Type: IGP で計算された SR-TE です。
★4:16006 [Prefix-SID, 6.6.6.6] をロードランスする SR-TE です。

SR-TE を転送している状況を確認します。

RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng forwarding policy color 20$
Sun Jun 11 07:06:07.922 UTC

SR-TE Policy Forwarding database
--------------------------------

Color: 20, End-point: 6.6.6.6
  Name: srte_c_20_ep_6.6.6.6
  Binding SID: 1001017
  Active LSP:
    Candidate path:
      Preference: 200 (BGP ODN)
★1 Local label: 1001007
    Segment lists:
      SL[0]:
        Name: dynamic
        Switched Packets/Bytes: 24/768
          [MPLS -> MPLS]: 24/768
        Paths:
          Path[0]:
★2         Outgoing Label: 16006
★3         Outgoing Interfaces: GigabitEthernet0/0/0/0
            Next Hop: 10.1.2.2
            Switched Packets/Bytes: 15/480
              [MPLS -> MPLS]: 15/480
            FRR Pure Backup: No
            ECMP/LFA Backup: No
            Internal Recursive Label: Unlabelled (recursive)
            Label Stack (Top -> Bottom): { 16006 }
            Path-id: 1, Weight: 32
          Path[1]:
★2         Outgoing Label: 16006
★3         Outgoing Interfaces: GigabitEthernet0/0/0/2
            Next Hop: 10.1.3.3
            Switched Packets/Bytes: 9/288
              [MPLS -> MPLS]: 9/288
            FRR Pure Backup: No
            ECMP/LFA Backup: No
            Internal Recursive Label: Unlabelled (recursive)
            Label Stack (Top -> Bottom): { 16006 }
            Path-id: 2, Weight: 32

  Policy Packets/Bytes Switched: 74/2616

RP/0/RP0/CPU0:h_N1#

★1:Local label: 1001007
★2:Outgoing Label: 16006
★3:ロードバランシングしています。

LFIB でもロードバランシングしている様子を確認できます。

RP/0/RP0/CPU0:h_N1#show mpls forwarding labels 1001007 detail 
Sun Jun 11 07:12:01.119 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
1001007 16006       SR TE: 10 [TE-INT]  Gi0/0/0/0    10.1.2.2        480         
     Updated: Jun 10 00:23:16.385
     Version: 199, Priority: 2
     Label Stack (Top -> Bottom): { 16006 }
     NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 32
     MAC/Encaps: 4/8, MTU: 1500
     Outgoing Interface: GigabitEthernet0/0/0/0 (ifhandle 0x01000018)
     Packets Switched: 15

       16006       SR TE: 10 [TE-INT]  Gi0/0/0/2    10.1.3.3        288         
     Updated: Jun 10 00:23:16.385
     Version: 199, Priority: 2
     Label Stack (Top -> Bottom): { 16006 }
     NHID: 0x0, Encap-ID: N/A, Path idx: 1, Backup path idx: 0, Weight: 32
     MAC/Encaps: 4/8, MTU: 1500
     Outgoing Interface: GigabitEthernet0/0/0/2 (ifhandle 0x01000030)
     Packets Switched: 9

RP/0/RP0/CPU0:h_N1#

ラベル:1006005 は 2.2.2.20/32 宛であることが逆サイドの PEルータで確認できます。

RP/0/RP0/CPU0:h_N6#show mpls forwarding labels 1006005 detail 
Sun Jun 11 07:13:17.990 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
1006005 Unlabelled  2.2.2.20/32[V]     Gi0/0/0/1.30 203.0.113.200   0           
     Updated: Jun  3 07:00:03.793
     Path Flags: 0x6020 [  EXT ]
     Version: 36, Priority: 3
     Label Stack (Top -> Bottom): { Unlabelled }
     NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
     MAC/Encaps: 4/4, MTU: 1500
     Outgoing Interface: GigabitEthernet0/0/0/1.30 (ifhandle 0x01000040)
     Packets Switched: 0

RP/0/RP0/CPU0:h_N6#

6.3 COLOR_30_TE 確認(Delay 重視の Color)

CEルータからの traceroute で 2.2.2.30/32 宛のトラフィックの流れやラベルを確認します。

CE1#traceroute 2.2.2.30 source 1.1.1.10
Type escape sequence to abort.
Tracing the route to 2.2.2.30
VRF info: (vrf in name/id, vrf out name/id)
  1 198.51.100.1 8 msec 3 msec 2 msec
  2 10.1.2.2 [MPLS: Labels 24001/16006/1006007 Exp 0] 20 msec 6 msec 6 msec
  3 10.2.4.4 [MPLS: Labels 16006/1006007 Exp 0] 11 msec 6 msec 5 msec
  4 10.4.6.6 [MPLS: Label 1006007 Exp 0] 9 msec 6 msec 6 msec
  5 203.0.113.200 9 msec *  13 msec
CE1#

設計したとおり Delay 重視の経路を経由していることが分かります。

ODN で自動的に作られた SR-TE インスタンスを確認します。

    RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy color 30 detail 
    Sun Jun 11 07:14:57.899 UTC
    
    SR-TE policy database
    ---------------------
    
    Color: 30, End-point: 6.6.6.6
      Name: srte_c_30_ep_6.6.6.6
      Status:
★1     Admin: up  Operational: up for 1w1d (since Jun  3 07:02:06.514)
      Candidate-paths:
★2     Preference: 200 (BGP ODN) (active)
          Requested BSID: dynamic
            Protection Type: protected-preferred
            Maximum SID Depth: 10 
          Dynamic (valid)
★3         Metric Type: LATENCY,   Path Accumulated Metric: 25 
★4           16002 [Prefix-SID, 2.2.2.2]
★4           24001 [Adjacency-SID, 10.2.4.2 - 10.2.4.4]
★4           16006 [Prefix-SID, 6.6.6.6]
        Preference: 100 (BGP ODN)
          Requested BSID: dynamic
          PCC info:
            Symbolic name: bgp_c_30_ep_6.6.6.6_discr_100
            PLSP-ID: 6
            Protection Type: protected-preferred
            Maximum SID Depth: 10 
          Dynamic (pce) (invalid)
            Metric Type: LATENCY,   Path Accumulated Metric: 25 
      LSPs:
        LSP[0]:
          LSP-ID: 2 policy ID: 11 (active)
          Local label: 1001013
          State: Programmed
          Binding SID: 1001018
      Attributes:
        Binding SID: 1001018
        Forward Class: Not Configured
        Steering labeled-services disabled: no
        Steering BGP disabled: no
        IPv6 caps enable: yes
        Invalidation drop enabled: no
    
    RP/0/RP0/CPU0:h_N1#

★1:Admin: up Operational: up となり、SR-TE は正常です。
★2:(BGP ODN) (active) 本 SR-TE は ODN により自動的に作られたものとしてマークされます。
★3:Metric Type: LATENCY で計算された SR-TE です。
★4:N1 → N2 → N4 → N6 と経由するよう SR-TE です。

SR-TE を転送している状況を確認します。

RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng forwarding policy color 30 detail
Sun Jun 11 07:17:43.356 UTC

SR-TE Policy Forwarding database
--------------------------------

Color: 30, End-point: 6.6.6.6
  Name: srte_c_30_ep_6.6.6.6
  Binding SID: 1001018
  Active LSP:
    Candidate path:
      Preference: 200 (BGP ODN)
★1 Local label: 1001013
    Segment lists:
      SL[0]:
        Name: dynamic
        Switched Packets/Bytes: 48/1536
          [MPLS -> MPLS]: 48/1536
        Paths:
          Path[0]:
★2         Outgoing Label: 24001
            Outgoing Interfaces: GigabitEthernet0/0/0/0
            Next Hop: 10.1.2.2
            Switched Packets/Bytes: 48/1536
              [MPLS -> MPLS]: 48/1536
            FRR Pure Backup: No
            ECMP/LFA Backup: No
            Internal Recursive Label: Unlabelled (recursive)
★3         Label Stack (Top -> Bottom): { 24001, 16006 }
            Path-id: 1, Weight: 64

  Policy Packets/Bytes Switched: 72/2544

RP/0/RP0/CPU0:h_N1#

★1:Local label: 1001013
★2:Outgoing Label: 24001
★3:Label Stack (Top -> Bottom): { 24001, 16006 }

LFIB でもラベルスタックしている様子を確認できます。

RP/0/RP0/CPU0:h_N1#show mpls forwarding labels 1001013 detail 
Sun Jun 11 07:19:46.682 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
1001013 24001       SR TE: 11 [TE-INT]  Gi0/0/0/0    10.1.2.2        1536        
     Updated: Jun  3 07:02:06.512
     Version: 159, Priority: 2
     Label Stack (Top -> Bottom): { 24001 16006 }
     NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
     MAC/Encaps: 4/12, MTU: 1500
     Outgoing Interface: GigabitEthernet0/0/0/0 (ifhandle 0x01000018)
     Packets Switched: 48

RP/0/RP0/CPU0:h_N1#

ラベル:1006007 は 2.2.2.30/32 宛であることが逆サイドの PEルータで確認できます。

RP/0/RP0/CPU0:h_N6#show mpls forwarding labels 1006007 detail 
Sun Jun 11 07:20:38.247 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
1006007 Unlabelled  2.2.2.30/32[V]     Gi0/0/0/1.30 203.0.113.200   0           
     Updated: Jun  3 07:02:07.323
     Path Flags: 0x6020 [  EXT ]
     Version: 38, Priority: 3
     Label Stack (Top -> Bottom): { Unlabelled }
     NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
     MAC/Encaps: 4/4, MTU: 1500
     Outgoing Interface: GigabitEthernet0/0/0/1.30 (ifhandle 0x01000040)
     Packets Switched: 0

RP/0/RP0/CPU0:h_N6#

6.4 COLOR_40_TE 確認(hopcount 重視の Color)

CEルータからの traceroute で 2.2.2.40/32 宛のトラフィックの流れやラベルを確認します。

CE1#traceroute 2.2.2.40 source 1.1.1.10
Type escape sequence to abort.
Tracing the route to 2.2.2.40
VRF info: (vrf in name/id, vrf out name/id)
  1 198.51.100.1 7 msec 1 msec 2 msec
  2 10.1.2.2 [MPLS: Labels 16006/1006008 Exp 0] 15 msec 5 msec 5 msec
  3 10.2.4.4 [MPLS: Labels 16006/1006008 Exp 0] 7 msec 5 msec 4 msec
  4 10.4.6.6 [MPLS: Label 1006008 Exp 0] 8 msec 4 msec 4 msec
  5 203.0.113.200 9 msec *  14 msec
CE1#

設計したとおり hopcount 重視の経路を経由していることが分かります。

ODN で自動的に作られた SR-TE インスタンスを確認します。

    RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy color 40 detail 
    Sun Jun 11 07:21:59.678 UTC
    
    SR-TE policy database
    ---------------------
    
    Color: 40, End-point: 6.6.6.6
      Name: srte_c_40_ep_6.6.6.6
      Status:
★1     Admin: up  Operational: up for 1w0d (since Jun  3 07:38:31.803)
      Candidate-paths:
★2     Preference: 200 (BGP ODN) (active)
          Requested BSID: dynamic
            Protection Type: protected-preferred
            Maximum SID Depth: 10 
          Dynamic (valid)
★3         Metric Type: HOPCOUNT,   Path Accumulated Metric: 3 
★4           16002 [Prefix-SID, 2.2.2.2]
★4           16006 [Prefix-SID, 6.6.6.6]
        Preference: 100 (BGP ODN)
          Requested BSID: dynamic
          PCC info:
            Symbolic name: bgp_c_40_ep_6.6.6.6_discr_100
            PLSP-ID: 11
            Protection Type: protected-preferred
            Maximum SID Depth: 10 
          Dynamic (pce) (invalid)
            Metric Type: HOPCOUNT,   Path Accumulated Metric: 3 
      LSPs:
        LSP[0]:
          LSP-ID: 2 policy ID: 16 (active)
          Local label: 1001025
          State: Programmed
          Binding SID: 1001026
      Attributes:
        Binding SID: 1001026
        Forward Class: Not Configured
        Steering labeled-services disabled: no
        Steering BGP disabled: no
        IPv6 caps enable: yes
        Invalidation drop enabled: no
    
    RP/0/RP0/CPU0:h_N1#

★1:Admin: up Operational: up となり、SR-TE は正常です。
★2:(BGP ODN) (active) 本 SR-TE は ODN により自動的に作られたものとしてマークされます。
★3:Metric Type: HOPCOUNT で計算された SR-TE です。
★4:N1 → N2 → N4 → N6 と経由するよう SR-TE です。

SR-TE を転送している状況を確認します。

    RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng forwarding policy color 40$
    Sun Jun 11 07:25:04.138 UTC
    
    SR-TE Policy Forwarding database
    --------------------------------
    
    Color: 40, End-point: 6.6.6.6
      Name: srte_c_40_ep_6.6.6.6
      Binding SID: 1001026
      Active LSP:
        Candidate path:
          Preference: 200 (BGP ODN)
★1     Local label: 1001025
        Segment lists:
          SL[0]:
            Name: dynamic
            Switched Packets/Bytes: 36/1152
              [MPLS -> MPLS]: 36/1152
            Paths:
              Path[0]:
★2             Outgoing Label: 16006
                Outgoing Interfaces: GigabitEthernet0/0/0/0
                Next Hop: 10.1.2.2
                Switched Packets/Bytes: 36/1152
                  [MPLS -> MPLS]: 36/1152
                FRR Pure Backup: No
                ECMP/LFA Backup: No
                Internal Recursive Label: Unlabelled (recursive)
★3             Label Stack (Top -> Bottom): { 16006 }
                Path-id: 1, Weight: 64
    
      Policy Packets/Bytes Switched: 48/1704
    
    RP/0/RP0/CPU0:h_N1#

★1:Local label: 1001025
★2:Outgoing Label: 16006
★3:Label Stack (Top -> Bottom): { 16006 }

LFIB でもラベルスタックしている様子を確認できます。

RP/0/RP0/CPU0:h_N1#show mpls forwarding labels 1001025 detail 
Sun Jun 11 07:27:47.792 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
1001025 16006       SR TE: 16 [TE-INT]  Gi0/0/0/0    10.1.2.2        1152        
     Updated: Jun  3 07:38:31.794
     Version: 186, Priority: 2
     Label Stack (Top -> Bottom): { 16006 }
     NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
     MAC/Encaps: 4/8, MTU: 1500
     Outgoing Interface: GigabitEthernet0/0/0/0 (ifhandle 0x01000018)
     Packets Switched: 36

RP/0/RP0/CPU0:h_N1#

ラベル:1006008 は 2.2.2.40/32 宛であることが逆サイドの PEルータで確認できます。

RP/0/RP0/CPU0:h_N6#show mpls forwarding labels 1006008 detail 
Sun Jun 11 07:28:34.136 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
1006008 Unlabelled  2.2.2.40/32[V]     Gi0/0/0/1.30 203.0.113.200   0           
     Updated: Jun  3 07:38:32.592
     Path Flags: 0x6020 [  EXT ]
     Version: 52, Priority: 3
     Label Stack (Top -> Bottom): { Unlabelled }
     NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
     MAC/Encaps: 4/4, MTU: 1500
     Outgoing Interface: GigabitEthernet0/0/0/1.30 (ifhandle 0x01000040)
     Packets Switched: 0

RP/0/RP0/CPU0:h_N6#

6.5 宛先 Prefix が消えると SR-TE も消える

CEルータで Loopback 220 を shutdown します。

CE2(config-if)#int lo220
CE2(config-if)#shutdown 
CE2(config-if)#
*Jun 11 07:32:41.012: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback220, changed state to down
*Jun 11 07:32:41.015: %LINK-5-CHANGED: Interface Loopback220, changed state to administratively down

すると SR-TE が DOWN します。

   RP/0/RP0/CPU0:h_N1#show ip interface brief 
   Sun Jun 11 07:34:02.576 UTC
   
   Interface                      IP-Address      Status          Protocol Vrf-Name
   srte_c_10_ep_6.6.6.6           1.1.1.1         Up              Up       default 
★ srte_c_20_ep_6.6.6.6           1.1.1.1         Down            Down     default 
   srte_c_30_ep_6.6.6.6           1.1.1.1         Up              Up       default 
   srte_c_40_ep_6.6.6.6           1.1.1.1         Up              Up       default 
   Loopback0                      1.1.1.1         Up              Up       default 
   MgmtEth0/RP0/CPU0/0            unassigned      Shutdown        Down     default 
   GigabitEthernet0/0/0/0         10.1.2.1        Up              Up       default 
   GigabitEthernet0/0/0/1         unassigned      Up              Up       default 
   GigabitEthernet0/0/0/1.10      unassigned      Up              Up       default 
   GigabitEthernet0/0/0/1.20      198.51.100.1    Up              Up       A       
   GigabitEthernet0/0/0/2         10.1.3.1        Up              Up       default 
   GigabitEthernet0/0/0/3         unassigned      Shutdown        Down     default 
   GigabitEthernet0/0/0/4         unassigned      Shutdown        Down     default 
   RP/0/RP0/CPU0:h_N1#

ポリシーの中身を確認すると”(cleanup running)”表示となり、消えようとしている様子を確認できます。

   RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy color 20 detail 
   Sun Jun 11 07:32:53.088 UTC
   
   SR-TE policy database
   ---------------------
   
   Color: 20, End-point: 6.6.6.6
     Name: srte_c_20_ep_6.6.6.6
     Status:
       Admin: up  Operational: down for 00:00:12 (since Jun 11 07:32:40.299)
     Candidate-paths:
★     Preference: 200 (BGP ODN) (cleanup running)
         Requested BSID: dynamic
           Protection Type: protected-preferred
           Maximum SID Depth: 10 
         Dynamic (invalid)
           Metric Type: IGP,   Path Accumulated Metric: 35 
★     Preference: 100 (BGP ODN) (cleanup running)
         Requested BSID: dynamic
         PCC info:
           Symbolic name: bgp_c_20_ep_6.6.6.6_discr_100
           PLSP-ID: 5
           Protection Type: protected-preferred
           Maximum SID Depth: 10 
         Dynamic (pce) (invalid)
         Last error: No path
           Metric Type: IGP,   Path Accumulated Metric: 35 
     Attributes:
       Forward Class: 0
       Steering labeled-services disabled: no
       Steering BGP disabled: no
       IPv6 caps enable: no
       Invalidation drop enabled: no
   
   RP/0/RP0/CPU0:h_N1#

暫くすると完全に SR-TE が消えます!

RP/0/RP0/CPU0:h_N1#show ip interface brief                                 
Sun Jun 11 07:35:03.279 UTC

Interface                      IP-Address      Status          Protocol Vrf-Name
srte_c_10_ep_6.6.6.6           1.1.1.1         Up              Up       default 
srte_c_30_ep_6.6.6.6           1.1.1.1         Up              Up       default 
srte_c_40_ep_6.6.6.6           1.1.1.1         Up              Up       default 
Loopback0                      1.1.1.1         Up              Up       default 
MgmtEth0/RP0/CPU0/0            unassigned      Shutdown        Down     default 
GigabitEthernet0/0/0/0         10.1.2.1        Up              Up       default 
GigabitEthernet0/0/0/1         unassigned      Up              Up       default 
GigabitEthernet0/0/0/1.10      unassigned      Up              Up       default 
GigabitEthernet0/0/0/1.20      198.51.100.1    Up              Up       A       
GigabitEthernet0/0/0/2         10.1.3.1        Up              Up       default 
GigabitEthernet0/0/0/3         unassigned      Shutdown        Down     default 
GigabitEthernet0/0/0/4         unassigned      Shutdown        Down     default 
RP/0/RP0/CPU0:h_N1#
RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy color 20 detail 
Sun Jun 11 07:35:12.165 UTC
RP/0/RP0/CPU0:h_N1#

6.6 宛先 Prefix が出現すると SR-TE も出現する

CEルータで Loopback 220 を no shutdown します。

CE2(config-if)#no shutdown
CE2(config-if)#
*Jun 11 07:40:14.172: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback220, changed state to up
*Jun 11 07:40:14.173: %LINK-3-UPDOWN: Interface Loopback220, changed state to up
CE2(config-if)#

即効で 宛先 Loopback 220 Prefix の SR-TE が復活します。

   RP/0/RP0/CPU0:h_N1#show ip interface brief                                 
   Sun Jun 11 07:40:24.633 UTC
   
   Interface                      IP-Address      Status          Protocol Vrf-Name
   srte_c_10_ep_6.6.6.6           1.1.1.1         Up              Up       default 
★ srte_c_20_ep_6.6.6.6           1.1.1.1         Up              Up       default 
   srte_c_30_ep_6.6.6.6           1.1.1.1         Up              Up       default 
   srte_c_40_ep_6.6.6.6           1.1.1.1         Up              Up       default 
   Loopback0                      1.1.1.1         Up              Up       default 
   MgmtEth0/RP0/CPU0/0            unassigned      Shutdown        Down     default 
   GigabitEthernet0/0/0/0         10.1.2.1        Up              Up       default 
   GigabitEthernet0/0/0/1         unassigned      Up              Up       default 
   GigabitEthernet0/0/0/1.10      unassigned      Up              Up       default 
   GigabitEthernet0/0/0/1.20      198.51.100.1    Up              Up       A       
   GigabitEthernet0/0/0/2         10.1.3.1        Up              Up       default 
   GigabitEthernet0/0/0/3         unassigned      Shutdown        Down     default 
   GigabitEthernet0/0/0/4         unassigned      Shutdown        Down     default 
   RP/0/RP0/CPU0:h_N1#

ポリシーの詳細もご覧の通り完全に復活します。
まさに On Demand !

   RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy color 20 detail 
   Sun Jun 11 07:40:29.208 UTC
   
   SR-TE policy database
   ---------------------
   
   Color: 20, End-point: 6.6.6.6
     Name: srte_c_20_ep_6.6.6.6
     Status:
★     Admin: up  Operational: up for 00:00:13 (since Jun 11 07:40:15.516)
     Candidate-paths:
★     Preference: 200 (BGP ODN) (active)
         Requested BSID: dynamic
           Protection Type: protected-preferred
           Maximum SID Depth: 10 
         Dynamic (valid)
           Metric Type: IGP,   Path Accumulated Metric: 35 
             16006 [Prefix-SID, 6.6.6.6]
       Preference: 100 (BGP ODN)
         Requested BSID: dynamic
         PCC info:
           Symbolic name: bgp_c_20_ep_6.6.6.6_discr_100
           PLSP-ID: 12
           Protection Type: protected-preferred
           Maximum SID Depth: 10 
         Dynamic (pce) (invalid)
           Metric Type: NONE,   Path Accumulated Metric: 0 
     LSPs:
       LSP[0]:
         LSP-ID: 2 policy ID: 17 (active)
         Local label: 1001008
         State: Programmed
         Binding SID: 1001012
     Attributes:
       Binding SID: 1001012
       Forward Class: Not Configured
       Steering labeled-services disabled: no
       Steering BGP disabled: no
       IPv6 caps enable: yes
       Invalidation drop enabled: no
   
   RP/0/RP0/CPU0:h_N1#

7. もしかして ODN って Head-end のみでも定義できる?


まとめているうちに、ふと思いつきました。Automated Steering:AS を思い出してください。
SR-TE その7 Automated Steering Egress-PE
chimay-wh.hatenablog.com
SR-TE その8 Automated Steering Ingress-PE
chimay-wh.hatenablog.com
雑に言うとその7は、Egress-PE で Color Assignment をしていて、その8は Ingress-PE で Color Assignment をしています。 今回の ODN では、Color Assignment を Egress-PE で実施していますが、たまたま選択したのが Egress-PE だっただけで、Ingress-PE でできないことはないです。 つまり、ODN は Color Assignment をどっちで実施するか選択することができます。
ドキュメントには書いてありませんが、理論上はできます。(実際に簡易的に検証をしてできることを確認しました)

8. 参考

① On-Demand SR Policy – SR On-Demand Next-Hop
www.cisco.com

② Segment Routing On Demand Next-hop
y-network.jp

次回は、On Demand Next-hop:ODN with L2VPN について記事を書きます。
最後までお読みいただきありがとうございました!

Single-Domain SR-TE その9(EVPN VPWS Preferred Path over SR-TE Policy)

EVPN VPWS Preferred Path over SR-TE Policy が理解できたので自分のメモ用にアウトプットします。

1. EVPN VPWS Preferred Path over SR-TE Policy

一言で言うと VPWS に SR-TE を関連付けることです。

2. Topology

3. Config

h_N1(主役① PEルータ;fallback enable)

hostname h_N1
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
vrf A
 rd 10:1
 address-family ipv4 unicast
  import route-target
   200:1
  !
  export route-target
   100:1
  !
 !
!
interface Loopback0
 ipv4 address 1.1.1.1 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.2.1 255.255.255.0
!
interface GigabitEthernet0/0/0/1.10 l2transport
 encapsulation dot1q 10
!
interface GigabitEthernet0/0/0/1.20
 vrf A    
 ipv4 address 198.51.100.1 255.255.255.0
 encapsulation dot1q 20
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.1.3.1 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 shutdown
!
interface GigabitEthernet0/0/0/4
 shutdown
!
route-policy PASS
  pass
end-policy
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0001.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 1
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/2
 !
!
router bgp 10
 bgp router-id 1.1.1.1
 address-family vpnv4 unicast
 !
 address-family l2vpn evpn
 !
 neighbor 6.6.6.6
  remote-as 10
  update-source Loopback0
  address-family vpnv4 unicast
  !
  address-family l2vpn evpn
  !
 !
 vrf A    
  rd 10:1
  address-family ipv4 unicast
  !
  neighbor 198.51.100.100
   remote-as 100
   address-family ipv4 unicast
    route-policy PASS in
    route-policy PASS out
   !
  !
 !
!
evpn
 evi 100
  advertise-mac
  !
 !
!
l2vpn
 pw-class PW60000
  encapsulation mpls
   preferred-path sr-te policy srte_c_60000_ep_6.6.6.6 fallback enable
  !       
 !
 xconnect group EVPN_VPWS
  p2p EVPN_1
   interface GigabitEthernet0/0/0/1.10
   neighbor evpn evi 1010 target 60 source 10
    pw-class PW60000
   !
  !
 !
!
mpls oam
!
segment-routing
 traffic-eng
  segment-list EVPN_VPWS_PREFER
   index 10 mpls label 16002
   index 20 mpls label 16003
   index 30 mpls label 16004
   index 40 mpls label 16005
   index 50 mpls label 16006
  !
  policy LIGHTNING
   binding-sid mpls 61000
   color 60000 end-point ipv4 6.6.6.6
   autoroute
    include ipv4 6.6.6.6/32
   !
   candidate-paths
    preference 100
     explicit segment-list EVPN_VPWS_PREFER
     !
    !
   !
  !
 !
!
mpls label range table 0 1001001 1001999
end

h_N1(主役① PEルータ;fallback disable)

hostname h_N1
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
vrf A
 rd 10:1
 address-family ipv4 unicast
  import route-target
   200:1
  !
  export route-target
   100:1
  !
 !
!
interface Loopback0
 ipv4 address 1.1.1.1 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.2.1 255.255.255.0
!
interface GigabitEthernet0/0/0/1.10 l2transport
 encapsulation dot1q 10
!
interface GigabitEthernet0/0/0/1.20
 vrf A    
 ipv4 address 198.51.100.1 255.255.255.0
 encapsulation dot1q 20
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.1.3.1 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 shutdown
!
interface GigabitEthernet0/0/0/4
 shutdown
!
route-policy PASS
  pass
end-policy
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0001.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 1
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/2
 !
!
router bgp 10
 bgp router-id 1.1.1.1
 address-family vpnv4 unicast
 !
 address-family l2vpn evpn
 !
 neighbor 6.6.6.6
  remote-as 10
  update-source Loopback0
  address-family vpnv4 unicast
  !
  address-family l2vpn evpn
  !
 !
 vrf A    
  rd 10:1
  address-family ipv4 unicast
  !
  neighbor 198.51.100.100
   remote-as 100
   address-family ipv4 unicast
    route-policy PASS in
    route-policy PASS out
   !
  !
 !
!
evpn
 evi 100
  advertise-mac
  !
 !
!
l2vpn
 pw-class PW60000
  encapsulation mpls
   preferred-path sr-te policy srte_c_60000_ep_6.6.6.6 fallback disable
  !       
 !
 xconnect group EVPN_VPWS
  p2p EVPN_1
   interface GigabitEthernet0/0/0/1.10
   neighbor evpn evi 1010 target 60 source 10
    pw-class PW60000
   !
  !
 !
!
mpls oam
!
segment-routing
 traffic-eng
  segment-list EVPN_VPWS_PREFER
   index 10 mpls label 16002
   index 20 mpls label 16003
   index 30 mpls label 16004
   index 40 mpls label 16005
   index 50 mpls label 16006
  !
  policy LIGHTNING
   binding-sid mpls 61000
   color 60000 end-point ipv4 6.6.6.6
   autoroute
    include ipv4 6.6.6.6/32
   !
   candidate-paths
    preference 100
     explicit segment-list EVPN_VPWS_PREFER
     !
    !
   !
  !
 !
!
mpls label range table 0 1001001 1001999
end

h_N2(脇役)

hostname h_N2
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 2.2.2.2 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.2.2 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.2.3.2 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.2.4.2 255.255.255.0
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0002.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 2
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
!
mpls oam
!
mpls label range table 0 1002001 1002999
end

h_N3(脇役)

hostname h_N3
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 3.3.3.3 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.3.3 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.2.3.3 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.3.5.3 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 ipv4 address 10.3.4.3 255.255.255.0
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0003.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 3
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
 interface GigabitEthernet0/0/0/3
 !
!
mpls oam
!
mpls label range table 0 1003001 1003999
end

h_N4(脇役)

hostname h_N4
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 4.4.4.4 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.2.4.4 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.4.5.4 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.4.6.4 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 ipv4 address 10.3.4.4 255.255.255.0
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0004.00
 address-family ipv4 unicast
 !
 interface Loopback0
  prefix-attributes anycast
  address-family ipv4 unicast
   prefix-sid index 4
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
 interface GigabitEthernet0/0/0/3
 !
!
mpls oam
!
mpls label range table 0 1004001 1004999
end

h_N5(脇役)

hostname h_N5
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 5.5.5.5 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.3.5.5 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.4.5.5 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.5.6.5 255.255.255.0
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0005.00
 address-family ipv4 unicast
 !
 interface Loopback0
  prefix-attributes anycast
  address-family ipv4 unicast
   prefix-sid index 5
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
!
mpls oam
!
mpls label range table 0 1005001 1005999
end

h_N6(準主役① PEルータ)

hostname h_N6
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
vrf B
 rd 10:6
 address-family ipv4 unicast
  import route-target
   100:1
  !
  export route-target
   200:1
  !
 !
!
interface Loopback0
 ipv4 address 6.6.6.6 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.4.6.6 255.255.255.0
!
interface GigabitEthernet0/0/0/1.10 l2transport
 encapsulation dot1q 10
!
interface GigabitEthernet0/0/0/1.30
 vrf B
 ipv4 address 203.0.113.6 255.255.255.0
 encapsulation dot1q 30
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.5.6.6 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 shutdown
!
interface GigabitEthernet0/0/0/4
 shutdown
!
route-policy PASS
  pass
end-policy
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0006.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 6
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/2
 !
!         
router bgp 10
 bgp router-id 6.6.6.6
 address-family vpnv4 unicast
 !
 address-family l2vpn evpn
 !
 neighbor 1.1.1.1
  remote-as 10
  update-source Loopback0
  address-family vpnv4 unicast
  !
  address-family l2vpn evpn
  !
 !
 vrf B
  rd 10:6
  address-family ipv4 unicast
  !
  neighbor 203.0.113.200
   remote-as 200
   address-family ipv4 unicast
    route-policy PASS in
    route-policy PASS out
   !
  !
 !
!
evpn
 evi 100
  advertise-mac
  !
 !
!
l2vpn
 xconnect group EVPN_VPWS
  p2p EVPN_1
   interface GigabitEthernet0/0/0/1.10
   neighbor evpn evi 1010 target 10 source 60
   !
  !
 !
!
mpls oam
!
mpls label range table 0 1006001 1006999
end

h_CE1(準主役② CEルータ)

hostname CE1
!
no ip domain lookup
!
interface Loopback0
 ip address 100.100.100.100 255.255.255.255
!
interface Loopback110
 ip address 1.1.1.10 255.255.255.255
!
interface GigabitEthernet1
 no ip address
!
interface GigabitEthernet1.10
 encapsulation dot1Q 10
 ip address 192.0.2.100 255.255.255.0
!
interface GigabitEthernet1.20
 encapsulation dot1Q 20
 ip address 198.51.100.100 255.255.255.0
!
router bgp 100
 bgp router-id 100.100.100.100
 bgp log-neighbor-changes
 network 1.1.1.10 mask 255.255.255.255
 neighbor 198.51.100.1 remote-as 10
!
line con 0
 exec-timeout 0 0
!
end

h_CE2(準主役③ CEルータ)

hostname CE2
!
no ip domain lookup
!
interface Loopback0
 ip address 200.200.200.200 255.255.255.255
!
interface Loopback210
 ip address 2.2.2.10 255.255.255.255
!
interface Loopback220
 ip address 2.2.2.20 255.255.255.255
!
interface GigabitEthernet1
 no ip address
!
interface GigabitEthernet1.10
 encapsulation dot1Q 10
 ip address 192.0.2.200 255.255.255.0
!
interface GigabitEthernet1.30
 encapsulation dot1Q 30
 ip address 203.0.113.200 255.255.255.0
!
router bgp 200
 bgp router-id 200.200.200.200
 bgp log-neighbor-changes
 network 2.2.2.10 mask 255.255.255.255
 network 2.2.2.20 mask 255.255.255.255
 neighbor 203.0.113.6 remote-as 10
!
line con 0
 exec-timeout 0 0
!
end

4. EVPN VPWS Preferred Path over SR-TE Policy の実装

L2VPN が実装されている前提で話を進めます。 → Single-Domain SR-TE その6(LxVPN over SR)完了した状態からスタートします。

実装の流れは、① Head-end で explicit Path を定義し、② SR-TEのポリシーを定義します。③ 経路(Candidate-paths)の候補を②で指定した path list から選択します。 ④ Head-end で Pseudowire class template を定義し、⑤ L2VPN(E-LINE) で Pseudowire class template を指定します。

4.1 PEルータ(Head-end)

4.1.1 explicit Path の定義

① Segment Routing を定義します。

RP/0/RP0/CPU0:h_N1(config)#
  segment-routing            Segment Routing

② Segment Routing で Traffic Engineering を定義します。

RP/0/RP0/CPU0:h_N1(config-sr)#?
  traffic-eng         Segment Routing Traffic Engineering

③ Segment-list configuration でSegment-list名(任意:EVPN_VPWS_PREFER)を定義します。

RP/0/RP0/CPU0:h_N1(config-sr-te)#?
  segment-list        Segment-list configuration
RP/0/RP0/CPU0:h_N1(config-sr-te)#segment-list ?
  name  Segment-list name
  WORD  Identifying name for segment-list
RP/0/RP0/CPU0:h_N1(config-sr-te)#segment-list EVPN_VPWS_PREFER

④ SR-TEで経路を明示的に定義します。

RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#?
  index               Next entry index
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index ?
  <1-65535>  Index number
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index 10 ?
  mpls  MPLS configuration
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index 10 mpls ?
  label      MPLS label configuration
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index 10 mpls label ?
  <0-1048575>  MPLS label value
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index 10 mpls label 16002

EVPN_VPWS_PREFER N1→N2→N3→N4→N5→N6 を作ります。

segment-routing
 traffic-eng
  segment-list EVPN_VPWS_PREFER
   index 10 mpls label 16002
   index 20 mpls label 16003
   index 30 mpls label 16004
   index 40 mpls label 16005
   index 50 mpls label 16006
  !
 !
!

4.1.2 SR-TE Policy の定義

SR-TE Policy を以下のように定義します。
a) ポリシー名 :LIGHTNING
b) B-SID(任意):61000
c) color :60000
d) Tail-End :6.6.6.6(h_N6)

SR-TEは、a)ポリシー名とc)カラー、d)Tail-Endの指定が必須です。

① 先ずはポリシー名を定義します。

RP/0/RP0/CPU0:h_N1(config-sr-te)#policy ?
  WORD  Identifying name for policy with max 59 characters
RP/0/RP0/CPU0:h_N1(config-sr-te)#policy LIGHTNING

② B-SID(binding-sid)は任意設定です。 ※ SR-TE Policy自体に割り当てられたSIDをB-SID(binding-sid)と呼びます。

RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#?
  binding-sid              Binding Segment Identifier
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#binding-sid ?
  mpls  MPLS label
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#binding-sid mpls ?
  <16-1048575>  MPLS label
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#binding-sid mpls 61000

③ 次にカラーとTail-Endを指定します。

RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#?
  color                    Specify color for policy
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color ?
  <1-4294967295>  Color value
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color 60000 ?
  end-point  Policy endpoint
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color 60000 end-point ?
  ipv4  IPv4 address
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color 60000 end-point ipv4 ?
  A.B.C.D  IPv4 endpoint address
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color 60000 end-point ipv4 6.6.6.6 ?
  <cr>  

④ SR-TEポリシーで作成したLSP経由でパケットを転送させるため、autorouteを定義します。
端的に言うと、For traffic steering toward h_N6 ってことです。

RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#?
  autoroute                Autoroute configuration
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#autoroute 
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-autoroute)#?
  include             Prefixes for which IGP routes will be installed
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-autoroute)#include ?
  all   Include all eligible prefixes
  ipv4  IPv4 address family
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-autoroute)#include ipv4 ?
  A.B.C.D/length  IP prefix route to include
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-autoroute)#include ipv4 6.6.6.6/32

4.1.3 Candidate-paths の定義

Candidate-paths を以下のように定義します。
a) preference :100
b) explicit path :EVPN_VPWS_PREFER

preference と指定する経路リストをセットで指定します。

RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#?
  candidate-paths          Candidate-paths configuration
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#candidate-paths 
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path)#?
  preference          Policy path-option preference entry
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path)#preference ?
  <1-65535>  Path-option preference
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path)#preference 100 
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path-pref)#?
  explicit            Preconfigured path
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path-pref)#explicit ?
  segment-list  Specify Segment-list
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path-pref)#explicit segment-list ?
  EXPLICIT_LIST  Identifying name for segment-list
  WORD           Identifying name for segment-list
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path-pref)#explicit segment-list EVPN_VPWS_PREFER

4.1.4 Pseudowire class template の定義

① 事前に SR-TE のポリシー名を控えておきます。 今回は”srte_c_60000_ep_6.6.6.6 ”です。

   RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy candidate-path name LIGHTNING | i Name
   Sun May 28 15:34:47.209 UTC
★   Name: srte_c_60000_ep_6.6.6.6
         Name: LIGHTNING
   RP/0/RP0/CPU0:h_N1#

② L2VPN の Pseudowire class で優先させる SR-TE を指定します。
途中、①で控えた SR-TE のポリシー名を使います★

   RP/0/RP0/CPU0:h_N1(config)#?
     l2vpn                      Configure l2vpn commands
   RP/0/RP0/CPU0:h_N1(config-l2vpn)#?
     pw-class                   Pseudowire class template
   RP/0/RP0/CPU0:h_N1(config-l2vpn)#pw-class ?
     WORD  Pseudowire-class name (Max character length: 32)
   RP/0/RP0/CPU0:h_N1(config-l2vpn)#pw-class PW60000 
   RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc)#?
     encapsulation       Pseudowire encapsulation
   RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc)#encapsulation ?
     mpls    Set pseudowire encapsulation to MPLS
   RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc)#encapsulation mpls 
   RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#?
     preferred-path      Preferred path tunnel settings
   RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#preferred-path ?
     sr-te      Use segment-routing traffic-engineering for preferred path
   RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#preferred-path sr-te ?
     policy  Specify SR TE policy for preferred path
   RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#preferred-path sr-te policy ?
     WORD  Name of SR TE policy
★ RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#preferred-path sr-te policy srte_c_60000_ep_6.6.6.6
   RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#show
   Sun May 28 15:48:27.562 UTC
   l2vpn
    pw-class PW60000
     encapsulation mpls
      preferred-path sr-te policy srte_c_60000_ep_6.6.6.6
     !
    !
   !
   
   RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#commit 
   Sun May 28 15:48:33.683 UTC
   RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#

4.1.5 L2VPN(E-LINE) の定義

③ L2VPN(E-LINE)の定義に、Pseudowire class template を指定します。
xconnect Group:EVPN_VPWS
p2p xconnect :EVPN_1
AC interface :GigabitEthernet0/0/0/1.10
EVI :1010
remote AC :60
local AC :10
★ Pseudowire class:PW60000

RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#exi
RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc)#exi
RP/0/RP0/CPU0:h_N1(config-l2vpn)#
RP/0/RP0/CPU0:h_N1(config-l2vpn)#xconnect group EVPN_VPWS
RP/0/RP0/CPU0:h_N1(config-l2vpn-xc)#p2p EVPN_1
RP/0/RP0/CPU0:h_N1(config-l2vpn-xc-p2p)#interface GigabitEthernet 0/0/0/1.10
RP/0/RP0/CPU0:h_N1(config-l2vpn-xc-p2p)#neighbor evpn evi 1010 target 60 sourc$
RP/0/RP0/CPU0:h_N1(config-l2vpn-xc-p2p-pw)#?
  pw-class            PW class template name to use
RP/0/RP0/CPU0:h_N1(config-l2vpn-xc-p2p-pw)#pw-class ?
  WORD  Pseudowire-class name
RP/0/RP0/CPU0:h_N1(config-l2vpn-xc-p2p-pw)#pw-class PW60000
RP/0/RP0/CPU0:h_N1(config-l2vpn-xc-p2p-pw)#show 
Sun May 28 16:03:00.598 UTC
l2vpn
 xconnect group EVPN_VPWS
  p2p EVPN_1
   neighbor evpn evi 1010 target 60 source 10
    pw-class PW60000
   !
  !
 !
!

RP/0/RP0/CPU0:h_N1(config-l2vpn-xc-p2p-pw)#commit 
Sun May 28 16:03:16.166 UTC
RP/0/RP0/CPU0:h_N1(config-l2vpn-xc-p2p-pw)#

5. 検証

5.1 fallback enabled 検証

① SR-TE Prefered path を定義する前にはなかった Preferred path Active と言う行が出現します。

    RP/0/RP0/CPU0:h_N1#show l2vpn xconnect detail 
    Sun May 28 23:26:41.929 UTC
    
    Group EVPN_VPWS, XC EVPN_1, state is up; Interworking none
      AC: GigabitEthernet0/0/0/1.10, state is up
        Type VLAN; Num Ranges: 1
        Rewrite Tags: []
        VLAN ranges: [10, 10]
        MTU 1504; XC ID 0x2; interworking none
        Statistics:
          packets: received 10113, sent 5077
          bytes: received 67544, sent 596810
          drops: illegal VLAN 0, illegal length 0
★1   EVPN: neighbor 6.6.6.6, PW ID: evi 1010, ac-id 60, state is up ( established )
        XC ID 0xa0000003
        Encapsulation MPLS
        Encap type Ethernet, control word disabled
        Sequencing not set
★2     Preferred path Active : SR TE srte_c_60000_ep_6.6.6.6 (BSID:61000, IFH:0x3c), Statically configured, fallback enabled
        Ignore MTU mismatch: Enabled
        Transmit MTU zero: Enabled
        Tunnel : Up
    
          EVPN         Local                          Remote                        
          ------------ ------------------------------ -----------------------------
          Label        24004                          24004                         
          MTU          1518                           unknown                       
          Control word disabled                       disabled                      
          AC ID        10                             60                            
          EVPN type    Ethernet                       Ethernet                      
    
          ------------ ------------------------------ -----------------------------
        Create time: 21/05/2023 06:33:56 (1w0d ago)
        Last time status changed: 28/05/2023 23:25:57 (00:00:44 ago)
        Statistics:
          packets: received 5077, sent 10113
          bytes: received 596810, sent 67544
    RP/0/RP0/CPU0:h_N1#

★1 EVPN VPWS state is up ( established ) UPしています。
★2 Default で fallback enabled です。つまり、SR-TE が仮に down しても IGP routing によって通信を継続します。
→ SR-TE down を fallback するという option 定義です。

② SR TE srte_c_60000_ep_6.6.6.6 の転送状況を確認します。

    RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng forwarding policy detail 
    Sun May 28 23:36:52.736 UTC
    
    SR-TE Policy Forwarding database
    --------------------------------
    
    Color: 60000, End-point: 6.6.6.6
★1   Name: srte_c_60000_ep_6.6.6.6
      Binding SID: 61000
★2   Active LSP:
        Candidate path:
          Preference: 100 (configuration)
          Name: LIGHTNING
★3     Local label: 1001007
        Segment lists:
          SL[0]:
            Name: EVPN_VPWS_PREFER
            Switched Packets/Bytes: 14856/1811022
              [MPLS -> MPLS]: 14856/1811022
            Paths:
              Path[0]:
                Outgoing Label: 16003
                Outgoing Interfaces: GigabitEthernet0/0/0/0
                Next Hop: 10.1.2.2
                Switched Packets/Bytes: 14856/1811022
                  [MPLS -> MPLS]: 14856/1811022
                FRR Pure Backup: No
                ECMP/LFA Backup: No
                Internal Recursive Label: Unlabelled (recursive)
★4             Label Stack (Top -> Bottom): { 16003, 16004, 16005, 16006 }
                Path-id: 1, Weight: 64
    
      Policy Packets/Bytes Switched: 23417/2943792
    
    RP/0/RP0/CPU0:h_N1#

★1 SR-TE のポリシー名は、srte_c_60000_ep_6.6.6.6
★2 SR-TE は有効です。
★3 Local label: 1001007 ★4 Label Stack している状況が確認できます。

③ SR-TE は UP/UP しています。

   RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy detail 
   Sun May 28 23:48:28.366 UTC
   
   SR-TE policy database
   ---------------------
   
★ Color: 60000, End-point: 6.6.6.6
     Name: srte_c_60000_ep_6.6.6.6
     Status:
★     Admin: up  Operational: up for 00:22:30 (since May 28 23:25:57.433)
     Candidate-paths:
       Preference: 100 (configuration) (active)
         Name: LIGHTNING
         Requested BSID: 61000
           Protection Type: protected-preferred
           Maximum SID Depth: 10 
★       Explicit: segment-list EVPN_VPWS_PREFER (valid)
           Weight: 1, Metric Type: TE
             16002
             16003
             16004
             16005
             16006
     LSPs:
       LSP[0]:
         LSP-ID: 3 policy ID: 5 (active)
         Local label: 1001007
         State: Programmed
         Binding SID: 61000
     Attributes:
       Binding SID: 61000
       Forward Class: Not Configured
       Steering labeled-services disabled: no
       Steering BGP disabled: no
       IPv6 caps enable: yes
       Invalidation drop enabled: no
   
   RP/0/RP0/CPU0:h_N1#

Admin: up Operational: up で、Explicit: segment-list EVPN_VPWS_PREFER (valid) 想定通り steering しています。

④ Provider NW内の SR-TE を traceroute で確認します。

RP/0/RP0/CPU0:h_N1#traceroute 6.6.6.6 source loopback 0                      
Sun May 28 23:42:38.955 UTC

Type escape sequence to abort.
Tracing the route to 6.6.6.6

 1  10.1.2.2 [MPLS: Labels 16003/16004/16005/16006 Exp 0] 12 msec  4 msec  4 msec 
 2  10.2.3.3 [MPLS: Labels 16004/16005/16006 Exp 0] 6 msec  4 msec  4 msec 
 3  10.3.4.4 [MPLS: Labels 16005/16006 Exp 0] 7 msec  4 msec  4 msec 
 4  10.4.5.5 [MPLS: Label 16006 Exp 0] 8 msec  4 msec  4 msec 
 5  10.5.6.6 12 msec  *  6 msec 
RP/0/RP0/CPU0:h_N1#

L2VPN なので CEルータ同士の疎通確認ではラベルスタックが確認できませんが、↑のようにトラフィックが流れます。

⑤ 当然ですが、CEルータ同士の疎通できています。

CE1#ping 192.0.2.200 repeat 40
Type escape sequence to abort.
Sending 40, 100-byte ICMP Echos to 192.0.2.200, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (40/40), round-trip min/avg/max = 2/3/8 ms
CE1#

⑥ ここで、SR-TE を DOWN させます。Explicit Path の最初の SID が Down すると、SR-TE が DOWN します。手っ取り早いのは h_N2 の Loopback 0 を shutdown することです。詳しくは、過去のブログをご参照ください。
chimay-wh.hatenablog.com

RP/0/RP0/CPU0:h_N2#con 
Sun May 28 23:57:24.318 UTC
RP/0/RP0/CPU0:h_N2(config)#int lo0
RP/0/RP0/CPU0:h_N2(config-if)#shutdown 
RP/0/RP0/CPU0:h_N2(config-if)#commit 
Sun May 28 23:57:34.816 UTC
RP/0/RP0/CPU0:h_N2(config-if)#

⑦ SR-TE が DOWN します。

   RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy detail 
   Sun May 28 23:59:17.625 UTC
   
   SR-TE policy database
   ---------------------
   
★ Color: 60000, End-point: 6.6.6.6
     Name: srte_c_60000_ep_6.6.6.6
     Status:
★     Admin: up  Operational: down for 00:01:42 (since May 28 23:57:35.059)
     Candidate-paths:
       Preference: 100 (configuration)
         Name: LIGHTNING
         Requested BSID: 61000
           Protection Type: protected-preferred
           Maximum SID Depth: 10 
★       Explicit: segment-list EVPN_VPWS_PREFER (invalid)
         Last error: unresolved first label (16002)
           Weight: 1, Metric Type: TE
     Attributes:
       Forward Class: 0
       Steering labeled-services disabled: no
       Steering BGP disabled: no
       IPv6 caps enable: no
       Invalidation drop enabled: no
             
   RP/0/RP0/CPU0:h_N1#

Admin: up Operational: down となり、segment-list EVPN_VPWS_PREFER (invalid) となります。

⑧ しかし、EVPN VPWS は、SR-TE を使わずに regular IGP path を使って state is up ( established ) を継続します。

   RP/0/RP0/CPU0:h_N1#show l2vpn xconnect detail 
   Mon May 29 00:08:19.514 UTC
   
   Group EVPN_VPWS, XC EVPN_1, state is up; Interworking none
     AC: GigabitEthernet0/0/0/1.10, state is up
       Type VLAN; Num Ranges: 1
       Rewrite Tags: []
       VLAN ranges: [10, 10]
       MTU 1504; XC ID 0x2; interworking none
       Statistics:
         packets: received 9030, sent 15901
         bytes: received 1370146, sent 1874042
         drops: illegal VLAN 0, illegal length 0
★   EVPN: neighbor 6.6.6.6, PW ID: evi 1010, ac-id 60, state is up ( established )
       XC ID 0xa0000003
       Encapsulation MPLS
       Encap type Ethernet, control word disabled
       Sequencing not set
       Preferred path Active : SR TE srte_c_60000_ep_6.6.6.6 (BSID:None, IFH:0x3c), Statically configured, fallback enabled
       Ignore MTU mismatch: Enabled
       Transmit MTU zero: Enabled
       Tunnel : Up
   
         EVPN         Local                          Remote                        
         ------------ ------------------------------ -----------------------------
         Label        24004                          24004                         
         MTU          1518                           unknown                       
         Control word disabled                       disabled                      
         AC ID        10                             60                            
         EVPN type    Ethernet                       Ethernet                      
   
         ------------ ------------------------------ -----------------------------
       Create time: 21/05/2023 06:33:56 (1w0d ago)
       Last time status changed: 28/05/2023 23:25:57 (00:42:21 ago)
       Statistics:
         packets: received 15901, sent 9030
         bytes: received 1874042, sent 1370146
   RP/0/RP0/CPU0:h_N1#

SR-TE の転送状況を確認すると、SR-TE を使っていないことは明白です。

   RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng forwarding policy detail 
   Mon May 29 00:15:18.715 UTC
   
   SR-TE Policy Forwarding database
   --------------------------------
   
   Color: 60000, End-point: 6.6.6.6
     Name: srte_c_60000_ep_6.6.6.6
   
     Policy Packets/Bytes Switched: 35199/4426854
   
   RP/0/RP0/CPU0:h_N1#

⑨ Provider NW内の SR-TE を traceroute で確認します。

RP/0/RP0/CPU0:h_N1#traceroute 6.6.6.6 source loopback 0
Mon May 29 00:17:30.554 UTC

Type escape sequence to abort.
Tracing the route to 6.6.6.6

 1  10.1.2.2 [MPLS: Label 16006 Exp 0] 10 msec 
    10.1.3.3 8 msec  3 msec 
 2  10.3.5.5 [MPLS: Label 16006 Exp 0] 7 msec 
    10.3.4.4 6 msec 
    10.3.5.5 4 msec 
 3  10.5.6.6 9 msec  * 
    10.4.6.6 5 msec 
RP/0/RP0/CPU0:h_N1#   

⑩ 当然ですが、CEルータ同士の疎通できています。

CE1#ping 192.0.2.200 repeat 40
Type escape sequence to abort.
Sending 40, 100-byte ICMP Echos to 192.0.2.200, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (40/40), round-trip min/avg/max = 4/5/7 ms
CE1#

これが fallback enabled(Default)の動作です。SR-TE が DOWN しても、regular IGP path を使って EVPN VPWS を継続利用できるようになります。

5.2 fallback disable 検証

ここまでの状況を簡単に言うと、SR-TE が DOWN しています。しかし、EVPN VPWS は preferred-path の fallback option によって通信を継続させています。 ここで、fallback option を disable にするとどうなるのかを検証します。

① fallback option を disable にします。

    RP/0/RP0/CPU0:h_N1#conf
    Mon May 29 00:22:57.885 UTC
    RP/0/RP0/CPU0:h_N1(config)#l2vpn 
    RP/0/RP0/CPU0:h_N1(config-l2vpn)#pw-class PW60000
    RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc)#encapsulation mpls 
★  RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#$srte_c_60000_ep_6.6.6.6 ?           
★    fallback  Fallback option for preferred path
★    <cr>      
★  RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#$srte_c_60000_ep_6.6.6.6 fallback ?
★    disable  Disable fallback for preferred path
★  RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#preferred-path sr-te policy srte_c_6$
    RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#show 
    Mon May 29 00:26:53.780 UTC
    l2vpn
     pw-class PW60000
      encapsulation mpls
       preferred-path sr-te policy srte_c_60000_ep_6.6.6.6 fallback disable
      !
     !
    !
    
    RP/0/RP0/CPU0:h_N1(config-l2vpn-pwc-mpls)#

② VPWS の詳細を確認します。

   RP/0/RP0/CPU0:h_N1#show l2vpn xconnect detail 
   Mon May 29 00:31:21.114 UTC
   
   Group EVPN_VPWS, XC EVPN_1, state is down; Interworking none
     AC: GigabitEthernet0/0/0/1.10, state is up
       Type VLAN; Num Ranges: 1
       Rewrite Tags: []
       VLAN ranges: [10, 10]
       MTU 1504; XC ID 0x2; interworking none
       Statistics:
         packets: received 9030, sent 15901
         bytes: received 1370146, sent 1874042
         drops: illegal VLAN 0, illegal length 0
★   EVPN: neighbor 6.6.6.6, PW ID: evi 1010, ac-id 60, state is down ( local ready )
       XC ID 0xa0000003
       Encapsulation MPLS
       Encap type Ethernet, control word disabled
       Sequencing not set
       Preferred path Active : SR TE srte_c_60000_ep_6.6.6.6 (BSID:None, IFH:0x3c), Statically configured, fallback disabled
       Ignore MTU mismatch: Enabled
       Transmit MTU zero: Enabled
       Tunnel : Down
   
         EVPN         Local                          Remote                        
         ------------ ------------------------------ -----------------------------
         Label        24004                          24004                         
         MTU          1518                           unknown                       
         Control word disabled                       disabled                      
         AC ID        10                             60                            
         EVPN type    Ethernet                       Ethernet                      
   
         ------------ ------------------------------ -----------------------------
       Create time: 21/05/2023 06:33:56 (1w0d ago)
       Last time status changed: 29/05/2023 00:30:59 (00:00:21 ago)
       Statistics:
         packets: received 15901, sent 9030
         bytes: received 1874042, sent 1370146
   RP/0/RP0/CPU0:h_N1#

state is down ( local ready ) となり、EVPN VPWS も SR-TE と同様に DOWN します。

③ Provider NW内の SR-TE を traceroute で確認します。

RP/0/RP0/CPU0:h_N1#traceroute 6.6.6.6 source loopback 0               
Mon May 29 00:36:22.736 UTC

Type escape sequence to abort.
Tracing the route to 6.6.6.6

 1  10.1.2.2 [MPLS: Label 16006 Exp 0] 9 msec  3 msec 
    10.1.3.3 6 msec 
 2  10.2.4.4 [MPLS: Label 16006 Exp 0] 5 msec  3 msec  4 msec 
 3  10.4.6.6 9 msec 
    10.5.6.6 5 msec  * 
RP/0/RP0/CPU0:h_N1#

regular IGP path が生きているため Head-end から End-point との通信は可能な状態です。

④ Provider NW 内は疎通可能な状態ですが、SR-TE が DOWN しており更に VPWS の preferred-path の fallback option が disable になっているため SR-TE の fallback が働かないため、CEルータ同士は疎通ができなくなります。

CE1#ping 192.0.2.200 repeat 40
Type escape sequence to abort.
Sending 40, 100-byte ICMP Echos to 192.0.2.200, timeout is 2 seconds:
........................................
Success rate is 0 percent (0/40)
CE1#

6. 参考

① EVPN VPWS Preferred Path over SR-TE Policy
www.cisco.com

次回は、On Demand Next-hop:ODN について記事を書きます。
最後までお読みいただきありがとうございました!

Single-Domain SR-TE その8(Automated Steering Ingress-PE)

Automated Steering Ingress-PE が理解できたので自分のメモ用にアウトプットします。

1. Automated Steering Ingress-PE

Automated Steering は SR-Policy への Traffic の steering を自動化するものです。 少し具体的に言うと、PE で特定 Prefix に応じた Color を判別し、Head-end で Color に応じた Steering をする機能のことです。
今回は、Ingress PE で Color assignment を行う場合を検証します。 つまり PEルータは Head-end だけ定義することになります。

2. Topology

3. Config

h_N1(主役① PEルータ)

hostname h_N1
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
vrf A
 rd 10:1
 address-family ipv4 unicast
  import route-target
   200:1
  !
  export route-target
   100:1
  !
 !
!
interface Loopback0
 ipv4 address 1.1.1.1 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.2.1 255.255.255.0
!
interface GigabitEthernet0/0/0/1.10 l2transport
 encapsulation dot1q 10
!
interface GigabitEthernet0/0/0/1.20
 vrf A    
 ipv4 address 198.51.100.1 255.255.255.0
 encapsulation dot1q 20
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.1.3.1 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 shutdown
!
interface GigabitEthernet0/0/0/4
 shutdown
!
extcommunity-set opaque BLUE
  10
end-set
!
extcommunity-set opaque GREEN
  20
end-set
!
route-policy PASS
  pass
end-policy
!
route-policy COLOR
  if destination in (2.2.2.10/32) then
    set extcommunity color BLUE
  endif
  if destination in (2.2.2.20/32) then
    set extcommunity color GREEN
  endif
end-policy
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0001.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 1
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/2
 !
!
router bgp 10
 bgp router-id 1.1.1.1
 address-family vpnv4 unicast
 !
 address-family l2vpn evpn
 !
 neighbor 6.6.6.6
  remote-as 10
  update-source Loopback0
  address-family vpnv4 unicast
   route-policy COLOR in
  !
  address-family l2vpn evpn
  !
 !
 vrf A
  rd 10:1
  address-family ipv4 unicast
  !
  neighbor 198.51.100.100
   remote-as 100
   address-family ipv4 unicast
    route-policy PASS in
    route-policy PASS out
   !
  !
 !
!
evpn
 evi 100
  advertise-mac
  !
 !
!
l2vpn
 xconnect group EVPN_VPWS
  p2p EVPN_1
   interface GigabitEthernet0/0/0/1.10
   neighbor evpn evi 1010 target 60 source 10
   !
  !
 !
!
mpls oam  
!
segment-routing
 traffic-eng
  segment-list LOWER
   index 10 mpls label 16003
   index 20 mpls label 16005
   index 30 mpls label 16006
  !
  segment-list UPPER
   index 10 mpls label 16002
   index 20 mpls label 16004
   index 30 mpls label 16006
  !
  policy BULE_10
   binding-sid mpls 60010
   color 10 end-point ipv4 6.6.6.6
   candidate-paths
    preference 100
     explicit segment-list UPPER
     !
    !
   !
  !       
  policy GREEN_20
   binding-sid mpls 60020
   color 20 end-point ipv4 6.6.6.6
   candidate-paths
    preference 100
     explicit segment-list LOWER
     !
    !
   !
  !
 !
!
mpls label range table 0 1001001 1001999
end

h_N2(脇役)

hostname h_N2
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 2.2.2.2 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.2.2 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.2.3.2 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.2.4.2 255.255.255.0
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0002.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 2
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
!
mpls oam
!
mpls label range table 0 1002001 1002999
end

h_N3(脇役)

hostname h_N3
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 3.3.3.3 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.3.3 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.2.3.3 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.3.5.3 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 ipv4 address 10.3.4.3 255.255.255.0
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0003.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 3
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
 interface GigabitEthernet0/0/0/3
 !
!
mpls oam
!
mpls label range table 0 1003001 1003999
end

h_N4(脇役)

hostname h_N4
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 4.4.4.4 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.2.4.4 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.4.5.4 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.4.6.4 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 ipv4 address 10.3.4.4 255.255.255.0
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0004.00
 address-family ipv4 unicast
 !
 interface Loopback0
  prefix-attributes anycast
  address-family ipv4 unicast
   prefix-sid index 4
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
 interface GigabitEthernet0/0/0/3
 !
!
mpls oam
!
mpls label range table 0 1004001 1004999
end

h_N5(脇役)

hostname h_N5
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 5.5.5.5 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.3.5.5 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.4.5.5 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.5.6.5 255.255.255.0
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0005.00
 address-family ipv4 unicast
 !
 interface Loopback0
  prefix-attributes anycast
  address-family ipv4 unicast
   prefix-sid index 5
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
!
mpls oam
!
mpls label range table 0 1005001 1005999
end

h_N6(準主役① PEルータ)

hostname h_N6
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
vrf B
 rd 10:6
 address-family ipv4 unicast
  import route-target
   100:1
  !
  export route-target
   200:1
  !
 !
!
interface Loopback0
 ipv4 address 6.6.6.6 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.4.6.6 255.255.255.0
!
interface GigabitEthernet0/0/0/1.10 l2transport
 encapsulation dot1q 10
!
interface GigabitEthernet0/0/0/1.30
 vrf B
 ipv4 address 203.0.113.6 255.255.255.0
 encapsulation dot1q 30
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.5.6.6 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 shutdown
!
interface GigabitEthernet0/0/0/4
 shutdown
!
route-policy PASS
  pass
end-policy
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0006.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 6
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/2
 !
!         
router bgp 10
 bgp router-id 6.6.6.6
 address-family vpnv4 unicast
 !
 address-family l2vpn evpn
 !
 neighbor 1.1.1.1
  remote-as 10
  update-source Loopback0
  address-family vpnv4 unicast
  !
  address-family l2vpn evpn
  !
 !
 vrf B
  rd 10:6
  address-family ipv4 unicast
  !
  neighbor 203.0.113.200
   remote-as 200
   address-family ipv4 unicast
    route-policy PASS in
    route-policy PASS out
   !
  !
 !
!
evpn
 evi 100
  advertise-mac
  !
 !
!
l2vpn
 xconnect group EVPN_VPWS
  p2p EVPN_1
   interface GigabitEthernet0/0/0/1.10
   neighbor evpn evi 1010 target 10 source 60
   !
  !
 !
!
mpls oam
!
mpls label range table 0 1006001 1006999
end

h_CE1(準主役② CEルータ)

hostname CE1
!
no ip domain lookup
!
interface Loopback0
 ip address 100.100.100.100 255.255.255.255
!
interface Loopback110
 ip address 1.1.1.10 255.255.255.255
!
interface GigabitEthernet1
 no ip address
!
interface GigabitEthernet1.10
 encapsulation dot1Q 10
 ip address 192.0.2.100 255.255.255.0
!
interface GigabitEthernet1.20
 encapsulation dot1Q 20
 ip address 198.51.100.100 255.255.255.0
!
router bgp 100
 bgp router-id 100.100.100.100
 bgp log-neighbor-changes
 network 1.1.1.10 mask 255.255.255.255
 neighbor 198.51.100.1 remote-as 10
!
line con 0
 exec-timeout 0 0
!
end

h_CE2(準主役③ CEルータ)

hostname CE2
!
no ip domain lookup
!
interface Loopback0
 ip address 200.200.200.200 255.255.255.255
!
interface Loopback210
 ip address 2.2.2.10 255.255.255.255
!
interface Loopback220
 ip address 2.2.2.20 255.255.255.255
!
interface GigabitEthernet1
 no ip address
!
interface GigabitEthernet1.10
 encapsulation dot1Q 10
 ip address 192.0.2.200 255.255.255.0
!
interface GigabitEthernet1.30
 encapsulation dot1Q 30
 ip address 203.0.113.200 255.255.255.0
!
router bgp 200
 bgp router-id 200.200.200.200
 bgp log-neighbor-changes
 network 2.2.2.10 mask 255.255.255.255
 network 2.2.2.20 mask 255.255.255.255
 neighbor 203.0.113.6 remote-as 10
!
line con 0
 exec-timeout 0 0
!
end

4. Automated steering Ingress-PE の実装

L3VPN が実装されている前提で話を進めます。
→ Single-Domain SR-TE その6(LxVPN over SR)完了した状態からスタートします。
※ Single-Domain SR-TE その7(Automated Steering Egress-PE)で使った route-policy は削除します。

実装の流れは、① Ingress PEルータで extended community を定義します。② Ingress PEルータで route-policy を定義します。③ Head-End で explicit Path を定義し、 ④ SR-TEのポリシーを定義します。⑤ 最後に経路(Candidate-paths)の候補を③で指定した path list から選択します。

4.1 PEルータ(Head-end)

4.1.1 extended community 定義

① extended community を以下のように定義します。
BLUE:10
GREEN:20

RP/0/RP0/CPU0:h_N1(config)#?
  extcommunity-set           Define an extended community set
RP/0/RP0/CPU0:h_N1(config)#extcommunity-set ?
  opaque     MLDP opaque types
RP/0/RP0/CPU0:h_N1(config)#extcommunity-set opaque ?
  WORD  Opaque type extcommunity set name
RP/0/RP0/CPU0:h_N1(config)#extcommunity-set opaque BLUE
RP/0/RP0/CPU0:h_N1(config-ext)#?
  <1-4294967295>  32-bit decimal number
RP/0/RP0/CPU0:h_N1(config-ext)#10
RP/0/RP0/CPU0:h_N1(config-ext)#end-set 
RP/0/RP0/CPU0:h_N1(config)#extcommunity-set opaque GREEN
RP/0/RP0/CPU0:h_N1(config-ext)#20
RP/0/RP0/CPU0:h_N1(config-ext)#end-set 
RP/0/RP0/CPU0:h_N1(config)#
4.1.2 route-policy 定義

① Prefix に応じた Color を付与する route-policy を定義します。

RP/0/RP0/CPU0:h_N1(config)#route-policy COLOR
RP/0/RP0/CPU0:h_N1(config-rpl)#?
  if                Begin if-statement
  <cr>              
RP/0/RP0/CPU0:h_N1(config-rpl)#if ?
  destination         Destination address in the route
RP/0/RP0/CPU0:h_N1(config-rpl)#if destination ?
  in                    Member of a set
RP/0/RP0/CPU0:h_N1(config-rpl)#if destination in ?
  (          Begin inline prefix set
RP/0/RP0/CPU0:h_N1(config-rpl)#if destination in (2.2.2.10/32) ?
  then  Then clause
RP/0/RP0/CPU0:h_N1(config-rpl)#if destination in (2.2.2.10/32) then 
RP/0/RP0/CPU0:h_N1(config-rpl-if)#?
  set               Set a route attribute
RP/0/RP0/CPU0:h_N1(config-rpl-if)#set ?
  extcommunity             BGP extended community attribute
RP/0/RP0/CPU0:h_N1(config-rpl-if)#set extcommunity ?
  color           BGP Color extended community
RP/0/RP0/CPU0:h_N1(config-rpl-if)#set extcommunity color ?
  BLUE       Opaque type extcommunity set name
  GREEN      Opaque type extcommunity set name
  WORD       Opaque type extcommunity set name
RP/0/RP0/CPU0:h_N1(config-rpl-if)#set extcommunity color BLUE 
RP/0/RP0/CPU0:h_N1(config-rpl-if)#endif
RP/0/RP0/CPU0:h_N1(config-rpl)#if destination in (2.2.2.20/32) then
RP/0/RP0/CPU0:h_N1(config-rpl-if)#set extcommunity color GREEN
RP/0/RP0/CPU0:h_N1(config-rpl-if)#endif 
RP/0/RP0/CPU0:h_N1(config-rpl)#end-policy 
RP/0/RP0/CPU0:h_N1(config)#commit 
Sun May 28 12:58:03.672 UTC
RP/0/RP0/CPU0:h_N1(config)#

② BGP の neighbor の inbound 方向に route-policy を適用します。
∵ neighbor から Color Assignment をしている Ingress PE への方向であるためです。

RP/0/RP0/CPU0:h_N1(config)#router bgp 10
RP/0/RP0/CPU0:h_N1(config-bgp)#neighbor 6.6.6.6
RP/0/RP0/CPU0:h_N1(config-bgp-nbr)#address-family vpnv4 unicast 
RP/0/RP0/CPU0:h_N1(config-bgp-nbr-af)#route-policy COLOR in
RP/0/RP0/CPU0:h_N1(config-bgp-nbr-af)#show
Sun May 28 12:59:18.360 UTC
router bgp 10
 neighbor 6.6.6.6
  address-family vpnv4 unicast
   route-policy COLOR in
  !
 !
!

RP/0/RP0/CPU0:h_N1(config-bgp-nbr-af)#commit 
Sun May 28 12:59:33.904 UTC
RP/0/RP0/CPU0:h_N1(config-bgp-nbr-af)#end
RP/0/RP0/CPU0:h_N1#

4.1.3 explicit Path の定義

① Segment Routing を定義します。

RP/0/RP0/CPU0:h_N1(config)#
  segment-routing            Segment Routing

② Segment Routing で Traffic Engineering を定義します。

RP/0/RP0/CPU0:h_N1(config-sr)#?
  traffic-eng         Segment Routing Traffic Engineering

③ Segment-list configuration でSegment-list名(任意:UPPER)を定義します。

RP/0/RP0/CPU0:h_N1(config-sr-te)#?
  segment-list        Segment-list configuration
RP/0/RP0/CPU0:h_N1(config-sr-te)#segment-list ?
  name  Segment-list name
  WORD  Identifying name for segment-list
RP/0/RP0/CPU0:h_N1(config-sr-te)#segment-list UPPER

④ SR-TEで経路を明示的に定義します。

RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#?
  index               Next entry index
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index ?
  <1-65535>  Index number
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index 10 ?
  mpls  MPLS configuration
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index 10 mpls ?
  label      MPLS label configuration
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index 10 mpls label ?
  <0-1048575>  MPLS label value
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index 10 mpls label 16002

上の方を流す UPPER:N1→N2→N4→N6 と下の方を流す LOWER:N1→N3→N5→N6 を作ります。

segment-routing
 traffic-eng
  segment-list LOWER
   index 10 mpls label 16003
   index 20 mpls label 16005
   index 30 mpls label 16006
  !
  segment-list UPPER
   index 10 mpls label 16002
   index 20 mpls label 16004
   index 30 mpls label 16006
  !
 !
!

4.1.4 SR-TE Policy の定義

SR-TE Policy を以下のように定義します。
UPPER
a) ポリシー名 :BULE_10
b) B-SID(任意):60010
c) color :10
d) Tail-End :6.6.6.6(h_N6)

LOWER
a) ポリシー名 :GREEN_20
b) B-SID(任意):60020
c) color :20
d) Tail-End :6.6.6.6(h_N6)

SR-TEは、a)ポリシー名とc)カラー、d)Tail-Endの指定が必須です。

① 先ずはポリシー名を定義します。

RP/0/RP0/CPU0:h_N1(config-sr-te)#policy ?
  WORD  Identifying name for policy with max 59 characters
RP/0/RP0/CPU0:h_N1(config-sr-te)#policy BULE_10

② B-SID(binding-sid)は任意設定です。 ※ SR-TE Policy自体に割り当てられたSIDをB-SID(binding-sid)と呼びます。

RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#?
  binding-sid              Binding Segment Identifier
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#binding-sid ?
  mpls  MPLS label
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#binding-sid mpls ?
  <16-1048575>  MPLS label
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#binding-sid mpls 60010

③ 次にカラーとTail-Endを指定します。

RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#?
  color                    Specify color for policy
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color ?
  <1-4294967295>  Color value
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color 10 ?
  end-point  Policy endpoint
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color 10 end-point ?
  ipv4  IPv4 address
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color 10 end-point ipv4 ?
  A.B.C.D  IPv4 endpoint address
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color 10 end-point ipv4 6.6.6.6 ?
  <cr>  

なお、Automate Steering の場合は autoroute が不要になります。

4.1.5 Candidate-paths の定義

Candidate-paths を以下のように定義します。
UPPER
a) preference :100
b) explicit path :BLUE_10

LOWER
a) preference :100
b) explicit path :GREEN_20

preference と指定する経路リストをセットで指定します。

RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#?
  candidate-paths          Candidate-paths configuration
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#candidate-paths 
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path)#?
  preference          Policy path-option preference entry
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path)#preference ?
  <1-65535>  Path-option preference
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path)#preference 100 
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path-pref)#?
  explicit            Preconfigured path
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path-pref)#explicit ?
  segment-list  Specify Segment-list
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path-pref)#explicit segment-list ?
  EXPLICIT_LIST  Identifying name for segment-list
  WORD           Identifying name for segment-list
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path-pref)#explicit segment-list BLUE_10

5. 検証

① Head-end 側で指定した Prefix 毎に Color が付与されていることを確認します。

   RP/0/RP0/CPU0:h_N1#show bgp vpnv4 unicast 
   Sun May 28 13:27:24.328 UTC
   BGP router identifier 1.1.1.1, local AS number 10
   BGP generic scan interval 60 secs
   Non-stop routing is enabled
   BGP table state: Active
   Table ID: 0x0   RD version: 0
   BGP main routing table version 52
   BGP NSR Initial initsync version 8 (Reached)
   BGP NSR/ISSU Sync-Group versions 0/0
   BGP scan interval 60 secs
   
   Status codes: s suppressed, d damped, h history, * valid, > best
                 i - internal, r RIB-failure, S stale, N Nexthop-discard
   Origin codes: i - IGP, e - EGP, ? - incomplete
      Network            Next Hop            Metric LocPrf Weight Path
   Route Distinguisher: 10:1 (default for vrf A)
   *> 1.1.1.10/32        198.51.100.100           0             0 100 i
★ *>i2.2.2.10/32        6.6.6.6 C:10             0    100      0 200 i
★ *>i2.2.2.20/32        6.6.6.6 C:20             0    100      0 200 i
   Route Distinguisher: 10:6
   *>i2.2.2.10/32        6.6.6.6 C:10             0    100      0 200 i
   *>i2.2.2.20/32        6.6.6.6 C:20             0    100      0 200 i
   
   Processed 5 prefixes, 5 paths
   RP/0/RP0/CPU0:h_N1#

RD 10:1 の vrf A でも指定の Prefix に応じた Color が付与されていることが確認できます。

② Head-end で Color に応じて Steering している様子を確認します。
Color 10 つまり CE2 の Prefix 2.2.2.10/32 が Provider NW 内を指定した segment-list UPPER で steeringしている様子を確認できます。

   RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy color 10 detail 
   Sun May 28 13:29:23.727 UTC
   
   SR-TE policy database
   ---------------------
   
★ Color: 10, End-point: 6.6.6.6
★   Name: srte_c_10_ep_6.6.6.6
     Status:
★     Admin: up  Operational: up for 14:30:25 (since May 27 22:58:58.615)
     Candidate-paths:
       Preference: 100 (configuration) (active)
★       Name: BULE_10
★       Requested BSID: 60010
           Protection Type: protected-preferred
           Maximum SID Depth: 10 
★       Explicit: segment-list UPPER (valid)
           Weight: 1, Metric Type: TE
★           16002
★           16004
★           16006
     LSPs:
       LSP[0]:
         LSP-ID: 2 policy ID: 3 (active)
★       Local label: 1001009
         State: Programmed
         Binding SID: 60010
     Attributes:
       Binding SID: 60010
       Forward Class: Not Configured
       Steering labeled-services disabled: no
       Steering BGP disabled: no
       IPv6 caps enable: yes
       Invalidation drop enabled: no
   
   RP/0/RP0/CPU0:h_N1#

Color 10:BLUE は segment-list UPPER(N1→N2:16002→N4:16004→N6:16006)を経由することが分かります。

③ Local label: 1001009 に注目して LFIB を確認してもラベルスタックの様子が確認できます。

   RP/0/RP0/CPU0:h_N1#show mpls forwarding labels 1001009 detail 
   Sun May 28 13:33:53.797 UTC
   Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
   Label  Label       or ID              Interface                    Switched    
   ------ ----------- ------------------ ------------ --------------- ------------
★ 1001009 16004       SR TE: 3 [TE-INT]  Gi0/0/0/0    10.1.2.2        1152        
        Updated: May 27 22:58:58.620
        Version: 52, Priority: 2
★      Label Stack (Top -> Bottom): { 16004 16006 }
        NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
        MAC/Encaps: 4/12, MTU: 1500
        Outgoing Interface: GigabitEthernet0/0/0/0 (ifhandle 0x01000018)
        Packets Switched: 36
   
   RP/0/RP0/CPU0:h_N1#

④ 次に Color 20 つまり CE2 の Prefix 2.2.2.20/32 についてトラフィックを steering する様子を確認します。

   RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy color 20 detail  
   Sun May 28 13:36:14.034 UTC
   
   SR-TE policy database
   ---------------------
   
★ Color: 20, End-point: 6.6.6.6
★   Name: srte_c_20_ep_6.6.6.6
     Status:
★     Admin: up  Operational: up for 06:49:59 (since May 28 06:46:14.410)
     Candidate-paths:
       Preference: 100 (configuration) (active)
★       Name: GREEN_20
★       Requested BSID: 60020
           Protection Type: protected-preferred
           Maximum SID Depth: 10 
★       Explicit: segment-list LOWER (valid)
           Weight: 1, Metric Type: TE
★           16003
★           16005
★           16006
     LSPs:
       LSP[0]:
         LSP-ID: 2 policy ID: 4 (active)
★       Local label: 1001008
         State: Programmed
         Binding SID: 60020
     Attributes:
       Binding SID: 60020
       Forward Class: Not Configured
       Steering labeled-services disabled: no
       Steering BGP disabled: no
       IPv6 caps enable: yes
       Invalidation drop enabled: no
   
   RP/0/RP0/CPU0:h_N1#

Color 20:GREEN は segment-list LOWER(N1→N3:16003→N5:16005→N6:16006)を経由することが分かります。

⑤ Local label: 1001008 に注目して LFIB を確認してもラベルスタックの様子が確認できます。

   RP/0/RP0/CPU0:h_N1#show mpls forwarding labels 1001008 detail 
   Sun May 28 13:38:05.864 UTC
   Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
   Label  Label       or ID              Interface                    Switched    
   ------ ----------- ------------------ ------------ --------------- ------------
★ 1001008 16005       SR TE: 4 [TE-INT]  Gi0/0/0/2    10.1.3.3        1152        
        Updated: May 28 06:46:14.409
        Version: 63, Priority: 2
★      Label Stack (Top -> Bottom): { 16005 16006 }
        NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
        MAC/Encaps: 4/12, MTU: 1500
        Outgoing Interface: GigabitEthernet0/0/0/2 (ifhandle 0x01000030)
        Packets Switched: 36
   
   RP/0/RP0/CPU0:h_N1#

⑥ traceroute することで Prefix に応じて経路が変化している様子を確認します。

CE1#traceroute 2.2.2.10 source loopback 110
Type escape sequence to abort.
Tracing the route to 2.2.2.10
VRF info: (vrf in name/id, vrf out name/id)
  1 198.51.100.1 8 msec 2 msec 3 msec
  2 10.1.2.2 [MPLS: Labels 16004/16006/1006006 Exp 0] 17 msec 8 msec 9 msec
  3 10.2.4.4 [MPLS: Labels 16006/1006006 Exp 0] 10 msec 7 msec 8 msec
  4 10.4.6.6 [MPLS: Label 1006006 Exp 0] 11 msec 8 msec 8 msec
  5 203.0.113.200 9 msec *  8 msec
CE1#
CE1#traceroute 2.2.2.20 source loopback 110
Type escape sequence to abort.
Tracing the route to 2.2.2.20
VRF info: (vrf in name/id, vrf out name/id)
  1 198.51.100.1 3 msec 2 msec 2 msec
  2 10.1.3.3 [MPLS: Labels 16005/16006/1006005 Exp 0] 11 msec 8 msec 9 msec
  3 10.3.5.5 [MPLS: Labels 16006/1006005 Exp 0] 10 msec 8 msec 7 msec
  4 10.5.6.6 [MPLS: Label 1006005 Exp 0] 8 msec 7 msec 7 msec
  5 203.0.113.200 8 msec *  9 msec
CE1#

6. 参考

① Automated Steering https://www.cisco.com/c/en/us/td/docs/routers/asr9000/software/asr9k-r7-3/segment-routing/configuration/guide/b-segment-routing-cg-asr9000-73x/b-segment-routing-cg-asr9000-71x_chapter_01000.html#id_125429

② Segment Routing Automated Steering
https://y-network.jp/2020/08/05/segment-routing-025/

次回は、EVPN VPWS Preferred Path over SR-TE Policy について記事を書きます。
最後までお読みいただきありがとうございました!

Single-Domain SR-TE その7(Automated Steering Egress-PE)

Automated Steering Egress-PE が理解できたので自分のメモ用にアウトプットします。

1. Automated Steering Egress-PE

Automated Steering は SR-Policy への Traffic の steering を自動化するものです。 少し具体的に言うと、PE で特定 Prefix に応じた Color を判別し、Head-end で Color に応じた Steering をする機能のことです。
今回は、Egress PE で Color assignment を行う場合を検証します。

2. Topology

3. Config

h_N1(主役① PEルータ)

hostname h_N1
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
vrf A
 rd 10:1
 address-family ipv4 unicast
  import route-target
   200:1
  !
  export route-target
   100:1
  !
 !
!
interface Loopback0
 ipv4 address 1.1.1.1 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.2.1 255.255.255.0
!
interface GigabitEthernet0/0/0/1.10 l2transport
 encapsulation dot1q 10
!
interface GigabitEthernet0/0/0/1.20
 vrf A    
 ipv4 address 198.51.100.1 255.255.255.0
 encapsulation dot1q 20
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.1.3.1 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 shutdown
!
interface GigabitEthernet0/0/0/4
 shutdown
!
route-policy PASS
  pass
end-policy
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0001.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 1
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/2
 !
!
router bgp 10
 bgp router-id 1.1.1.1
 address-family vpnv4 unicast
 !
 address-family l2vpn evpn
 !
 neighbor 6.6.6.6
  remote-as 10
  update-source Loopback0
  address-family vpnv4 unicast
  !
  address-family l2vpn evpn
  !
 !
 vrf A    
  rd 10:1
  address-family ipv4 unicast
  !
  neighbor 198.51.100.100
   remote-as 100
   address-family ipv4 unicast
    route-policy PASS in
    route-policy PASS out
   !
  !
 !
!
evpn
 evi 100
  advertise-mac
  !
 !
!
l2vpn
 xconnect group EVPN_VPWS
  p2p EVPN_1
   interface GigabitEthernet0/0/0/1.10
   neighbor evpn evi 1010 target 60 source 10
   !
  !
 !
!
mpls oam
!
segment-routing
 traffic-eng
  segment-list LOWER
   index 10 mpls label 16003
   index 20 mpls label 16005
   index 30 mpls label 16006
  !
  segment-list UPPER
   index 10 mpls label 16002
   index 20 mpls label 16004
   index 30 mpls label 16006
  !
  policy BULE_10
   binding-sid mpls 60010
   color 10 end-point ipv4 6.6.6.6
   candidate-paths
    preference 100
     explicit segment-list UPPER
     !
    !
   !
  !
  policy GREEN_20
   binding-sid mpls 60020
   color 20 end-point ipv4 6.6.6.6
   candidate-paths
    preference 100
     explicit segment-list LOWER
     !
    !
   !
  !
 !
!
mpls label range table 0 1001001 1001999
end

h_N2(脇役)

hostname h_N2
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 2.2.2.2 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.2.2 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.2.3.2 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.2.4.2 255.255.255.0
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0002.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 2
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
!
mpls oam
!
mpls label range table 0 1002001 1002999
end

h_N3(脇役)

hostname h_N3
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 3.3.3.3 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.1.3.3 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.2.3.3 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.3.5.3 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 ipv4 address 10.3.4.3 255.255.255.0
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0003.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 3
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
 interface GigabitEthernet0/0/0/3
 !
!
mpls oam
!
mpls label range table 0 1003001 1003999
end

h_N4(脇役)

hostname h_N4
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 4.4.4.4 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.2.4.4 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.4.5.4 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.4.6.4 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 ipv4 address 10.3.4.4 255.255.255.0
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0004.00
 address-family ipv4 unicast
 !
 interface Loopback0
  prefix-attributes anycast
  address-family ipv4 unicast
   prefix-sid index 4
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
 interface GigabitEthernet0/0/0/3
 !
!
mpls oam
!
mpls label range table 0 1004001 1004999
end

h_N5(脇役)

hostname h_N5
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
interface Loopback0
 ipv4 address 5.5.5.5 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.3.5.5 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 10.4.5.5 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.5.6.5 255.255.255.0
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0005.00
 address-family ipv4 unicast
 !
 interface Loopback0
  prefix-attributes anycast
  address-family ipv4 unicast
   prefix-sid index 5
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/1
 !
 interface GigabitEthernet0/0/0/2
 !
!
mpls oam
!
mpls label range table 0 1005001 1005999
end

h_N6(主役② PEルータ)

hostname h_N6
group CCIE-ISIS
 router isis '.*'
  is-type level-2-only
  address-family ipv4 unicast
   metric-style wide
   segment-routing mpls
  !
  interface 'Gi.*'
   point-to-point
   address-family ipv4 unicast
   !
  !
  interface 'Loopback .*'
   address-family ipv4 unicast
   !
  !
 !
end-group
!
vrf B
 rd 10:6
 address-family ipv4 unicast
  import route-target
   100:1
  !
  export route-target
   200:1
  !
 !
!
interface Loopback0
 ipv4 address 6.6.6.6 255.255.255.255
!
interface MgmtEth0/RP0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 10.4.6.6 255.255.255.0
!
interface GigabitEthernet0/0/0/1.10 l2transport
 encapsulation dot1q 10
!
interface GigabitEthernet0/0/0/1.30
 vrf B
 ipv4 address 203.0.113.6 255.255.255.0
 encapsulation dot1q 30
!
interface GigabitEthernet0/0/0/2
 ipv4 address 10.5.6.6 255.255.255.0
!
interface GigabitEthernet0/0/0/3
 shutdown
!
interface GigabitEthernet0/0/0/4
 shutdown
!
extcommunity-set opaque BLUE
  10
end-set
!
extcommunity-set opaque GREEN
  20
end-set
!
route-policy PASS
  pass
end-policy
!
route-policy COLOR
  if destination in (2.2.2.10/32) then
    set extcommunity color BLUE
  endif
  if destination in (2.2.2.20/32) then
    set extcommunity color GREEN
  endif
end-policy
!
router isis 1
 apply-group CCIE-ISIS
 net 49.0001.0000.0000.0006.00
 address-family ipv4 unicast
 !
 interface Loopback0
  address-family ipv4 unicast
   prefix-sid index 6
  !
 !
 interface GigabitEthernet0/0/0/0
 !
 interface GigabitEthernet0/0/0/2
 !
!         
router bgp 10
 bgp router-id 6.6.6.6
 address-family vpnv4 unicast
 !
 address-family l2vpn evpn
 !
 neighbor 1.1.1.1
  remote-as 10
  update-source Loopback0
  address-family vpnv4 unicast
   route-policy COLOR out
  !
  address-family l2vpn evpn
  !
 !
 vrf B
  rd 10:6
  address-family ipv4 unicast
  !
  neighbor 203.0.113.200
   remote-as 200
   address-family ipv4 unicast
    route-policy PASS in
    route-policy PASS out
   !
  !
 !
!
evpn
 evi 100
  advertise-mac
  !
 !
!
l2vpn
 xconnect group EVPN_VPWS
  p2p EVPN_1
   interface GigabitEthernet0/0/0/1.10
   neighbor evpn evi 1010 target 10 source 60
   !
  !
 !
!
mpls oam
!
mpls label range table 0 1006001 1006999
end

h_CE1(準主役① CEルータ)

hostname CE1
!
no ip domain lookup
!
interface Loopback0
 ip address 100.100.100.100 255.255.255.255
!
interface Loopback110
 ip address 1.1.1.10 255.255.255.255
!
interface GigabitEthernet1
 no ip address
!
interface GigabitEthernet1.10
 encapsulation dot1Q 10
 ip address 192.0.2.100 255.255.255.0
!
interface GigabitEthernet1.20
 encapsulation dot1Q 20
 ip address 198.51.100.100 255.255.255.0
!
router bgp 100
 bgp router-id 100.100.100.100
 bgp log-neighbor-changes
 network 1.1.1.10 mask 255.255.255.255
 neighbor 198.51.100.1 remote-as 10
!
line con 0
 exec-timeout 0 0
!
end

h_CE2(準主役② CEルータ)

hostname CE2
!
no ip domain lookup
!
interface Loopback0
 ip address 200.200.200.200 255.255.255.255
!
interface Loopback210
 ip address 2.2.2.10 255.255.255.255
!
interface Loopback220
 ip address 2.2.2.20 255.255.255.255
!
interface GigabitEthernet1
 no ip address
!
interface GigabitEthernet1.10
 encapsulation dot1Q 10
 ip address 192.0.2.200 255.255.255.0
!
interface GigabitEthernet1.30
 encapsulation dot1Q 30
 ip address 203.0.113.200 255.255.255.0
!
router bgp 200
 bgp router-id 200.200.200.200
 bgp log-neighbor-changes
 network 2.2.2.10 mask 255.255.255.255
 network 2.2.2.20 mask 255.255.255.255
 neighbor 203.0.113.6 remote-as 10
!
line con 0
 exec-timeout 0 0
!
end

4. Automated steering Egress-PE の実装

L3VPN が実装されている前提で話を進めます。
→ Single-Domain SR-TE その6(LxVPN over SR)完了した状態からスタートします。
※ L2VPN が定義されていますが、削除するのが面倒だったので残しているだけです。
実装の流れは、① Egress PEルータで extended community を定義します。② Egress PEルータで route-policy を定義します。③ Head-End で explicit Path を定義し、 ④ SR-TEのポリシーを定義します。⑤ 最後に経路(Candidate-paths)の候補を③で指定した path list から選択します。

4.1 PEルータ(End-point)

4.1.1 extended community 定義

① extended community を以下のように定義します。
BLUE:10
GREEN:20

RP/0/RP0/CPU0:h_N6(config)#?
  extcommunity-set           Define an extended community set
RP/0/RP0/CPU0:h_N6(config)#extcommunity-set ?
  opaque     MLDP opaque types
RP/0/RP0/CPU0:h_N6(config)#extcommunity-set opaque ?
  WORD  Opaque type extcommunity set name
RP/0/RP0/CPU0:h_N6(config)#extcommunity-set opaque BLUE
RP/0/RP0/CPU0:h_N6(config-ext)#?
  <1-4294967295>  32-bit decimal number
RP/0/RP0/CPU0:h_N6(config-ext)#10
RP/0/RP0/CPU0:h_N6(config-ext)#end-set 
RP/0/RP0/CPU0:h_N6(config)#extcommunity-set opaque GREEN
RP/0/RP0/CPU0:h_N6(config-ext)#20
RP/0/RP0/CPU0:h_N6(config-ext)#end-set 
RP/0/RP0/CPU0:h_N6(config)#
4.1.2 route-policy 定義

① Prefix に応じた Color を付与する route-policy を定義します。

RP/0/RP0/CPU0:h_N6(config)#route-policy COLOR
RP/0/RP0/CPU0:h_N6(config-rpl)#?
  if                Begin if-statement
  <cr>              
RP/0/RP0/CPU0:h_N6(config-rpl)#if ?
  destination         Destination address in the route
RP/0/RP0/CPU0:h_N6(config-rpl)#if destination ?
  in                    Member of a set
RP/0/RP0/CPU0:h_N6(config-rpl)#if destination in ?
  (          Begin inline prefix set
RP/0/RP0/CPU0:h_N6(config-rpl)#if destination in (2.2.2.10/32) ?
  then  Then clause
RP/0/RP0/CPU0:h_N6(config-rpl)#if destination in (2.2.2.10/32) then 
RP/0/RP0/CPU0:h_N6(config-rpl-if)#?
  set               Set a route attribute
RP/0/RP0/CPU0:h_N6(config-rpl-if)#set ?
  extcommunity             BGP extended community attribute
RP/0/RP0/CPU0:h_N6(config-rpl-if)#set extcommunity ?
  color           BGP Color extended community
RP/0/RP0/CPU0:h_N6(config-rpl-if)#set extcommunity color ?
  BLUE       Opaque type extcommunity set name
  GREEN      Opaque type extcommunity set name
  WORD       Opaque type extcommunity set name
RP/0/RP0/CPU0:h_N6(config-rpl-if)#set extcommunity color BLUE 
RP/0/RP0/CPU0:h_N6(config-rpl-if)#endif
RP/0/RP0/CPU0:h_N6(config-rpl)#if destination in (2.2.2.20/32) then
RP/0/RP0/CPU0:h_N6(config-rpl-if)#set extcommunity color GREEN
RP/0/RP0/CPU0:h_N6(config-rpl-if)#endif 
RP/0/RP0/CPU0:h_N6(config-rpl)#end-policy 
RP/0/RP0/CPU0:h_N6(config)#commit 
Sat May 27 22:20:46.568 UTC
RP/0/RP0/CPU0:h_N6(config)#

② BGP の neighbor の outbound 方向に route-policy を適用します。
∵ neighbor から Color Assignment をしている Egress PE への方向であるためです。

RP/0/RP0/CPU0:h_N6#conf 
Sat May 27 22:33:45.123 UTC
RP/0/RP0/CPU0:h_N6(config)#router bgp 10
RP/0/RP0/CPU0:h_N6(config-bgp)#neighbor 1.1.1.1
RP/0/RP0/CPU0:h_N6(config-bgp-nbr)#address-family vpnv4 unicast 
RP/0/RP0/CPU0:h_N6(config-bgp-nbr-af)#route-policy COLOR out
RP/0/RP0/CPU0:h_N6(config-bgp-nbr-af)#show
Sat May 27 22:34:46.212 UTC
router bgp 10
 neighbor 1.1.1.1
  address-family vpnv4 unicast
   route-policy COLOR out
  !
 !
!

RP/0/RP0/CPU0:h_N6(config-bgp-nbr-af)#commit 
Sat May 27 22:34:49.060 UTC
RP/0/RP0/CPU0:h_N6(config-bgp-nbr-af)#end
RP/0/RP0/CPU0:h_N6#

4.2 PEルータ(Head-end)

4.2.1 explicit Path の定義

① Segment Routing を定義します。

RP/0/RP0/CPU0:h_N1(config)#
  segment-routing            Segment Routing

② Segment Routing で Traffic Engineering を定義します。

RP/0/RP0/CPU0:h_N1(config-sr)#?
  traffic-eng         Segment Routing Traffic Engineering

③ Segment-list configuration でSegment-list名(任意:UPPER)を定義します。

RP/0/RP0/CPU0:h_N1(config-sr-te)#?
  segment-list        Segment-list configuration
RP/0/RP0/CPU0:h_N1(config-sr-te)#segment-list ?
  name  Segment-list name
  WORD  Identifying name for segment-list
RP/0/RP0/CPU0:h_N1(config-sr-te)#segment-list UPPER

④ SR-TEで経路を明示的に定義します。

RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#?
  index               Next entry index
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index ?
  <1-65535>  Index number
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index 10 ?
  mpls  MPLS configuration
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index 10 mpls ?
  label      MPLS label configuration
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index 10 mpls label ?
  <0-1048575>  MPLS label value
RP/0/RP0/CPU0:h_N1(config-sr-te-sl)#index 10 mpls label 16002

上の方を流す UPPER:N1→N2→N4→N6 と下の方を流す LOWER:N1→N3→N5→N6 を作ります。

segment-routing
 traffic-eng
  segment-list LOWER
   index 10 mpls label 16003
   index 20 mpls label 16005
   index 30 mpls label 16006
  !
  segment-list UPPER
   index 10 mpls label 16002
   index 20 mpls label 16004
   index 30 mpls label 16006
  !
 !
!

4.2.2 SR-TE Policy の定義

SR-TE Policy を以下のように定義します。
UPPER
a) ポリシー名 :BULE_10
b) B-SID(任意):60010
c) color :10
d) Tail-End :6.6.6.6(h_N6)

LOWER
a) ポリシー名 :GREEN_20
b) B-SID(任意):60020
c) color :20
d) Tail-End :6.6.6.6(h_N6)

SR-TEは、a)ポリシー名とc)カラー、d)Tail-Endの指定が必須です。

① 先ずはポリシー名を定義します。

RP/0/RP0/CPU0:h_N1(config-sr-te)#policy ?
  WORD  Identifying name for policy with max 59 characters
RP/0/RP0/CPU0:h_N1(config-sr-te)#policy BULE_10

② B-SID(binding-sid)は任意設定です。 ※ SR-TE Policy自体に割り当てられたSIDをB-SID(binding-sid)と呼びます。

RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#?
  binding-sid              Binding Segment Identifier
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#binding-sid ?
  mpls  MPLS label
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#binding-sid mpls ?
  <16-1048575>  MPLS label
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#binding-sid mpls 60010

③ 次にカラーとTail-Endを指定します。

RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#?
  color                    Specify color for policy
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color ?
  <1-4294967295>  Color value
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color 10 ?
  end-point  Policy endpoint
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color 10 end-point ?
  ipv4  IPv4 address
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color 10 end-point ipv4 ?
  A.B.C.D  IPv4 endpoint address
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#color 10 end-point ipv4 6.6.6.6 ?
  <cr>  

なお、Automate Steering の場合は autoroute が不要になります。

4.2.3 Candidate-paths の定義

Candidate-paths を以下のように定義します。
UPPER
a) preference :100
b) explicit path :BLUE_10

LOWER
a) preference :100
b) explicit path :GREEN_20

preference と指定する経路リストをセットで指定します。

RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#?
  candidate-paths          Candidate-paths configuration
RP/0/RP0/CPU0:h_N1(config-sr-te-policy)#candidate-paths 
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path)#?
  preference          Policy path-option preference entry
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path)#preference ?
  <1-65535>  Path-option preference
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path)#preference 100 
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path-pref)#?
  explicit            Preconfigured path
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path-pref)#explicit ?
  segment-list  Specify Segment-list
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path-pref)#explicit segment-list ?
  EXPLICIT_LIST  Identifying name for segment-list
  WORD           Identifying name for segment-list
RP/0/RP0/CPU0:h_N1(config-sr-te-policy-path-pref)#explicit segment-list BLUE_10

5. 検証

① Egress PE で Color Assignment して advertise している状況を確認します。

   RP/0/RP0/CPU0:h_N6#show bgp vpnv4 unicast advertised 
   Sun May 28 09:56:21.754 UTC
★ Route Distinguisher: 10:6
★ 2.2.2.10/32 is advertised to 1.1.1.1
     Path info:
       neighbor: 203.0.113.200   neighbor router id: 200.200.200.200
       valid  external  best  import-candidate  
   Received Path ID 0, Local Path ID 1, version 7
     Attributes after inbound policy was applied:
       next hop: 203.0.113.200
       MET ORG AS EXTCOMM 
       origin: IGP  neighbor as: 200  metric: 0  
       aspath: 200
       extended community: RT:200:1 
★   Attributes after outbound policy was applied:
       next hop: 6.6.6.6
       MET ORG AS EXTCOMM 
       origin: IGP  neighbor as: 200  metric: 0  
       aspath: 200
★     extended community: RT:200:1 Color:10 
   
★ Route Distinguisher: 10:6
★ 2.2.2.20/32 is advertised to 1.1.1.1
     Path info:
       neighbor: 203.0.113.200   neighbor router id: 200.200.200.200
       valid  external  best  import-candidate  
   Received Path ID 0, Local Path ID 1, version 8
     Attributes after inbound policy was applied:
       next hop: 203.0.113.200
       MET ORG AS EXTCOMM 
       origin: IGP  neighbor as: 200  metric: 0  
       aspath: 200
       extended community: RT:200:1 
★   Attributes after outbound policy was applied:
       next hop: 6.6.6.6
       MET ORG AS EXTCOMM 
       origin: IGP  neighbor as: 200  metric: 0  
       aspath: 200
★     extended community: RT:200:1 Color:20 
   
   RP/0/RP0/CPU0:h_N6#

★部を見て分かる通り Prefix に応じた Color が付与されていることが分かります。
route-policy の方向は、outbound policy was applied となっています。

② Head-end 側でも Egress PE で指定した Prefix 毎に Color が付与されていることを確認します。

   RP/0/RP0/CPU0:h_N1#show bgp vpnv4 unicast 
   Sun May 28 09:59:46.009 UTC
   BGP router identifier 1.1.1.1, local AS number 10
   BGP generic scan interval 60 secs
   Non-stop routing is enabled
   BGP table state: Active
   Table ID: 0x0   RD version: 0
   BGP main routing table version 36
   BGP NSR Initial initsync version 8 (Reached)
   BGP NSR/ISSU Sync-Group versions 0/0
   BGP scan interval 60 secs
   
   Status codes: s suppressed, d damped, h history, * valid, > best
                 i - internal, r RIB-failure, S stale, N Nexthop-discard
   Origin codes: i - IGP, e - EGP, ? - incomplete
      Network            Next Hop            Metric LocPrf Weight Path
   Route Distinguisher: 10:1 (default for vrf A)
   *> 1.1.1.10/32        198.51.100.100           0             0 100 i
★ *>i2.2.2.10/32        6.6.6.6 C:10             0    100      0 200 i
★ *>i2.2.2.20/32        6.6.6.6 C:20             0    100      0 200 i
   Route Distinguisher: 10:6
   *>i2.2.2.10/32        6.6.6.6 C:10             0    100      0 200 i
   *>i2.2.2.20/32        6.6.6.6 C:20             0    100      0 200 i
   
   Processed 5 prefixes, 5 paths
   RP/0/RP0/CPU0:h_N1#

RD 10:1 の vrf A でも指定の Prefix に応じた Color が付与されていることが確認できます。

③ Head-end で Color に応じて Steering している様子を確認します。
Color 10 つまり CE2 の Prefix 2.2.2.10/32 が Provider NW 内を指定した segment-list UPPER で steeringしている様子を確認できます。

   RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy color 10 detail 
   Sun May 28 10:13:25.663 UTC
   
   SR-TE policy database
   ---------------------
   
★ Color: 10, End-point: 6.6.6.6
★   Name: srte_c_10_ep_6.6.6.6
     Status:
★     Admin: up  Operational: up for 11:14:27 (since May 27 22:58:58.615)
     Candidate-paths:
       Preference: 100 (configuration) (active)
★       Name: BULE_10
★       Requested BSID: 60010
           Protection Type: protected-preferred
           Maximum SID Depth: 10 
         Explicit: segment-list UPPER (valid)
           Weight: 1, Metric Type: TE
★           16002
★           16004
★           16006
     LSPs:
       LSP[0]:
         LSP-ID: 2 policy ID: 3 (active)
★       Local label: 1001009
         State: Programmed
         Binding SID: 60010
     Attributes:
       Binding SID: 60010
       Forward Class: Not Configured
       Steering labeled-services disabled: no
       Steering BGP disabled: no
       IPv6 caps enable: yes
       Invalidation drop enabled: no
   
   RP/0/RP0/CPU0:h_N1#

Color 10:BLUE は segment-list UPPER(N1→N2:16002→N4:16004→N6:16006)を経由することが分かります。

④ Local label: 1001009 に注目して LFIB を確認してもラベルスタックの様子が確認できます。

   RP/0/RP0/CPU0:h_N1#show mpls forwarding labels 1001009 detail 
   Sun May 28 11:01:45.626 UTC
   Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
   Label  Label       or ID              Interface                    Switched    
   ------ ----------- ------------------ ------------ --------------- ------------
★ 1001009 16004       SR TE: 3 [TE-INT]  Gi0/0/0/0    10.1.2.2        768         
        Updated: May 27 22:58:58.621
        Version: 52, Priority: 2
★      Label Stack (Top -> Bottom): { 16004 16006 }
        NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
        MAC/Encaps: 4/12, MTU: 1500
        Outgoing Interface: GigabitEthernet0/0/0/0 (ifhandle 0x01000018)
        Packets Switched: 24
   
   RP/0/RP0/CPU0:h_N1#

⑤ 次に Color 20 つまり CE2 の Prefix 2.2.2.20/32 についてトラフィックを steering する様子を確認します。

   RP/0/RP0/CPU0:h_N1#show segment-routing traffic-eng policy color 20 detail 
   Sun May 28 10:19:57.739 UTC
   
   SR-TE policy database
   ---------------------
   
★ Color: 20, End-point: 6.6.6.6
★   Name: srte_c_20_ep_6.6.6.6
     Status:
★     Admin: up  Operational: up for 03:33:43 (since May 28 06:46:14.410)
     Candidate-paths:
       Preference: 100 (configuration) (active)
★       Name: GREEN_20
★       Requested BSID: 60020
           Protection Type: protected-preferred
           Maximum SID Depth: 10 
         Explicit: segment-list LOWER (valid)
           Weight: 1, Metric Type: TE
★           16003
★           16005
★           16006
     LSPs:
       LSP[0]:
         LSP-ID: 2 policy ID: 4 (active)
★       Local label: 1001008
         State: Programmed
         Binding SID: 60020
     Attributes:
       Binding SID: 60020
       Forward Class: Not Configured
       Steering labeled-services disabled: no
       Steering BGP disabled: no
       IPv6 caps enable: yes
       Invalidation drop enabled: no
   
   RP/0/RP0/CPU0:h_N1#

Color 20:GREEN は segment-list LOWER(N1→N3:16003→N5:16005→N6:16006)を経由することが分かります。

⑥ Local label: 1001008 に注目して LFIB を確認してもラベルスタックの様子が確認できます。

   RP/0/RP0/CPU0:h_N1#show mpls forwarding labels 1001008 detail 
   Sun May 28 11:05:39.769 UTC
   Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
   Label  Label       or ID              Interface                    Switched    
   ------ ----------- ------------------ ------------ --------------- ------------
★ 1001008 16005       SR TE: 4 [TE-INT]  Gi0/0/0/2    10.1.3.3        768         
        Updated: May 28 06:46:14.410
        Version: 63, Priority: 2
★      Label Stack (Top -> Bottom): { 16005 16006 }
        NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
        MAC/Encaps: 4/12, MTU: 1500
        Outgoing Interface: GigabitEthernet0/0/0/2 (ifhandle 0x01000030)
        Packets Switched: 24
   
   RP/0/RP0/CPU0:h_N1#

⑦ traceroute することで Prefix に応じて経路が変化している様子を確認します。

CE1#traceroute 2.2.2.10 source loopback 110
Type escape sequence to abort.
Tracing the route to 2.2.2.10
VRF info: (vrf in name/id, vrf out name/id)
  1 198.51.100.1 6 msec 2 msec 1 msec
  2 10.1.2.2 [MPLS: Labels 16004/16006/1006006 Exp 0] 11 msec 4 msec 4 msec
  3 10.2.4.4 [MPLS: Labels 16006/1006006 Exp 0] 5 msec 3 msec 2 msec
  4 10.4.6.6 [MPLS: Label 1006006 Exp 0] 6 msec 4 msec 3 msec
  5 203.0.113.200 4 msec *  12 msec
CE1#
CE1#traceroute 2.2.2.20 source loopback 110
Type escape sequence to abort.
Tracing the route to 2.2.2.20
VRF info: (vrf in name/id, vrf out name/id)
  1 198.51.100.1 3 msec 1 msec 1 msec
  2 10.1.3.3 [MPLS: Labels 16005/16006/1006005 Exp 0] 7 msec 4 msec 4 msec
  3 10.3.5.5 [MPLS: Labels 16006/1006005 Exp 0] 6 msec 3 msec 3 msec
  4 10.5.6.6 [MPLS: Label 1006005 Exp 0] 4 msec 3 msec 3 msec
  5 203.0.113.200 3 msec *  4 msec
CE1#

6. 参考

① Automated Steering www.cisco.com

② Segment Routing Automated Steering
y-network.jp

次回は、Automated steering(Ingress PE)について記事を書きます。
最後までお読みいただきありがとうございました!