STUDY · NETWORK GUIDE

7-6 Day 0 ZTP — DHCP でスクリプトを取り Guest Shell で走らせる

csr1000v 17.03.08a を設定の無い Day 0 で起動し、ZTP で DHCP の option が指す Python のスクリプトを HTTP・TFTP で取らせて Guest Shell で走らせ、資料の見本・404・PnP の発見で送った要求を撮ります。

1. 前節の振り返りと本節の内容

前節 7-5 Embedded Event Manager(EEM) は、csr1000v 17.03.08a で EEM のアプレットと Tcl・Python のポリシーを登録し、syslog・timer・CLI の event と event manager run で動かしました。7-5 の機器は、取得スクリプトが起動時に入れた設定(以下、CML の day0 の設定)を持つ機器でした。

7-5 の末尾(§17)は、次の予告を置いています。本節はこの予告を同じ順で次の場所で受けます。

7-5 §17 の予告本節での受け方場所
本節の EEM は、設定が入った後の機器の上で、syslog の行・timer・CLI のコマンドと event manager run を契機に、登録したポリシーを動かしました。次節 7-6 は、初期設定を自動で入れる Day 0 ZTP を扱います。Zero-Touch Provisioning(ZTP)で、機器が DHCP の option の指す Python のスクリプトを取り、Day 0 の Guest Shell で走らせて設定を入れるまでを撮ります。入った設定は running-config に在り、その後の show startup-config は startup-config is not present でした§5・§7・§8・§9
本節が設定の入った後の機器の上の仕組みだったのに対し、次節は設定が入る前(Day 0)の機器に初期設定を入れる仕組みです。設定が入る前の機器は、CML の configuration を空にして起動した NEW1 です。Day 0 の根拠は、CML の読み返し(configuration と files)と、DHCP・bootfile・スクリプトの実行の行に置きます。コンソールの No startup-config の行・% Failed to initialize nvram の行・%CVAC- の行は根拠にしません§3・§5・§15.3

第 7 章の中では、7-1 §1 が「Plug and Play と初期設定の自動投入は第 7 章の最後の節 7-6(Day 0 ZTP)で扱います」と書き、7-4 §12.1 が Day Zero のプロビジョニングを 7-6 の範囲としていました。本節が扱う Plug and Play(PnP)は機器の側の振る舞い(機器が DHCP で受けた option・送った要求・引いた名前)までで(§12)、6-6 SD-Access (SDA) が引いた Catalyst Center の Provision の文(Plug and Play を含む)は指すだけにします。Catalyst Center の PnP サーバは取得した出典に無く(Catalyst Center の文字列は 12 本に 0 件・数えた)、本ラボでも撮っていません(§14)。7-4 §12.1 が同じ項に挙げた Guest Shell Lite とスタックも撮っていません。

本節は資料に基づく部分と、本ラボの実測に基づく部分を分けて書きます。§2 と §13 は資料だけで、本ラボの値を入れません。§3〜§12 は、各節の中で資料の段落(引用を含む)と本ラボの段落を分けます。§14 は確かめていないこと、§15 は資料と実機が割れた所と罠です。割れた所は両方を並べ、どちらが正しいとも、何が原因とも書きません。

層どこ何を根拠にしているか
出典層§2・§13 と、§3〜§12・§15 の資料の段落と引用Cisco の Programmability Configuration Guide, Cisco IOS XE Amsterdam 17.3.x の 5 章(ZTP・iPXE・Guest Shell・Python API・CLI Python Module)、System Management Configuration Guide, Cisco IOS XE 17.x の 2 章(AutoInstall・設定の基礎の概要)、Cisco Network Plug and Play Agent Configuration Guide, Cisco IOS XE Everest 16.6(§18)
本ラボの run§3〜§12・§15CML 上の csr1000v 17.03.08a 2 台(NEW1・SRV1)の 1 回の run。NEW1 は CML の設定の RAM を 4096 MB に上書きし、configuration を空にして 6 回起動しました。SRV1 は RAM を上書きしていません。7-1〜7-5 と同じ機種と版
ツール側の観測〔ツール側〕を付けた記述と出力CML の API の読み返し・WEB1(ubuntu)の tcpdump と HTTP の受け手の記録・取得スクリプトの判定メモ・WSL の時刻。機器の出力そのものではない
確かめていないこと§14—

以下に貼る実機出力は改変していません。1 つのコードブロックは 1 つの取得の記録から取り、長い出力から一部を抜き出した箇所には …(省略) を置きました。取得の記録の中の、取得スクリプトが書いた〔ツール側〕の行も …(省略) で外しています。プロンプトとコマンドを 1 行にまとめた表記(NEW1# …・SRV1# …・WEB1 の $ …)は本節の組み立てで、取得の記録ではコマンドが見出しの行として別に残っています。設定の投入は、エコーからそのまま載せます。

NEW1 のコンソールの記録は、取得スクリプトが CML の API で 10 秒ごとに読んで溜めたものです。SRV1 のコンソールの記録は、取得スクリプトが CML の API でその時点の記録を読んだもの(1 回の読みで 1 本)です。

コンソールの記録の行頭には CML の前置き |<10 桁>|〔ツール側〕が付いており、本節はこれを外して載せます。前置きの数字の意味は決めず、時刻としても使いません。Day 0 の間、取得スクリプトは NEW1 のコンソールに何も入力していません(読むだけ)。

コードブロックの直前の文には、機器と版と RAM を書きます。NEW1 は csr1000v 17.03.08a・RAM 4096 MB で、RAM の値は CML の設定値(〔ツール側〕CML の API の読み返し)です。機器の側の値は show version の物理メモリの行です(§3.1)。SRV1 は csr1000v 17.03.08a で、RAM は上書きしていません(CML の読み返しは None)。WEB1・CML の API・取得スクリプトの出力には〔ツール側〕と書きます。

時刻は機器の時計(UTC)で、show clock・syslog・show auto install trace の行頭の値をそのまま書きます。機器の時計の日付は Fri Oct 30 2026 です。NEW1・SRV1・WEB1 の時計は別々の記録で、2 つの時計をまたぐ前後と因果は書きません。回数は「この run の <記録の名前>(記録の範囲)に N 行」の形で書きます。本ラボの実測は 1 回の run の観測で、同じ手順を繰り返した時に同じ値になるかは確かめていません(§14)。パスワードは撮影ごとの使い捨てで、本文には載せていません。


2. Day 0 と ZTP の位置づけ(資料が書く用語と仕組み)

2.1 資料と短い名前

資料の 8 章は、以下の短い名前で呼びます。

短い名前資料と章版(資料の表記)
ZTP 章Programmability Configuration Guide, Cisco IOS XE Amsterdam 17.3.x — Zero-Touch Provisioning17.3.x
iPXE 章同 — iPXE17.3.x
Guest Shell 章同 — Guest Shell17.3.x
Python API 章同 — Python API17.3.x
CLI Python Module 章同 — CLI Python Module17.3.x
AutoInstall 章System Management Configuration Guide, Cisco IOS XE 17.x — Using AutoInstall to Remotely Configure Cisco Networking Devices17.x
設定の基礎の概要の章同 — Overview Basic Configuration of a Cisco Networking Device17.x
PnP の本Cisco Network Plug and Play Agent Configuration Guide, Cisco IOS XE Everest 16.616.6

ZTP 章・iPXE 章・Guest Shell 章などの 5 章は、17.3.x の本の章です。17.3.x の本の目次では、ZTP 章と iPXE 章が「Provisioning」の節の 2 章です。ZTP 章が失敗の行き先として名を挙げる Using AutoInstall and Setup のリンクは、Cisco IOS Release 12.2 の本の URL で、取得の時に Cisco の support の IOS & NX-OS のページへ移りました(§18 のリダイレクトの記録)。IOS XE 17 の AutoInstall には、17.x の System Management Configuration Guide の AutoInstall 章を当てています。

PnP の本は、Cisco IOS XE Everest 16.6 の版で、置き場は Cisco 4000 Series Integrated Services Routers の Configuration Guides の下です。16.x の PnP の本の URL は、取得の時に Cisco の support の目次のページへ移りました(§18)。PnP の本の版(16.6)と置き場(4000 Series ISR)は、本ラボの機器(csr1000v 17.03.08a)の版と機種とは別のものです。PnP の本の文は、この版と置き場の資料の文として引きます。

資料の見本(設定・スクリプト・ブートログ)は、見本ごとに機種と版が違います。見本を引く時は、ログの Version の行の機種と版、または見出しの版の範囲を添えます。本の版 17.3.x は、見本の版ではありません。

2.2 ZTP の定義と流れ

ZTP 章は、ZTP を、異なる種類の機器が混在するネットワークで、機器のプロビジョニングを自動にする open bootstrap interfaces としています。

Zero-Touch Provisioning provides open bootstrap interfaces to automate network device provisioning in heterogeneous network environments.

(ZTP 章「Zero-Touch Provisioning Overview」)

同じ章の冒頭は、ZTP を Cisco が示す zero-touch provisioning model と書き、ZTP の機能は自動で有効になり、設定は要らないと書きます。

To address network provisioning challenges, Cisco introduces a zero-touch provisioning model.

The Zero-Touch Provisioning feature is enabled automatically; no configuration is required.

(ZTP 章の冒頭)

ZTP 章の概要は、ZTP に対応する機器が起動して startup configuration を見つけない時に、ZTP のモードに入ると書きます。

When a device that supports Zero-Touch Provisioning boots up, and does not find the startup configuration (during initial installation), the device enters the Zero-Touch Provisioning mode.

(ZTP 章「Zero-Touch Provisioning Overview」)

同じ概要は、流れを次の 3 つの文で書きます。機器は DHCP サーバを探し、IF の IP アドレス・gateway・DNS サーバの IP アドレスで自分を bootstrap して Guest Shell を有効にし、その後 HTTP/TFTP サーバの IP アドレスか URL を得て Python のスクリプトを取ります。Guest Shell はスクリプトの実行環境で、取ったスクリプトを実行して初期設定を入れます。

The device searches for a Dynamic Host Control Protocol (DHCP) server, bootstraps itself with its interface IP address, gateway, and Domain Name System (DNS) server IP address, and enables Guest Shell.

The device then obtains the IP address or URL of an HTTP/TFTP server, and downloads the Python script from an HTTP/TFTP server to configure the device.

Guest Shell provides the environment for the Python script to run. Guest Shell executes the downloaded Python script and applies an initial configuration to the device.

(ZTP 章「Zero-Touch Provisioning Overview」)

上の 1 つ目と 2 つ目の引用の文の順は、Guest Shell の有効化の後にスクリプトの取得を置きます。同じ章の 17.2.x 以降の見出しの節のブートログの見本(C9300-48UXM・Version 17.2.1)は、Attempting bootfile の行の後に、day0guestshell の activated から Guestshell enabled successfully までの行を出します(§5.8 に引きます)。Attempting bootfile の行が取得の始まりか終わりかは、資料からは決まりません。本ラボの並びは §5 に、コンソールの記録の行番号の順と、NEW1 の時計の順を別の欄に置きます。

同じ概要は、初期のプロビジョニングが終わった後も Guest Shell は有効のままと書き、ZTP が失敗した時は機器が AutoInstall に落ちると書きます。

After initial provisioning is complete, Guest Shell remains enabled.

In case Zero-Touch Provisioning fails, the device falls back to AutoInstall to load configuration files. For more information, see Using AutoInstall and Setup.

(ZTP 章「Zero-Touch Provisioning Overview」)

Guest Shell が有効のままという文と、同じ章のブートログの見本の destroyed の行と、本ラボの ZTP の後の表示は §8.6 で並べます。失敗の行き先の文と、同じ章の DHCPv6 Support の小節の文は §11.1 で並べます。

2.3 DHCP の option

ZTP 章の DHCP サーバの節は、新しい機器と同じネットワークで DHCP サーバが動いていることを求め、機器は電源が入ると、スクリプトの在る HTTP か TFTP のサーバの IP アドレスの情報と、スクリプトのフォルダのパスを DHCP サーバから受け取ると書きます。

In ZTP, a DHCP server must be running on the same network as the new device that is being provisioned.

When the new device is switched on, it retrieves the IP address information of the HTTP or TFTP server where the Python script resides, and the folder path of the Python script from the DHCP server.

(ZTP 章「DHCP Server Configuration for Zero-Touch Provisioning」)

同じ節は、DHCP サーバが返す option を 2 つ挙げます。option 150 は省略できる option で、Python のスクリプトを置く HTTP か TFTP のサーバの IP アドレスの一覧を持ち、option 67 は HTTP/TFTP サーバの上のスクリプトのファイルパスを持ちます。

The DHCP server responds to DHCP discovery events with the following options:

Option 150: (Optional) Contains a list of IP addresses that point to the HTTP or TFTP server in the management network that hosts the Python scripts to be run.

Option 67: Contains the Python script file path in the HTTP/TFTP server.

(ZTP 章「DHCP Server Configuration for Zero-Touch Provisioning」)

同じ節は、機器が HTTP か TFTP のサーバへの経路を持たないので、DHCP サーバが渡した既定の経路を使うと書きます。

After receiving these DHCP options, the device connects to the HTTP or TFTP server, and downloads the Python script. At this point, because the device does not have a route to reach the HTTP or TFTP server, it uses the default route provided by the DHCP server.

(ZTP 章「DHCP Server Configuration for Zero-Touch Provisioning」)

option 67 の中身の書き方は、資料の中で割れます。DHCP サーバの節はフォルダのパス・ファイルパスと書き、同じ章の IOS の DHCP サーバの見本(機種と版の記載なし)は、TFTP の見本が option 150 に IP アドレス・option 67 にパスを入れ、HTTP の見本が option 150 を使わずに option 67 に http:// の URL を丸ごと入れます(§4.1 に HTTP の見本を引きます)。概要の節は、機器が HTTP/TFTP サーバの IP アドレスか URL を得ると書き(§2.2)、option 67 の名を出しません(概要の節に option の語は 0 件・数えた)。本ラボの pool の option は §4.2・§9.2 に載せます。

同じ章の DHCP Client Behavior の節は、17.2.1 以降は機器の PID(product identification)・PnP・シリアル番号・MAC アドレスが DHCP の client option に入ると書き、DHCP サーバはこれを変数に使って機器を見分け、option 67 で機器ごとの Python のファイルを送れると書きます。

From Cisco IOS XE Amsterdam 17.2.1 release onwards, the device product identification (PID), Cisco Network Plug and Play (PnP), the serial number, and the MAC address is set in the DHCP client options.

These client options can be used as variables at the DHCP server. The DHCP client options can be used to identify the device and send a unique Python file through option 67 or boot filename.

(ZTP 章「DHCP Client Behavior」)

同じ節の表 1 の行は以下のとおりです。表の toggles の語(DHCPv4 の欄のシリアル番号と MAC アドレスの 61/toggles、DHCPv6 の欄の Product ID とシリアル番号の 16/toggles)は、原典のまま引きます。

Table 1. DHCP Client Options Device Information DHCPv4 DHCPv6 Product ID 124 16/toggles

Serial number 61/toggles 16/toggles

MAC address 61/toggles 1

Cisco Network PnP 60 15

(ZTP 章「Table 1. DHCP Client Options」)

表 1 は、DHCPv4 の欄で、Product ID を 124、シリアル番号と MAC アドレスをどちらも 61/toggles、Cisco Network PnP を 60 としています。toggles の意味は原典に書かれていません(取得した出典の 12 本で、toggles の語は表 1 の 4 つのセルにだけ在りました・数えた)。シリアル番号と MAC アドレスがどちらも 61/toggles の行で、どちらの値が 61 に入るかは表からは決まりません。本ラボの機器が送った 60・61・124 は §6 で撮ります。

2.4 AutoInstall と Setup

AutoInstall 章は、AutoInstall を、ネットワーク機器を遠隔で自動的に設定する仕組みとし、新しい機器を遠隔で立ち上げるのに使うと書きます。

AutoInstall enables remote, automatic configuration of networking devices. AutoInstall is typically used to set up new networking devices remotely.

(AutoInstall 章の冒頭)

設定の基礎の概要の章は、AutoInstall の処理が、Cisco IOS software の機器の電源が入り、NVRAM に有効な設定ファイルが見つからない時に始まると書きます。

The AutoInstall process begins when a Cisco IOS software-based device is turned on and a valid configuration file is not found in NVRAM.

(設定の基礎の概要の章「Cisco IOS AutoInstall」)

AutoInstall 章が対象とする機器の書き方は、章の中で割れます。冒頭は、この章の networking device を Cisco IOS のソフトウェアで動くルータの意味で使うと書き、AutoInstall で設定される機器の節は、AutoInstall を支え、NVRAM に設定ファイルの無い Cisco IOS XE のルータならどれでもよいと書きます。設定の基礎の概要の章は、AutoInstall 章と同じ題の module を、Cisco IOS Release 12.4(1) 以降の機器に向けて書いたとします。

In this module the term networking device means a router that runs Cisco IOS software.

(AutoInstall 章の冒頭)

A device that is being configured with AutoInstall can be any Cisco IOS XE-based router that supports AutoInstall and does not have a configuration file in its NVRAM.

(AutoInstall 章「Device That Is Being Configured with AutoInstall」)

Using AutoInstall to Remotely Configure Cisco Networking Devices module is written specifically for networking devices running Cisco IOS Release 12.4(1) or newer. However most of the information in this document can be used to configure networking devices that support AutoInstall and are not running Cisco IOS release 12.4(1) or newer.

(設定の基礎の概要の章「Prerequisites for Cisco IOS AutoInstall」)

2 つの章の取得したテキストに、CSR の文字列(大小を問わず)・Cloud Services Router・17.3 の文字列は 0 件でした(数えた)。「合わない」とは書かず、資料の対象の書き方として並べます。

AutoInstall の IF の書き方も、資料の中で割れます。AutoInstall 章の Restrictions は管理 IF の Gigabit Ethernet 0 だけを支えると書き、設定の基礎の概要の章は LAN の Ethernet・Token Ring・FDDI の IF などで支えると書きます。ZTP 章は、ZTP を管理ポートでも in-band のポートでも支えると書きます(AutoInstall とは対象の違う文として並べます)。

Only Management interface Gigabit Ethernet 0 is supported.

(AutoInstall 章「Restrictions」)

AutoInstall is supported over Ethernet, Token Ring, and FDDI interfaces for LANs, serial interfaces using High-Level Data Link Control (HDLC) encapsulation, serial interfaces using Frame Relay encapsulation for WANs, and WIC-1-DSU-T1v2 cards (No other T1E1 card supports Autoinstall.).

(設定の基礎の概要の章「Cisco IOS AutoInstall」)

ZTP is supported on both management ports and in-band ports.

(ZTP 章「DHCP Server Configuration for Zero-Touch Provisioning」)

本ラボの NEW1 の IF と、AutoInstall が DHCPv4 を試した IF の行は §5.7 に置きます。

AutoInstall 章は、新しい機器が DHCP の option 150 で TFTP サーバの IP アドレスを知らない時、TFTP の要求を 255.255.255.255 への broadcast で送ると書きます。同じ章は、機器が TFTP サーバから network-confg か cisconet.cfg を読み込んでホスト名を決められると書きます。

If the new device does not learn the IP address of the TFTP server via DHCP option 150, it will transmit the TFTP session initialization requests as network layer broadcasts using the IP destination broadcast address of 255.255.255.255.

(AutoInstall 章「Storage and Transmission of Configuration Files」)

Any networking device that is being configured with AutoInstall can determine its hostname by loading one of the AutoInstall network configuration files (network-confg or cisconet.cfg) from the TFTP server that contain the iphost hostnameip-address commands.

(AutoInstall 章「IP-to-Hostname Mapping」)

上の 2 つ目の引用の iphost hostnameip-address は、語の間の空白が無い形で、取得した本文のまま引いています(§15.8)。本ラボの cycle E・F で WEB1 の tcpdump に残った TFTP の broadcast のファイル名は §12.2 に並べます。

設定の基礎の概要の章は、Setup mode を、Cisco IOS CLI か System Configuration Dialog で初期の設定ファイルを作る仕組みとしています。

Cisco IOS Setup mode enables you to build an initial configuration file using the Cisco IOS CLI or System Configuration Dialog.

(設定の基礎の概要の章「Cisco IOS Setup Mode」)

本ラボの NEW1 のコンソールの記録の System Configuration Dialog と初期設定の問いの行は、§5.2 と §15.5 に置きます。

2.5 PnP agent

PnP の本(16.6・4000 Series ISR の Configuration Guides の下)は、PnP agent を、simplified deployment architecture を支える Cisco のネットワーク機器に組み込まれたソフトウェアの部品とし、PnP server を、配備の情報を管理して配る中央のサーバとしています。

The Cisco Network Plug and Play agent is an embedded software component that is present in all Cisco network devices that support simplified deployment architecture. The PnP agent understands and interacts only with a PnP server. The PnP agent first tries to discover a PnP server, with which it can communicate.

(PnP の本「Cisco Network Plug and Play Agent」)

The Cisco Network Plug and Play server is a central server that encodes the logic of managing and distributing deployment information (images, configurations, files, and licenses) for the devices being deployed.

(PnP の本「Cisco Network Plug and Play Server」)

同じ本は、agent のソフトウェアが今のところ全ての Cisco IOS と IOS XE のプラットフォームで使え、既定で有効と書きます。ページの適用製品の欄は、4000 Series Integrated Services Routers だけを挙げます。

The Cisco Network Plug and Play agent software is currently available on all Cisco IOS and IOS XE platforms, and is enabled by default.

(PnP の本「Cisco NetworkPlug and Play Agent Initialization」)

上の出典の節の名前の NetworkPlug は、語の間の空白が無い形で、取得した本文のまま引いています(§15.8)。

This Document Applies to These Products 4000 Series Integrated Services Routers

(PnP の本のページの適用製品の欄)

同じ本は、機器が初めて電源を入れられた時、startup config と機器のコンソールでの user input が無いと PnP agent のプロセスが起き、PnP サーバのアドレスを探すと書きます。

When a device is powered on for the first time, the PnP agent process wakes up in the absence of the startup config, user input on the device’s console, and attempts to discover the address of the PnP server.

(PnP の本「Cisco Network Plug and Play Deployment Solution」)

発見の仕組みの書き方は、同じ本の中に 2 つの形があります。Discovery Process の節は、agent は DHCP サーバ・DHCP snooping・DNS lookup・layer 2 と layer 3 の機器の PnP proxy・PnP deployment application のどれか 1 つを通ると書きます。DNS Lookup の節は DHCP の発見で PnP サーバのアドレスが得られないと DNS lookup に落ちると書き、Cloud Redirection の節は DHCP と DNS の発見が失敗すると devicehelper.cisco.com の Cisco Cloud server に繋ごうとすると書きます。

When the device boots up, the absence of any startup config on the NVRAM triggers the PnP discovery agent to acquire the IP address of the PnP server. In order to acquire the IP address of the PnP server, the PnP agent goes through one of the following discovery mechanisms: PnP discovery through DHCP server PnP discovery through DHCP snooping PnP discovery through DNS lookup PnP proxy for layer 2 and layer 3 devices PnP deployment application

(PnP の本「Cisco Network Plug and Play Agent Discovery Process」)

When the DHCP discovery fails to get the IP address of the Cisco Network Plug and Play server, the agent falls back on Domain Name System (DNS) lookup method.

(PnP の本「Cisco Network Plug and Play Discovery through DNS Lookup」)

When the device boots up without any start-up configuration or authentication certificates, and if the DHCP and DNS discovery fails, the device tries to contact the Cisco Cloud server at devicehelper.cisco.com.

(PnP の本「Cisco Cloud Redirection over an IPv4 and IPv6 Network」)

どれか 1 つを通る形(Discovery Process の節)と、順に次へ落ちる形(DNS Lookup の節・Cloud Redirection の節)は、文面のまま並べます。Discovery Process の節の一覧に Cisco のクラウドはありません。本ラボの WEB1 の記録の時刻の並びは §12.6 に、資料の文と対応づけずに置きます。

option 60 の文字列の書き方も、同じ本の中で割れます。Discovery through DHCP Server の節は、DHCP サーバが機器から文字列 ‘cisco pnp’(空白あり)の option 60 を受けた時に option 43 で PnP サーバのアドレスを渡せると書き、DHCP Option based Discovery over an IPv4 Network の節は、機器の PnP agent は大文字小文字を区別する “ciscopnp”(空白なし)を option 60 の文字列として送ると書きます。

The DHCP server can be configured to insert additional information using vendor specific option 43 upon receiving option 60 from the device with the string ‘cisco pnp’, to pass on the IPv4 address or hostname of the PnP server to the requesting device.

(PnP の本「Cisco Network Plug and Play Discovery through DHCP Server」)

To support multiple vendors, the PnP agent in Cisco device sends out a case-sensitive “ciscopnp” as the option 60 string during the DHCP discovery.

(PnP の本「DHCP Option based Discovery over an IPv4 Network」)

本ラボの機器が送った option 60 は §6 で撮ります。

2.6 機能情報の表と版

ZTP 章の機能情報の表は、各 release train で機能が入った最初の版だけを載せ、断りが無ければ同じ train の後の版も対応すると書きます。

The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train.

Unless noted otherwise, subsequent releases of that software release train also support that feature.

(ZTP 章「Feature Information for Zero-Touch Provisioning」)

同じ表の Zero-Touch Provisioning の行は、17.2.1 の欄に Cisco Cloud Services Router 1000V Series を挙げます。

In Cisco IOS XE Amsterdam 17.2.1, this feature was implemented on the following platform: Cisco Cloud Services Router 1000V Series Cisco C1100 Terminal Services Gateway (Supported only on C1100TGX-1N24P32A)

(ZTP 章「Table 2. Feature Information for Zero-Touch Provisioning」)

同じ表の Zero-Touch Provisioning: HTTP Download の行は、ZTP が HTTP と TFTP のファイルのダウンロードを支えると書きます。この行の機種の文は、ISR 4000 と Catalyst 3650 / 3850 / 9300 / 9500 と Catalyst 9500-High Performance を挙げ、CSR1000V の名はありません。

Zero-Touch Provisioning supports HTTP and TFTP file download.

(ZTP 章「Zero-Touch Provisioning: HTTP Download」)

機能情報の表の行は、本ラボの機器が ZTP を使えるかの根拠にしません。本ラボの csr1000v 17.03.08a で HTTP と TFTP の取得の後に何が表示されたかは、§5〜§9 の実測で書きます。

iPXE 章は、iPXE を、ネットワークから起動する open standard の Pre-boot eXecution Environment(PXE)を拡張したものとしています。iPXE 章の機能情報の表が挙げる機種は Catalyst 3650 / 3850 / 9000 系のスイッチで、csr1000v はありません(§13.2)。

iPXE is an enhanced version of the Pre-boot eXecution Environment (PXE), which is an open standard for network booting.

(iPXE 章の冒頭)

2.7 用語のまとめ

用語は以下のとおりです。

用語意味記述のある節
Day 0 の機器設定が入る前の機器。本ラボの NEW1§3・§5
CML の day0 の設定CML が起動時に入れる設定(node の configuration)。本ラボの SRV1 は CML の day0 の設定が入った機器§3
ZTP起動時に startup configuration の無い機器が、DHCP で受けた option の指す Python のスクリプトを取り、Guest Shell で実行して初期設定を入れる仕組み(ZTP 章)§2.2・§5〜§11
AutoInstall遠隔からネットワーク機器を自動で設定する仕組み(AutoInstall 章)。ZTP 章は ZTP が失敗した時の行き先と書く§2.4・§11・§12
PnP agent / PnP サーバ機器に組み込まれた配備のソフトウェアの部品と、配備の情報を配る中央のサーバ(PnP の本)§2.5・§12・§13
option 67 / 150スクリプトのファイルパス(または URL)と、HTTP / TFTP サーバのアドレスの一覧(ZTP 章)§2.3・§4・§9
option 60 / 61 / 124機器が DHCP の要求に入れる option。ZTP 章の表 1 は PnP・シリアル番号と MAC アドレス・Product ID§2.3・§6
option 43PnP の本の、PnP サーバのアドレスと transport などを並べる文字列の option§12.1
day0guestshell機器の表示の語(逐語のまま)§5・§7

機器の表示に出る day0 の語(day0guestshell・Device in day0 workflow など)は、逐語のまま書きます。図の id の day0-sequence は Day 0 の意味で、図の題では「Day 0 の起動」と書いています。


3. 本ラボの構成

この図を大きく開く ↗

本ラボの構成です。Day 0 の機器 NEW1 は外へ出ない ZTP 区間(ztp-sw)にだけ繋がり、SRV1 と WEB1 は管理の LAN と ZTP 区間の両方に繋がります。

本ラボは CML 上の 6 ノード(NEW1・SRV1・WEB1・ztp-sw・mgmt-sw・ext)とリンク 6 本で組みました。ノードとリンクの形は取得スクリプトの設計で、show の出力には出ません(〔ツール側〕取得スクリプトは各 cycle の NEW1 の start の前にリンクの相手を CML の API で読み返しています)。WSL の取得スクリプトは、CML の API でラボを作り、SSH で SRV1 と WEB1 に入り、WEB1 を踏み台にして NEW1 に入りました。

ZTP 区間は、NEW1 の Gi1・SRV1 の Gi2・WEB1 の ens3 が繋がる ztp-sw の L2 の区間で、本ラボの外へ出ない区間です(〔ツール側〕CML のリンクの表では、ztp-sw は ext と mgmt-sw に繋がらない)。

ノード機種・版IFアドレス役割
NEW1csr1000v 17.03.08aGi1DHCP(pool ZTP76)Day 0 の機器。CML の RAM 4096 MB・configuration は空〔ツール側〕。IF は Gi1 の 1 本だけ
SRV1csr1000v 17.03.08aGi1(vrf Mgmt-vrf)172.16.1.241/24管理の LAN の入口(WSL からの SSH)
SRV1〃Gi2(global)10.76.0.1/24DHCP サーバ(pool ZTP76)・ZTP 区間の既定の router・TFTP サーバ(cycle C の間だけ)
SRV1〃Loopback010.7.6.1/32CML の day0 の設定〔ツール側〕
WEB1ubuntu(CML の node definition の名前)ens2172.16.1.242/24管理の LAN(WSL からの SSH・NEW1 と SRV1 への SSH の踏み台)〔ツール側〕
WEB1〃ens310.76.0.10/24HTTP の受け手(:8000 = スクリプト・:8080 = PnP サーバではない受け手)・tcpdump〔ツール側〕
ztp-sw / mgmt-sw / extunmanaged_switch / external_connector(System Bridge)——ZTP 区間・管理の LAN・ラボの外への出口〔ツール側〕。ztp-sw は ext と mgmt-sw に繋がない

SRV1 のアドレスは show ip interface brief の表示で、SRV1 の /24 と vrf の別は show ip route の表から読みました。SRV1 の Gi1・Loopback0 のアドレスと pool の中身は、取得スクリプトが CML の day0 の設定に書いた値です(〔ツール側〕)。図の中の灰色の破線の箱は CML の設定・取得スクリプト・WEB1 の側の記述と表示(〔ツール側〕)で、緑の実線の箱は NEW1・SRV1 が出した表示の値です。

3.1 版と RAM

Guest Shell 章の Hardware Requirements for the Guest Shell の節は、Table 2(Guest Shell Resource Requirements)で、CSR1000v(Cisco Cloud Services Router 1000V Series)の最低メモリを 4 GB としています。

This section provides information about the hardware requirements for supported platforms which have variable memory configurations. Table 2. Guest Shell Resource Requirements Platforms Minimum Memory Cisco 1000 Series Integrated Services Routers 4 GB Cisco Cloud Services Router 1000V Series 4 GB

(Guest Shell 章「Hardware Requirements for the Guest Shell」)

NEW1 の RAM は、CML の csr1000v の node definition の値(〔ツール側〕取得スクリプトの判定メモでは 3072 MB)を、起動の前に 4096 MB に上書きしました。上の Table 2 が CSR1000v の最低メモリとして書く 4 GB に合わせた CML の設定値で、7-4 §3.1 の CSR1 と同じ値です。SRV1 と WEB1 の RAM は上書きしていません。〔ツール側〕CML の API で読み返したノード表は以下のとおりです(configuration の中身は出していません)。

snippet
NEW1     csr1000v             RAM   4096  configuration の長さ = 0  files = [('iosxe_config.txt', 0)]
SRV1     csr1000v             RAM   None  configuration の長さ = 1252  files = [('iosxe_config.txt', 1252)]
WEB1     ubuntu               RAM   None  configuration の長さ = 410  files = [('user-data', 410), ('network-config', 185)]
ztp-sw   unmanaged_switch     RAM   None  configuration の長さ = 12  files = [('default', 12)]
mgmt-sw  unmanaged_switch     RAM   None  configuration の長さ = 12  files = [('default', 12)]
ext      external_connector   RAM   None  configuration の長さ = 13  files = [('default', 13)]

NEW1 の行は、RAM が 4096、configuration の長さが 0、files が iosxe_config.txt の大きさ 0 の 1 本です。SRV1 の行の RAM は None で、configuration の長さは 1252 です。

機器の側では、NEW1 の show version の物理メモリの行が 3978424K でした。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の show version の抜粋は以下のとおりです。

snippet
NEW1# show version
Cisco IOS XE Software, Version 17.03.08a
Cisco IOS Software [Amsterdam], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.3.8a, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2023 by Cisco Systems, Inc.
Compiled Fri 20-Oct-23 15:48 by mcpre
…(省略)
NEW1 uptime is 6 minutes
Uptime for this control processor is 8 minutes
System returned to ROM by reload
System image file is "bootflash:packages.conf"
Last reload reason: factory-reset
…(省略)
cisco CSR1000V (VXE) processor (revision VXE) with 2071576K/3075K bytes of memory.
Processor board ID 939JLUI2PQA
Router operating mode: Autonomous
1 Gigabit Ethernet interface
32768K bytes of non-volatile configuration memory.
3978424K bytes of physical memory.
6188032K bytes of virtual hard disk at bootflash:.

Configuration register is 0x2102

NEW1 の物理メモリの行の値は cycle ごとに違い、cycle B のコンソールの記録は 3978468K、cycle C の show version と cycle D・E・F のコンソールの記録は 3978408K でした。CML の設定値 4096 や Table 2 の 4 GB と、物理メモリの行の値との対応(差の内訳)は確かめていません。IF の数の行は 1 Gigabit Ethernet interface です。

SRV1 の show version の物理メモリの行は 3012036K でした。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の show version の抜粋は以下のとおりです。

snippet
SRV1# show version
Cisco IOS XE Software, Version 17.03.08a
Cisco IOS Software [Amsterdam], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.3.8a, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2023 by Cisco Systems, Inc.
Compiled Fri 20-Oct-23 15:48 by mcpre
…(省略)
SRV1 uptime is 1 minute
Uptime for this control processor is 3 minutes
System returned to ROM by reload
System image file is "bootflash:packages.conf"
Last reload reason: factory-reset
…(省略)
cisco CSR1000V (VXE) processor (revision VXE) with 1104920K/3075K bytes of memory.
Processor board ID 9TLZEQG0KX4
Router operating mode: Autonomous
2 Gigabit Ethernet interfaces
32768K bytes of non-volatile configuration memory.
3012036K bytes of physical memory.
6188032K bytes of virtual hard disk at bootflash:.

Configuration register is 0x2102

NEW1 と SRV1 の show version の Last reload reason はどちらも factory-reset でした。この行の理由は撮っていません。

3.2 CML の空の設定

NEW1 の configuration は、各 cycle の start の前に CML の API で空文字であることを読み返しました。〔ツール側〕cycle A の start の前の読み返しは以下のとおりです。

snippet
前段 = ['1 回目は start だけ']
configuration = ''
ram = 4096
configuration_files = [('iosxe_config.txt', 0)]

6 回の cycle の読み返しは、どれも configuration = ''・ram = 4096・configuration_files = [('iosxe_config.txt', 0)] でした。cycle B〜F の読み返しの前段は、前の cycle の NEW1 の stop と wipe です(〔ツール側〕)。CML は configuration を空にしても、長さ 0 の iosxe_config.txt の項目を files に残しました。

Day 0 の根拠の 1 つは、この読み返しです。もう 1 つの根拠は、NEW1 のコンソールの記録の DHCP・bootfile・スクリプトの実行の行です(§5)。

3.3 外へ出ない区間

ZTP 区間の DHCP サーバと既定の router は SRV1 の Gi2 です。SRV1 の P0 の show ip route(global の表)は Gateway of last resort is not set の行を持ち、S* の行と 0.0.0.0/0 の行は 0 行でした(数えた)。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の P0 の show ip route の抜粋は以下のとおりです。

snippet
SRV1# show ip route
…(省略)
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C        10.7.6.1/32 is directly connected, Loopback0
C        10.76.0.0/24 is directly connected, GigabitEthernet2
L        10.76.0.1/32 is directly connected, GigabitEthernet2

SRV1 の管理の側(vrf Mgmt-vrf)の経路表には 172.16.1.1 への既定経路が 1 本在り(show ip route vrf Mgmt-vrf)、ZTP 区間の Gi2 の global の経路表とは別の表です。SRV1 の Gi1 の入りには、DHCP と TFTP を落とす ACL を置きました。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の Gi1 の access list の表示は以下のとおりです。

snippet
SRV1# show ip interface GigabitEthernet1 | include access list
  Outgoing Common access list is not set
  Outgoing access list is not set
  Inbound Common access list is not set
  Inbound  access list is ACL-MGMT-IN

SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の ACL の中身は以下のとおりです。

snippet
SRV1# show ip access-lists ACL-MGMT-IN
Extended IP access list ACL-MGMT-IN
    10 deny udp any any eq bootps
    20 deny udp any any eq bootpc
    30 deny udp any any eq tftp
    40 permit ip any any (204 matches)

deny の 3 行に一致数の表示は無く、表示があるのは permit の 1 行だけでした。PZ(6 回の cycle の後)の同じ表示も deny の 3 行に一致数が無く、permit の一致数は 4743 でした(§3.6)。

WEB1 は ZTP 区間と管理の LAN の両方に繋がるので、取得スクリプトは WEB1 の転送の設定を読みました。〔ツール側〕WEB1 の ip_forward は以下のとおりです。

snippet
$ sysctl -n net.ipv4.ip_forward
0

〔ツール側〕WEB1 の経路表は以下のとおりです。

snippet
$ ip route
default via 172.16.1.1 dev ens2 proto static
10.76.0.0/24 dev ens3 proto kernel scope link src 10.76.0.10
172.16.1.0/24 dev ens2 proto kernel scope link src 172.16.1.242

WEB1 の既定経路は ens2(管理の LAN)の 1 本で、ens3 の行は 10.76.0.0/24 だけです。

取得スクリプトは各 cycle の NEW1 の start の前に、隔離の関門として (a) SRV1 の global に既定経路が無い (b) Mgmt-vrf の既定経路は管理の側 (c) pool が 1 つで中身が cycle の値 (d) SRV1 の Gi1 の入りの ACL の行と中身 (e) WEB1 の ip_forward が 0 (f) NEW1 のリンクの相手が ztp-sw だけ、を読み返しました。6 回とも関門は全部通っています(〔ツール側〕取得スクリプトの判定メモ)。関門は start の前の撮影で、NEW1 が動いている間の経路と転送は撮っていません。NEW1 が区間の外の宛先へ送ろうとした unicast は、どの記録の視野にも入っていません(§14)。

3.4 SRV1 の CML の day0 の設定と管理のリンク

SRV1 は CML の day0 の設定が入った機器です。取得スクリプトの設計では、SRV1 の管理のリンク(SRV1 の Gi1 と mgmt-sw の間)を SRV1 の start の後に止め、CML の day0 の設定が入ったことを WEB1 経由の SSH で確かめてから start しました(〔ツール側〕)。〔ツール側〕リンクを止めて読み返した時の CML のリンクの状態は以下のとおりです。

snippet
== 読んだ時
1. ext port <-> mgmt-sw port0  state=STARTED  id=1234f38a-6a05-4db7-aa32-74cac247ed66
2. SRV1 GigabitEthernet1 <-> mgmt-sw port1  state=STOPPED  id=a24904c8-a705-480e-b60b-af583a84855d
3. WEB1 ens2 <-> mgmt-sw port2  state=STARTED  id=92aae855-e373-48eb-a633-b3d2c1c61208
4. SRV1 GigabitEthernet2 <-> ztp-sw port0  state=STARTED  id=102f969e-3114-4460-90f5-df9967654592
5. WEB1 ens3 <-> ztp-sw port1  state=STARTED  id=5d8a3430-fc58-428b-97f0-ab790bd457db
6. NEW1 GigabitEthernet1 <-> ztp-sw port2  state=DEFINED_ON_CORE  id=d788518c-3b1a-4383-89ff-ccc15da12d3f
…(省略)

SRV1 の Gi1 と mgmt-sw の間のリンクが state=STOPPED、NEW1 のリンクが state=DEFINED_ON_CORE(NEW1 は P0 の間は起動していない)です。WEB1 経由の SSH で確かめた 3 点の 1 つは、SRV1 の show logging の CVAC の行です。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の表示は以下のとおりです。

snippet
SRV1# show logging | include CVAC-4-CONFIG_DONE
*Oct 30 22:09:53.529: %CVAC-4-CONFIG_DONE: Configuration generated from file cdrom0:/iosxe_config.txt was applied and saved to NVRAM. See bootflash:/cvac.log for more details.

SRV1 の show logging では、CVAC の CONFIG_P の行・CONFIG_DONE の行・PnP の発見が止まった行が、この順の時刻で並びました。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の P0 の show logging の抜粋は以下のとおりです。

snippet
SRV1# show logging
…(省略)
*Oct 30 22:09:43.398: %PNP-6-PNP_BEST_UDI_UPDATE: Best UDI [PID:CSR1000V,VID:V00,SN:9TLZEQG0KX4] identified via (entity-mibs)
*Oct 30 22:09:43.451: %IOXN_APP-6-PRE_INIT_DAY0_GS_INFO: Day0 Guestshell pre-initilization API is being invoked

*Oct 30 22:09:44.112: %UICFGEXP-6-SERVER_NOTIFIED_START: R0/0: psd: Server iox has been notified to start
*Oct 30 22:09:45.986: %CRYPTO_ENGINE-5-KEY_ADDITION: A key named SRV1.lab.local has been generated or imported by crypto-engine
*Oct 30 22:09:46.076: %SSH-5-ENABLED: SSH 2.0 has been enabled
*Oct 30 22:09:46.340: %SYS-5-CONFIG_P: Configured programmatically by process CVAC Process from console as vty1
*Oct 30 22:09:49.008: %LINK-3-UPDOWN: Interface GigabitEthernet1, changed state to up
*Oct 30 22:09:49.252: %LINK-3-UPDOWN: Interface GigabitEthernet2, changed state to up
*Oct 30 22:09:49.576: %PKI-2-NON_AUTHORITATIVE_CLOCK: PKI functions can not be initialized until an authoritative time source, like NTP, can be obtained.
*Oct 30 22:09:50.010: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1, changed state to up
*Oct 30 22:09:50.301: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet2, changed state to up
*Oct 30 22:09:53.529: %CVAC-4-CONFIG_DONE: Configuration generated from file cdrom0:/iosxe_config.txt was applied and saved to NVRAM. See bootflash:/cvac.log for more details.
*Oct 30 22:09:58.074: %SEC_LOGIN-5-LOGIN_SUCCESS: Login Success [user: netops] [Source: 10.76.0.10] [localport: 22] at 22:09:58 UTC Fri Oct 30 2026
*Oct 30 22:09:58.520: %IOXN_APP-6-PRE_INIT_DAY0_GS_INFO: Day0 Guestshell de-initilization API is being invoked

*Oct 30 22:10:00.234: %CRYPTO_ENGINE-5-KEY_ADDITION: A key named SRV1.lab.local.server has been generated or imported by crypto-engine
*Oct 30 22:10:04.157: %PNP-6-PNP_DISCOVERY_STOPPED: PnP Discovery stopped (Startup Config Present)
…(省略)

SRV1 の %PNP-6-PNP_DISCOVERY_STOPPED の括弧の中は Startup Config Present です。同じ show logging には %IOXN_APP-6-PRE_INIT_DAY0_GS_INFO の行が 3 行(pre-initilization・de-initilization・destroyed)在り、CML の day0 の設定が入った SRV1 にも出る行です。この行は Day 0 の証拠にしません(§15.3)。

SRV1 の vty には、取得スクリプトの都合で無操作の切断までの時間を延ばす行を入れました(〔ツール側〕長い待ちの間に SSH のセッションを保つための設計)。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の line vty の設定は以下のとおりです。

snippet
SRV1# show running-config | section line vty
line vty 0 4
 exec-timeout 60 0
 login local
 transport input ssh

3.5 SRV1 のコンソールの No startup-config

取得スクリプトは、NEW1 の最初の start の直前と撤去の前の 2 回、SRV1 のコンソールの記録を読みました。ほかに、§3.4 の管理のリンクの確かめの間に読んだ 29 行の記録が在ります(起動の途中の Calculating SHA-1 hash... の行で終わる)。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の、NEW1 の最初の start の直前に読んだ記録の抜粋は以下のとおりです。

snippet
…(省略)
% Failed to initialize nvram

All TCP AO KDF Tests Pass
cisco CSR1000V (VXE) processor (revision VXE) with 1104920K/3075K bytes of memory.
Processor board ID 9TLZEQG0KX4
Router operating mode: Autonomous
2 Gigabit Ethernet interfaces
32768K bytes of non-volatile configuration memory.
3012036K bytes of physical memory.
6188032K bytes of virtual hard disk at bootflash:.
.Done!

SETUP: new interface GigabitEthernet1 placed in "shutdown" state
SETUP: new interface GigabitEthernet2 placed in "shutdown" state
No startup-config, starting autoinstall/pnp/ztp...

Autoinstall will terminate if any input is detected on console



Press RETURN to get started!


Building configuration...
[OK][OK]% Error: The application: day0guestshell, does not exist

この run の SRV1 のコンソールの記録のうち、NEW1 の最初の start の直前と撤去の前の 2 回の読み(どちらも 148 行で、1 行目の見出しのほかは同じ内容)には、どちらにも % Failed to initialize nvram が 1 行、No startup-config, starting autoinstall/pnp/ztp... が 1 行在りました。SRV1 は CML の day0 の設定が入り、show logging に %CVAC-4-CONFIG_DONE と Startup Config Present の行がある機器です(§3.4)。コンソールの No startup-config の行は、Day 0 の証拠にしません。NEW1 の Day 0 の根拠は、§3.2 の CML の読み返しと、§5 の DHCP・bootfile・スクリプトの実行の行に置きます。

SRV1 のコンソールの 148 行の 2 回の読みの最後の行は、どちらも [OK][OK]% Error: The application: day0guestshell, does not exist でした。この行の意味は撮っていません。

3.6 WEB1 の受け手と tcpdump

WEB1 の HTTP の受け手は python3 -m http.server で、:8000 はスクリプトを置く受け手(P0 に起こした)、:8080 は cycle E に起こした PnP サーバではない受け手です。〔ツール側〕:8000 の受け手の起動の直後の ps は以下のとおりです。

snippet
$ sleep 1; ps -o pid=,ppid=,user=,args= -p 1294 --ppid 1294
   1294       1 labuser  python3 -m http.server 8000 --bind 10.76.0.10 --directory /home/labuser/ztp

〔ツール側〕WEB1 自身から :8000 の受け手へ打った確かめは以下のとおりです。

snippet
$ curl -s -o /dev/null -w '%{http_code}' http://10.76.0.10:8000/ztp76a.py
200

WEB1 の tcpdump は ens3 で取り、filter は udp 53 / 67 / 68 / 69 と tcp 80 / 443 / 8000 / 8080 です。〔ツール側〕cycle A の tcpdump の起動は以下のとおりです(出力の 1302 は echo $! が返した PID)。

snippet
$ nohup sudo tcpdump -i ens3 -n -e -vvv -l 'udp port 67 or udp port 68 or udp port 69 or udp port 53 or tcp port 80 or tcp port 443 or tcp port 8000 or tcp port 8080' > ~/tcpdump-A.txt 2>&1 < /dev/null & echo $!
1302

〔ツール側〕起動の直後の ps(sleep 1 の後)では、1302 は root の sudo tcpdump の行で、tcpdump の本体はその子の 1303(user は tcpdump)でした。

WEB1 の tcpdump の視野は、filter に当たるフレームのうち、WEB1 に届く broadcast と、WEB1 が送る・受けるフレームだけです。NEW1 から SRV1 への unicast(cycle C の TFTP の要求を含む)と ARP は、この視野に入りません。WEB1 の tcpdump の 0 行は、どれもこの視野での 0 行です。

SRV1 の ACL の permit の一致数は、P0(§3.3)・各 cycle の NEW1 の start の前・PZ の 8 回読みました。〔ツール側〕判定メモは deny の 3 行を「外の LAN から落とした数」と置きましたが、8 回の読みのどれにも deny の行の一致数の表示はありませんでした。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の PZ の表示は以下のとおりです。

snippet
SRV1# show ip access-lists ACL-MGMT-IN
Extended IP access list ACL-MGMT-IN
    10 deny udp any any eq bootps
    20 deny udp any any eq bootpc
    30 deny udp any any eq tftp
    40 permit ip any any (4743 matches)

permit の一致数は P0 の 204 から PZ の 4743 まで増えました。何のパケットの数かは撮っていません。

3.7 撮影の段階

撮影は段階に分け、1 本の取得スクリプトで続けて撮りました。NEW1 を起動して撮った 6 回を cycle A〜F と呼びます(図の凡例の Phase A〜F)。各 cycle の頭で前の cycle の NEW1 を stop・wipe し、SRV1 の pool を cycle の値に替えてから、configuration を空のまま start しました(〔ツール側〕)。

段SRV1 の pool の差分待ちの終わり(〔ツール側〕)本文
P0option 67 ascii http://10.76.0.10:8000/ztp76a.py—§3・§4
cycle A(PA)(P0 のまま)ZTP76 END A の後 180 秒(start から 508 秒)§5〜§8
cycle B(PB)option 67 を doc_sample.py の URL に固定 1200 秒(start から 1210 秒)§10
cycle C(PC)option 150 ip 10.76.0.1 と option 67 ascii ztp76c.pyZTP76 END C の後 180 秒(start から 467 秒)§9
cycle D(PD)option 150 を外し、option 67 を missing76.py の URL に固定 1200 秒(start から 1210 秒)§11
cycle E(PE)option 67 を外し、option 43 ascii “5A1D;K4;B2;I10.76.0.10;J8080”固定 1200 秒(start から 1210 秒)§12.1・§12.2
cycle F(PF)option 43 を外し、domain-name lab76.local と dns-server 10.76.0.10固定 1200 秒(start から 1209 秒)§12.3
PZ——受け手を止める・undebug all・撤去の前の SRV1 のコンソールの読み・撤去

NEW1 への SSH で show を撮ったのは cycle A と cycle C の 2 回(18 本ずつ)で、cycle B・D・E・F の NEW1 の記録はコンソールの記録だけです。待ちの「start から N 秒」は WSL の時計の値で、NEW1 の時計の値ではありません。撤去は stop → wipe → delete の順で行い、撤去の後の CML のラボ一覧は空でした(〔ツール側〕)。

3.8 資格情報

SRV1 の username の値は、取得スクリプトが WSL で作った type 9 の値で、配ったスクリプトの中の同じ行も同じ値です。保存した出力では、取得スクリプトがこの値を固定の伏せ字([build が伏せた資格情報])に置き換えています。伏せ字のまま引き、値は載せていません。


4. DHCP サーバの設定

4.1 資料の DHCP サーバの見本

ZTP 章は、IOS の DHCP サーバの見本を、管理ポートと in-band のポート・TFTP と HTTP の組み合わせで 4 つ載せています(機種と版の記載なし)。管理ポートで HTTP を使う見本は以下のとおりで、pool を vrf Mgmt-vrf に置き、option 67 に http:// の URL を丸ごと入れます。

The following is a sample DHCP server configuration using HTTP copy, when connected via the management port on a device: Device> enable Device# configure terminal Device(config)# ip dhcp pool pnp_device_pool Device(config-dhcp)# vrf Mgmt-vrf Device(config-dhcp)# network 10.1.1.0 255.255.255.0 Device(config-dhcp)# default-router 10.1.1.1 Device(config-dhcp)# option 67 ascii http://198.51.100.1:8000/sample_python_2.py Device(config-dhcp)# end

(ZTP 章「Sample DHCP Server Configuration on a Management Port Using HTTP Copy」)

本ラボの NEW1 の IF は Gi1 の 1 本で、SRV1 の pool は vrf を付けない global の Gi2 の側に置きました。

4.2 本ラボの pool

SRV1 の pool ZTP76 は、P0 の時点で option 67 に cycle A のスクリプトの URL を持ちました。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の P0 の DHCP の設定は以下のとおりです。

snippet
SRV1# show running-config | section ip dhcp
ip dhcp excluded-address 10.76.0.1 10.76.0.99
ip dhcp pool ZTP76
 network 10.76.0.0 255.255.255.0
 default-router 10.76.0.1
 option 67 ascii http://10.76.0.10:8000/ztp76a.py

SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の P0 の show ip dhcp pool は以下のとおりです。

snippet
SRV1# show ip dhcp pool

Pool ZTP76 :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0
 Total addresses                : 254
 Leased addresses               : 0
 Excluded addresses             : 99
 Pending event                  : none
 1 subnet is currently in the pool :
 Current index        IP address range                    Leased/Excluded/Total
 10.76.0.1            10.76.0.1        - 10.76.0.254       0     / 99    / 254

pool の 254 個のアドレスのうち 99 個(10.76.0.1〜10.76.0.99)が除外で、除外の範囲の次のアドレスは 10.76.0.100 です。この run の NEW1 が DHCP で受けたアドレスは、cycle A の 10.76.0.100 から cycle F の 10.76.0.105 まで、cycle ごとに 1 ずつ増えました(各 cycle のコンソールの Acquired IPv4 address の行と SRV1 の show ip dhcp binding)。

SRV1 では、DHCP サーバの debug を P0 で入れました。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の投入の応答は以下のとおりです。

snippet
SRV1# debug ip dhcp server packet
DHCP server packet debugging is on.

SRV1(csr1000v 17.03.08a・RAM は上書きしていない)のもう 1 本の debug の投入の応答は以下のとおりです。

snippet
SRV1# debug ip dhcp server events
DHCP server event debugging is on.

SRV1 の debug の行は SRV1 の show logging に残ります。行には、SRV1 が受けた要求の行(DHCPDISCOVER received・DHCPREQUEST received)のほかに、SRV1 が送った Offer と ACK の行(Sending DHCPOFFER・Sending DHCPACK)、Using hostname の行、checking for expired leases の行も在ります。SRV1 に届かなかった要求は、この記録の視野の外です。cycle ごとの pool の替え方は、各節の投入のエコーで示します(cycle B = §10.2・cycle C = §9.2・cycle D = §11.2・cycle E = §12.1・cycle F = §12.3)。


5. Day 0 の起動の流れ(cycle A・HTTP)

この図を大きく開く ↗

cycle A の Day 0 の起動を、NEW1 の時計の順の表と WEB1 の tcpdump・受け手の記録〔ツール側〕で並べた図です。2 つの時計をまたぐ前後は描いていません。

cycle A は、SRV1 の pool の option 67 が http://10.76.0.10:8000/ztp76a.py の回です。NEW1 のコンソールの記録(390 行)は §5.1〜§5.6 で行番号の順に区切って載せ、§5.7 で show auto install trace と show logging の行を NEW1 の時計の行頭の時刻で並べ直します。コンソールの記録の行番号の順は「見え方の順」で、出来事の順は §5.7 の NEW1 の時計の表で書きます。図のパネルも NEW1 の時計の表で、コンソールの見え方の順は図の中の注記に置いています。

5.1 起動の行

NEW1 のコンソールの記録は、GRUB と IOS XE の起動の行の後に、% Failed to initialize nvram・No startup-config, starting autoinstall/pnp/ztp...・Autoinstall trying DHCPv4 on GigabitEthernet1 の行を並べました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A のコンソールの記録の 124〜140 行目は以下のとおりです。

snippet
…(省略)
% Failed to initialize nvram

All TCP AO KDF Tests Pass
cisco CSR1000V (VXE) processor (revision VXE) with 2071576K/3075K bytes of memory.
Processor board ID 939JLUI2PQA
Router operating mode: Autonomous
1 Gigabit Ethernet interface
32768K bytes of non-volatile configuration memory.
3978424K bytes of physical memory.
6188032K bytes of virtual hard disk at bootflash:.
Done!

No startup-config, starting autoinstall/pnp/ztp...

Autoinstall will terminate if any input is detected on console

Autoinstall trying DHCPv4 on GigabitEthernet1
…(省略)

% Failed to initialize nvram と No startup-config, starting autoinstall/pnp/ztp... は、CML の day0 の設定が入った SRV1 のコンソールの記録にも在りました(§3.5)。この 2 行は Day 0 の証拠にせず、起動の行として並べます。

Autoinstall will terminate if any input is detected on console は、コンソールに入力があると AutoInstall が終わるという案内の行です。取得スクリプトは、Day 0 の間に NEW1 のコンソールに何も入力していません(〔ツール側〕CML の API でコンソールの記録を読むだけ)。

5.2 Press RETURN の後の syslog

cycle A のコンソールの記録では、Autoinstall trying DHCPv4 の行の 4 行後に Press RETURN to get started! の行(144 行目)が在り、その後に syslog の行が流れました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A のコンソールの記録の抜粋は以下のとおりです。

snippet
…(省略)
Press RETURN to get started!


*Oct 30 22:14:08.208: %VUDI-6-EVENT: [serial number: 939JLUI2PQA], [vUDI: CSR1000V:939JLUI2PQA], A new vUDI has been generated
*Oct 30 22:14:08.488: %SMART_LIC-6-EXPORT_CONTROLLED: Usage of export controlled features is not allowed
*Oct 30 22:14:08.914: %IOSXE_RP_NV-3-NV_ACCESS_FAIL: Initial read of NVRAM contents failed
*Oct 30 22:14:09.413: %SMART_LIC-6-AGENT_READY: Smart Agent for Licensing is initialized
…(省略)
*Oct 30 22:14:18.007: %PNP-6-PNP_DISCOVERY_STARTED: PnP Discovery started
*Oct 30 22:14:18.010: %PNP-6-PNP_GOOD_UDI_UPDATE: Good UDI [PID:CSR1000V,VID:,SN:939JLUI2PQA] identified via (platform-registry)
*Oct 30 22:14:18.012: %PNP-6-PNP_CDP_UPDATE: Device UDI [PID:CSR1000V,VID:,SN:939JLUI2PQA] identified for CDP
*Oct 30 22:12:09.688: %IOSXE-3-PLATFORM: R0/0: kernel: Warning: unable to open an initial console.
*Oct 30 22:13:19.604: %BOOT-5-OPMODE_LOG: R0/0: binos: System booted in AUTONOMOUS mode
…(省略)
*Oct 30 22:14:22.695: %CVAC-3-FILE_ERROR: Could not apply file cdrom0:/iosxe_config.txt: File appears not to be config file (missing newlines)
*Oct 30 22:14:22.696: %SYS-7-NVRAM_INIT_WAIT_TIME: Waited 0 seconds for NVRAM to be available
*Oct 30 22:14:23.029: %IOXN_APP-6-PRE_INIT_DAY0_GS_INFO: Day0 Guestshell pre-initilization API is being invoked
…(省略)

136 行目の No startup-config から 144 行目の Press RETURN to get started! までの間に、コンソールに出た syslog の行は 0 行でした(数えた)。171・172 行目の 2 行は、行頭の時刻が 168〜170 行目より前の値です。NEW1 の show logging のバッファの順も同じで、行頭の時刻の順と一致しない所があります(§5.7)。

178 行目の %CVAC-3-FILE_ERROR と、§5.4 の 200 行目の %CVAC-4-FILE_IGNORED は、NEW1 の show logging にも在る行です。この 2 行は Day 0 の証拠にしません。2 行が何を示すかは撮っていません(§14)。

cycle A のコンソールの記録には、初期設定の問いの行(initial configuration dialog を含む行)が 0 行でした。cycle B〜F のコンソールの記録には、この行が 1 行ずつ在りました(§15.5)。

5.3 DHCP と受けた option

NEW1 は GigabitEthernet1 で 10.76.0.100 を受け、受けた DHCPv4 の option を 1 項目印字しました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A のコンソールの記録の 186〜192 行目は以下のとおりです。

snippet
…(省略)
*Oct 30 22:14:29.768: %LINK-3-UPDOWN: Interface GigabitEthernet1, changed state to up
*Oct 30 22:14:29.952: %PNP-6-PNP_BEST_UDI_UPDATE: Best UDI [PID:CSR1000V,VID:V00,SN:939JLUI2PQA] identified via (entity-mibs)
*Oct 30 22:14:30.390: %SYS-5-RESTART: System restart
Acquired IPv4 address 10.76.0.100 on Interface GigabitEthernet1
Received following DHCPv4 options:
        bootfile        : http://10.76.0.10:8000/ztp76a.py
ed --
…(省略)

Received following DHCPv4 options: の下に印字された項目は bootfile の 1 行だけで、値は option 67 に入れた URL の丸ごとです。188 行目の %SYS-5-RESTART: System restart と 192 行目の ed -- は、NEW1 の show logging の %SYS-5-RESTART: System restarted -- の行と文字の並びが合います。1 つの syslog の行が別の印字に挟まれた形と読めますが、挟まれた原因は撮っていません。

5.4 取得と day0guestshell

NEW1 のコンソールの記録は、DHCP の行の後に、PnP の案内の 3 行・Attempting bootfile・Loading の 2 行・%PNP-6-PNP_SCRIPT_STARTED を並べました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A のコンソールの記録の 200〜224 行目は以下のとおりです。

snippet
…(省略)
*Oct 30 22:14:30.976: %CVAC-4-FILE_IGNORED: Configuration file cdrom0:/iosxe_config.txt is ignored: already found cdrom0:/iosxe_config.txt earlier
*Oct 30 22:14:36.623: %PKI-2-NON_AUTHORITATIVE_CLOCK: PKI functions can not be initialized until an authoritative time source, like NTP, can be obtained.
*Oct 30 22:14:41.194: %RAC-3-RACIPL: DHCP is already running on interface GigabitEthernet1
*Oct 30 22:14:41.215: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as vty0
*Oct 30 22:14:42.564: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as vty0
*Oct 30 22:14:42.576: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as vty0
*Oct 30 22:14:42.594: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as vty0
OK to enter CLI now...

pnp-discovery can be monitored without entering enable mode

Entering enable mode will stop pnp-discovery

Attempting bootfile http://10.76.0.10:8000/ztp76a.py

*Oct 30 22:14:52.723: %PNP-3-PNP_DOMAIN_NAME_NOT_FOUND: Domain name not found (1/10) on (GigabitEthernet1) by (pid=591, pname=PnP Agent Discovery, time=22:14:52 UTC Fri Oct 30 2026)
Loading http://10.76.0.10:8000/ztp76a.py
Loading http://10.76.0.10:8000/ztp76a.py
*Oct 30 22:14:54.709: %PNP-6-PNP_SCRIPT_STARTED: Script (http://10.76.0.10:8000/ztp76a.py) started (1/3) via (script-file-exec) by (pid=664, pname=DHCP Autoinstall, time=22:14:54 UTC Fri Oct 30 2026)
*Oct 30 22:14:54.865: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:14:55.073: %PNP-6-PNP_IPV4_RESOLVED_BY: IPv4 resolved on interface (GigabitEthernet1) by (pid=591, pname=PnP Agent Discovery, time=22:14:55 UTC Fri Oct 30 2026)
*Oct 30 22:14:55.122: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:14:55.257: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:14:57.918: %LINEPROTO-5-UPDOWN: Line protocol on Interface VirtualPortGroup31, changed state to up
*Oct 30 22:14:58.097: %PNP-3-PNP_CCO_SERVER_IP_UNRESOLVED: CCO server (devicehelper.cisco.com.) can't be resolved (1/10) by (pid=591, pname=PnP Agent Discovery, time=22:14:58 UTC Fri Oct 30 2026)
…(省略)

203〜206 行目と 219・221・222 行目は、DHCP Autoinstall の主体の CONFIG_P の行です(§8.7)。218 行目の %PNP-6-PNP_SCRIPT_STARTED は、取ったスクリプトの URL と started (1/3) と pname=DHCP Autoinstall を書きます。(1/3) の意味は撮っていません。

PnP の発見の行は、Domain name not found (1/10)(215 行目)・IPv4 resolved on interface(220 行目)・CCO server (devicehelper.cisco.com.) can't be resolved (1/10)(224 行目)が並びました。NEW1 の show logging では、PNP_DOMAIN_NAME_NOT_FOUND が (1/10)〜(10/10) の 10 行、PNP_CCO_SERVER_IP_UNRESOLVED が (1/10)〜(6/10) の 6 行でした(数えた)。

day0guestshell の行は、IOx の準備の行の後に続きました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A のコンソールの記録の 243〜251 行目は以下のとおりです。

snippet
…(省略)
*Oct 30 22:16:44.361: %PNP-3-PNP_DOMAIN_NAME_NOT_FOUND: Domain name not found (10/10) on (GigabitEthernet1) by (pid=591, pname=PnP Agent Discovery, time=22:16:44 UTC Fri Oct 30 2026)
*Oct 30 22:16:48.615: %IM-6-IOX_ENABLEMENT: R0/0: ioxman: IOX is ready.
*Oct 30 22:17:08.398: %PNP-3-PNP_CCO_SERVER_IP_UNRESOLVED: CCO server (devicehelper.cisco.com.) can't be resolved (6/10) by (pid=591, pname=PnP Agent Discovery, time=22:17:08 UTC Fri Oct 30 2026)day0guestshell activated successfully
Current state is: ACTIVATED
day0guestshell started successfully
Current state is: RUNNING
Guestshell enabled successfully

*Oct 30 22:17:12.508: %PNP-6-PNP_PROFILE_CREATED: PnP profile (pnp_python) created (1/3) by (pid=664, pname=DHCP Autoinstall, time=22:17:12 UTC Fri Oct 30 2026)
…(省略)

245 行目は、%PNP-3-PNP_CCO_SERVER_IP_UNRESOLVED の syslog の行の末尾に、時刻の無い day0guestshell activated successfully の印字が続いた形です。その後は Current state is: ACTIVATED → day0guestshell started successfully → Current state is: RUNNING → Guestshell enabled successfully の順でした。cycle A のコンソールの記録に、installed successfully の行は 0 行でした(cycle B の 2 回目と 3 回目の試みには在る = §10.3)。251 行目は、pnp_python の profile が pname=DHCP Autoinstall の主体で作られた行です(§8.8)。

WEB1 の受け手の記録(WEB1 の時計)には、NEW1 のアドレス 10.76.0.100 からの GET /ztp76a.py が同じ秒に 2 行在りました。〔ツール側〕cycle A の後に読んだ :8000 の受け手の記録は以下のとおりです。

snippet
$ cat ~/http-8000.log
10.76.0.10 - - [30/Oct/2026 22:11:21] "GET /ztp76a.py HTTP/1.1" 200 -
10.76.0.100 - - [30/Oct/2026 22:14:53] "GET /ztp76a.py HTTP/1.1" 200 -
10.76.0.100 - - [30/Oct/2026 22:14:53] "GET /ztp76a.py HTTP/1.1" 200 -

2 行目の送り元 10.76.0.10 は WEB1 自身の確かめ(§3.6 の curl)で、回数に数えません。この run の cycle A の :8000 の受け手の記録(受け手の起動から cycle A の後の cat まで)に、送り元 10.76.0.100 の GET は 2 行でした。この run の cycle A の WEB1 の tcpdump(NEW1 の start の前の起動から待ちの後の停止まで・WEB1 の時計)には、NEW1 から WEB1 の :8000 への TCP の接続が 2 本在り(SYN は 22:14:53.649210 と 22:14:53.664588)、各接続で WEB1 から NEW1 へのデータは 191・1460・300 バイトの 3 つでした。1460 と 300 の和 1760 は、配った ztp76a.py の大きさ(〔ツール側〕判定メモ)と、NEW1 の guest-share の downloaded_script.py の大きさ(§8.5)と同じ数です。GET が 2 行だった理由は撮っていません。

5.5 スクリプトの出力

NEW1 のコンソールの記録の 253〜362 行目は、スクリプトの印字(*** ZTP76 START A *** から *** ZTP76 END A *** まで)です。スクリプトの本文と印字は §7 にまとめて載せます。

5.6 destroyed と Script execution success!

スクリプトの印字の後、コンソールの記録は syslog の行を並べ、その途中に Guestshell destroyed successfully と Script execution success! が印字されました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A のコンソールの記録の 362〜390 行目は以下のとおりです。

snippet
…(省略)
 *** ZTP76 END A ***




*Oct 30 22:17:24.478: %PNP-6-PNP_SAVING_TECH_SUMMARY: Saving PnP tech summary (/pnp-tech/pnp-tech-discovery-summary)... Please wait. Do not interrupt.
*Oct 30 22:17:24.756: %SYS-5-CONFIG_P: Configured programmatically by process PnP Agent Discovery from console as vty0
*Oct 30 22:17:24.835: %SYS-5-CONFIG_P: Configured programmatically by process PnP Agent Discovery from console as vty0
*Oct 30 22:17:24.862: %CRYPTO_ENGINE-5-KEY_ADDITION: A key named SSH76 has been generated or imported by crypto-engine
*Oct 30 22:17:24.910: %SSH-5-ENABLED: SSH 1.99 has been enabled
*Oct 30 22:17:25.061: %SYS-5-CONFIG_P: Configured programmatically by process PnP Agent Discovery from console as vty0
*Oct 30 22:17:25.170: %PNP-6-PNP_TECH_SUMMARY_SAVED_OK: PnP tech summary (/pnp-tech/pnp-tech-discovery-summary) saved successfully (elapsed time: 1 seconds).
*Oct 30 22:17:25.170: %PNP-6-PNP_DISCOVERY_STOPPED: PnP Discovery stopped (Config Wizard)
*Oct 30 22:17:25.234: %SSH-5-DISABLED: SSH 1.99 has been disabled
*Oct 30 22:17:25.235: %SSH-5-ENABLED: SSH 1.99 has been enabled
*Oct 30 22:17:25.239: %SYS-5-CONFIG_P: Configured programmatically by process iosp_vty_100001_6AE5176AAB55FC619C000001_fd_177 from console as vty116
*Oct 30 22:17:25.355: %SYS-5-CONFIG_P: Configured programmatically by process iosp_vty_100001_6AE5176AAB55FC619C000001_fd_177 from console as vty116
*Oct 30 22:17:29.939: %CRYPTO_ENGINE-5-KEY_ADDITION: A key named SSH76.server has been generated or imported by crypto-engine
*Oct 30 22:17:32.059: %CRYPTO_ENGINE-5-KEY_REPLACE: A key named SSH76.server has been replaced by crypto-engine with new key data Guestshell destroyed successfully

*Oct 30 22:17:36.250: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as consoleScript execution success!

*Oct 30 22:17:39.905: %LINK-5-CHANGED: Interface VirtualPortGroup31, changed state to administratively down
*Oct 30 22:17:39.910: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:17:40.019: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:17:40.657: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:17:40.662: %PNP-6-PNP_PYTHON_SCRIPT_DONE: Python script (http://10.76.0.10:8000/ztp76a.py) done (1/3) via (script-file-exec) by (pid=664, pname=DHCP Autoinstall, time=22:17:40 UTC Fri Oct 30 2026)
*Oct 30 22:17:40.690: AUTOINSTALL: script execution successful for Gi1.
*Oct 30 22:17:40.906: %LINEPROTO-5-UPDOWN: Line protocol on Interface VirtualPortGroup31, changed state to down

Guestshell destroyed successfully は 380 行目の %CRYPTO_ENGINE-5-KEY_REPLACE の syslog の行の末尾に、Script execution success! は 382 行目の %SYS-5-CONFIG_P の syslog の行の末尾に続けて書かれました。この 2 つの印字は時刻を持たず、どちらも syslog の行の時刻と同じ時刻とは言えません。印字した処理の名前も、コンソールの記録には在りません。

374 行目の PnP Discovery stopped (Config Wizard) は、SRV1 の PnP Discovery stopped (Startup Config Present)(§3.4)と括弧の中が違う行です。388 行目の %PNP-6-PNP_PYTHON_SCRIPT_DONE は done (1/3) で、384 行目と 390 行目は VirtualPortGroup31 が down になった行です。

5.7 NEW1 の時計の順

NEW1 の show auto install trace は、行頭に NEW1 の時計の時刻を持つ 25 行の記録です。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後に SSH で撮った show auto install trace は以下のとおりです。

snippet
NEW1# show auto install trace
[10/30/26 22:14:22.913 UTC 1 664] autoinstall: start-up config empty
[10/30/26 22:14:22.913 UTC 2 664] autoinstall: autoinstall starting
[10/30/26 22:14:22.937 UTC 3 664] No startup-config, starting autoinstall...
[10/30/26 22:14:23.052 UTC 4 664] Guest Shell initialize started...
[10/30/26 22:14:23.052 UTC 5 664] GigabitEthernet1 - Interface_up: True, Is_lan: True, Ip_enabled: True
[10/30/26 22:14:23.327 UTC 6 664] Autoinstall trying DHCPv4 on GigabitEthernet1
[10/30/26 22:14:29.948 UTC 7 405] DHCP ip assigned flag = 1
[10/30/26 22:14:40.928 UTC 8 664] autoinstall: dhcp_autoinstall_stop is to TRUE
[10/30/26 22:14:40.928 UTC 9 664] GigabitEthernet1 - Interface_up: True, Is_lan: True, Ip_enabled: True
[10/30/26 22:14:40.928 UTC A 664] Received following DHCP options:
[10/30/26 22:14:40.928 UTC B 664]         bootfile        : http://10.76.0.10:8000/ztp76a.py
[10/30/26 22:14:40.928 UTC C 664] Autoinstall: resolved ipv4 for Gi1 is 10.76.0.100
[10/30/26 22:14:41.220 UTC D 664] autoinstall: ip address dhcp configured on GigabitEthernet1
[10/30/26 22:14:42.601 UTC E 664] Configured ip add dhcp client cisco-5254.00e8.9b71-Gi1
[10/30/26 22:14:42.601 UTC F 664] mgmt_dhcp_enable:Enter
[10/30/26 22:14:42.601 UTC 10 664] mgmt_dhcp_enable:no vbond support
[10/30/26 22:14:52.605 UTC 11 664] pnp etherchan cleanup skipped on this platform
[10/30/26 22:14:52.605 UTC 12 664] autoinstall: release other DHCP lease done
[10/30/26 22:14:52.645 UTC 13 664] autoinstall:boot file retrieved from DHCPC http://10.76.0.10:8000/ztp76a.py

[10/30/26 22:17:25.047 UTC 14 591] autoinstall: IPv6 module check no
[10/30/26 22:17:26.159 UTC 15 405] DHCP ip assigned flag = 1
[10/30/26 22:17:40.661 UTC 16 664] AUTOINSTALL:Script file executed successfully for Gi1
[10/30/26 22:17:40.689 UTC 17 664] AUTOINSTALL: script execution successful for Gi1. Calling set up abort.
[10/30/26 22:17:40.755 UTC 18 664] autoinstall: process kill 5
[10/30/26 22:22:05.250 UTC 19 342] autoinstall: IPv6 module check no
25 entries printed

show auto install trace のうち主体が在る行は、上の 14・15 行目の IF の設定の 2 行(autoinstall: ip address dhcp configured on GigabitEthernet1 と Configured ip add dhcp client cisco-5254.00e8.9b71-Gi1)です(§8.2・§8.3)。13 行目の Autoinstall: resolved ipv4 for Gi1 is 10.76.0.100 は、コンソールの記録の Acquired IPv4 address 10.76.0.100 と同じアドレスです。

NEW1 の show logging は、Console logging と Buffer logging がどちらも 106 messages の記録でした。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の show logging の抜粋は以下のとおりです。

snippet
NEW1# show logging
…(省略)
    Console logging: level debugging, 106 messages logged, xml disabled,
                     filtering disabled
    Monitor logging: level debugging, 0 messages logged, xml disabled,
                     filtering disabled
    Buffer logging:  level debugging, 106 messages logged, xml disabled,
…(省略)
*Oct 30 22:14:22.695: %CVAC-3-FILE_ERROR: Could not apply file cdrom0:/iosxe_config.txt: File appears not to be config file (missing newlines)
*Oct 30 22:14:22.696: %SYS-7-NVRAM_INIT_WAIT_TIME: Waited 0 seconds for NVRAM to be available
*Oct 30 22:14:23.029: %IOXN_APP-6-PRE_INIT_DAY0_GS_INFO: Day0 Guestshell pre-initilization API is being invoked
…(省略)
*Oct 30 22:14:30.976: %CVAC-4-FILE_IGNORED: Configuration file cdrom0:/iosxe_config.txt is ignored: already found cdrom0:/iosxe_config.txt earlier
*Oct 30 22:14:36.623: %PKI-2-NON_AUTHORITATIVE_CLOCK: PKI functions can not be initialized until an authoritative time source, like NTP, can be obtained.
*Oct 30 22:14:41.194: %RAC-3-RACIPL: DHCP is already running on interface GigabitEthernet1
*Oct 30 22:14:41.215: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as vty0
*Oct 30 22:14:42.564: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as vty0
*Oct 30 22:14:42.576: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as vty0
*Oct 30 22:14:42.594: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as vty0
*Oct 30 22:14:52.723: %PNP-3-PNP_DOMAIN_NAME_NOT_FOUND: Domain name not found (1/10) on (GigabitEthernet1) by (pid=591, pname=PnP Agent Discovery, time=22:14:52 UTC Fri Oct 30 2026)
*Oct 30 22:14:54.709: %PNP-6-PNP_SCRIPT_STARTED: Script (http://10.76.0.10:8000/ztp76a.py) started (1/3) via (script-file-exec) by (pid=664, pname=DHCP Autoinstall, time=22:14:54 UTC Fri Oct 30 2026)
*Oct 30 22:14:54.865: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:14:55.073: %PNP-6-PNP_IPV4_RESOLVED_BY: IPv4 resolved on interface (GigabitEthernet1) by (pid=591, pname=PnP Agent Discovery, time=22:14:55 UTC Fri Oct 30 2026)
*Oct 30 22:14:55.122: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:14:55.257: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:14:57.918: %LINEPROTO-5-UPDOWN: Line protocol on Interface VirtualPortGroup31, changed state to up
*Oct 30 22:14:58.097: %PNP-3-PNP_CCO_SERVER_IP_UNRESOLVED: CCO server (devicehelper.cisco.com.) can't be resolved (1/10) by (pid=591, pname=PnP Agent Discovery, time=22:14:58 UTC Fri Oct 30 2026)
…(省略)
*Oct 30 22:16:48.615: %IM-6-IOX_ENABLEMENT: R0/0: ioxman: IOX is ready.
*Oct 30 22:17:08.398: %PNP-3-PNP_CCO_SERVER_IP_UNRESOLVED: CCO server (devicehelper.cisco.com.) can't be resolved (6/10) by (pid=591, pname=PnP Agent Discovery, time=22:17:08 UTC Fri Oct 30 2026)
*Oct 30 22:17:12.508: %PNP-6-PNP_PROFILE_CREATED: PnP profile (pnp_python) created (1/3) by (pid=664, pname=DHCP Autoinstall, time=22:17:12 UTC Fri Oct 30 2026)
*Oct 30 22:17:23.801: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback76, changed state to up
*Oct 30 22:17:23.939: %SYS-5-CONFIG_P: Configured programmatically by process iosp_vty_100001_6AE5176AAB55FC619C000001_fd_177 from console as vty116
*Oct 30 22:17:24.478: %PNP-6-PNP_SAVING_TECH_SUMMARY: Saving PnP tech summary (/pnp-tech/pnp-tech-discovery-summary)... Please wait. Do not interrupt.
*Oct 30 22:17:24.756: %SYS-5-CONFIG_P: Configured programmatically by process PnP Agent Discovery from console as vty0
*Oct 30 22:17:24.835: %SYS-5-CONFIG_P: Configured programmatically by process PnP Agent Discovery from console as vty0
*Oct 30 22:17:24.862: %CRYPTO_ENGINE-5-KEY_ADDITION: A key named SSH76 has been generated or imported by crypto-engine
*Oct 30 22:17:24.910: %SSH-5-ENABLED: SSH 1.99 has been enabled
*Oct 30 22:17:25.061: %SYS-5-CONFIG_P: Configured programmatically by process PnP Agent Discovery from console as vty0
*Oct 30 22:17:25.170: %PNP-6-PNP_TECH_SUMMARY_SAVED_OK: PnP tech summary (/pnp-tech/pnp-tech-discovery-summary) saved successfully (elapsed time: 1 seconds).
*Oct 30 22:17:25.170: %PNP-6-PNP_DISCOVERY_STOPPED: PnP Discovery stopped (Config Wizard)
*Oct 30 22:17:25.234: %SSH-5-DISABLED: SSH 1.99 has been disabled
*Oct 30 22:17:25.235: %SSH-5-ENABLED: SSH 1.99 has been enabled
*Oct 30 22:17:25.239: %SYS-5-CONFIG_P: Configured programmatically by process iosp_vty_100001_6AE5176AAB55FC619C000001_fd_177 from console as vty116
*Oct 30 22:17:25.355: %SYS-5-CONFIG_P: Configured programmatically by process iosp_vty_100001_6AE5176AAB55FC619C000001_fd_177 from console as vty116
*Oct 30 22:17:29.939: %CRYPTO_ENGINE-5-KEY_ADDITION: A key named SSH76.server has been generated or imported by crypto-engine
*Oct 30 22:17:32.059: %CRYPTO_ENGINE-5-KEY_REPLACE: A key named SSH76.server has been replaced by crypto-engine with new key data
*Oct 30 22:17:36.250: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:17:39.905: %LINK-5-CHANGED: Interface VirtualPortGroup31, changed state to administratively down
*Oct 30 22:17:39.910: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:17:40.019: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:17:40.657: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as console
*Oct 30 22:17:40.662: %PNP-6-PNP_PYTHON_SCRIPT_DONE: Python script (http://10.76.0.10:8000/ztp76a.py) done (1/3) via (script-file-exec) by (pid=664, pname=DHCP Autoinstall, time=22:17:40 UTC Fri Oct 30 2026)
*Oct 30 22:17:40.690: AUTOINSTALL: script execution successful for Gi1.
*Oct 30 22:17:40.906: %LINEPROTO-5-UPDOWN: Line protocol on Interface VirtualPortGroup31, changed state to down
…(省略)

show logging のバッファの順は、行頭の時刻の順と一致しない所があります。52 行目の 22:14:18.012 の次の 2 行(53・54 行目)は、22:12:09.688 と 22:13:19.604 の行です。下の表は、show auto install trace と show logging の行を、行頭の時刻で並べ直した出来事の順です。cycle A の show logging に IOX_INST_INFO の行は 0 行で(数えた)、この表に Guest Shell の起動の時刻の行はありません。

NEW1 の時刻(UTC・Oct 30)出来事(逐語の抜粋)出どころ
22:14:22.695%CVAC-3-FILE_ERROR: Could not apply file cdrom0:/iosxe_config.txtshow logging
22:14:22.913autoinstall: start-up config emptyshow auto install trace
22:14:22.937No startup-config, starting autoinstall...show auto install trace
22:14:23.029%IOXN_APP-6-PRE_INIT_DAY0_GS_INFO: Day0 Guestshell pre-initilization API is being invokedshow logging
22:14:23.052Guest Shell initialize started...show auto install trace
22:14:23.327Autoinstall trying DHCPv4 on GigabitEthernet1show auto install trace
22:14:30.976%CVAC-4-FILE_IGNOREDshow logging
22:14:40.928Received following DHCP options: と bootfile : http://10.76.0.10:8000/ztp76a.pyshow auto install trace
22:14:41.220autoinstall: ip address dhcp configured on GigabitEthernet1show auto install trace
22:14:42.601Configured ip add dhcp client cisco-5254.00e8.9b71-Gi1show auto install trace
22:14:52.645autoinstall:boot file retrieved from DHCPC http://10.76.0.10:8000/ztp76a.pyshow auto install trace
22:14:54.709%PNP-6-PNP_SCRIPT_STARTED: Script (http://10.76.0.10:8000/ztp76a.py) started (1/3)show logging
22:14:57.918Line protocol on Interface VirtualPortGroup31, changed state to upshow logging
22:14:58.097CCO server (devicehelper.cisco.com.) can't be resolved (1/10)show logging
22:16:48.615%IM-6-IOX_ENABLEMENT: R0/0: ioxman: IOX is readyshow logging
22:17:12.508%PNP-6-PNP_PROFILE_CREATED: PnP profile (pnp_python) created (1/3)show logging
22:17:23.939%SYS-5-CONFIG_P: Configured programmatically by process iosp_vty_100001_6AE5176AAB55FC619C000001_fd_177 from console as vty116show logging
22:17:25.170%PNP-6-PNP_DISCOVERY_STOPPED: PnP Discovery stopped (Config Wizard)show logging
22:17:39.905Interface VirtualPortGroup31, changed state to administratively downshow logging
22:17:40.661AUTOINSTALL:Script file executed successfully for Gi1show auto install trace
22:17:40.662%PNP-6-PNP_PYTHON_SCRIPT_DONE: Python script (http://10.76.0.10:8000/ztp76a.py) done (1/3)show logging
22:17:40.689AUTOINSTALL: script execution successful for Gi1(行の続きは Calling set up abort)show auto install trace
22:17:40.755autoinstall: process kill 5show auto install trace
(時刻なし)Guestshell destroyed successfully → Script execution success!(見え方の順)コンソールの記録

表の先頭の 4 行のうち、%CVAC-3-FILE_ERROR・autoinstall: start-up config empty・No startup-config, starting autoinstall...・PRE_INIT_DAY0_GS_INFO は、Day 0 の証拠にしない行です(§15.3)。表は出来事の行を時刻の順に並べただけで、行と行の因果は書きません。

NEW1 の時計どうしの差は以下のとおりです(計算した値)。

区間差(秒)
Autoinstall trying DHCPv4(22:14:23.327)→ Received following DHCP options:(22:14:40.928)17.601
Received following DHCP options: → boot file retrieved(22:14:52.645)11.717
boot file retrieved → PNP_SCRIPT_STARTED(22:14:54.709)2.064
PNP_SCRIPT_STARTED → PNP_PROFILE_CREATED(22:17:12.508)137.799
PNP_SCRIPT_STARTED → PNP_PYTHON_SCRIPT_DONE(22:17:40.662)165.953

「スクリプトの実行」は、2 つの記録に言い分けます。1 つは show logging の PNP_SCRIPT_STARTED〜PNP_PYTHON_SCRIPT_DONE の 165.953 秒で、もう 1 つは dir bootflash:guest-share/ の印のファイルの時刻(ztp76-ran-A.txt が 22:17:21・§8.5)です。スクリプトの印字(*** ZTP76 START A ***〜*** ZTP76 END A ***)は、コンソールの記録の中で時刻を持ちません。

WEB1 の時計の記録(tcpdump と受け手の記録)は、この表に入れていません。WEB1 の tcpdump の DHCP の 4 パケット・HTTP の 2 本の接続・DNS の問い合わせは §6 と §12.4 に、WEB1 の時計の値のまま別に置きます。

5.8 資料のブートログとの比較

ZTP 章の 17.2.x 以降の見出しの節は、要約とブートログの見本(C9300-48UXM・Version 17.2.1)に、以下の行の組を載せています。

No startup-config, starting autoinstall/pnp/ztp…

Autoinstall will terminate if any input is detected on console

— System Configuration Dialog — Would you like to enter the initial configuration dialog? [yes/no]: Acquired IPv4 address 10.127.128.8 on Interface GigabitEthernet0/0 Received following DHCPv4 options: bootfile : test.py tftp-server-ip : 159.14.27.2

OK to enter CLI now… pnp-discovery can be monitored without entering enable mode Entering enable mode will stop pnp-discovery

Attempting bootfile tftp://159.14.27.2/test.py day0guestshell activated successfully Current state is: ACTIVATED day0guestshell started successfully Current state is: RUNNING Guestshell enabled successfully

*** ZTP Day0 Python Script Execution Complete *** Guestshell destroyed successfully Script execution success! Press RETURN to get started!

(ZTP 章「Cisco IOS XE Amsterdam 17.2.x and Later Releases」)

本ラボの cycle A のコンソールの記録は、No startup-config・Autoinstall will terminate・OK to enter CLI now... と pnp-discovery の 2 行・Attempting bootfile の後の day0guestshell の行・Guestshell destroyed successfully → Script execution success! を、見本と同じ文言で並べました。違ったのは次の点です。

項目資料の見本(C9300-48UXM・17.2.1)本ラボの cycle A(csr1000v 17.03.08a・RAM 4096 MB)
初期設定の問いの行受けた option の印字の前に在る0 行(cycle B〜F は 1 行ずつ)
受けた option の印字bootfile : test.py と tftp-server-ip : 159.14.27.2 の 2 項目bootfile : http://10.76.0.10:8000/ztp76a.py の 1 項目
Press RETURN to get started!Script execution success! の後ZTP76 END A より前の 144 行目
destroyed と success の行単独の行syslog の行の末尾に続けて書かれた

ZTP 章の ISR 4000 の節の見本(ISR4451-X/K9・版の記載なし)は、setup の問いの行の後に、ZTP の間に触れないよう求める注記を置きます。

— System Configuration Dialog — Would you like to enter the initial configuration dialog? [yes/no]: % !!<DO NOT TOUCH. This is Zero-Touch Provisioning»

(ZTP 章「Boot Log for Cisco 4000 Series Integrated Services Routers」)

17.2.x 以降の見本の Autoinstall will terminate の行と、OK to enter CLI now... の行と、ISR4451-X の見本の注記は、時点の違う案内です。コンソールに入力してよい時点は資料からは決まりません。

本ラボは Day 0 の間にコンソールへ入力しておらず、入力した時の振る舞いは撮っていません(§14)。


6. 機器が送る DHCP の option

6.1 資料の client option

ZTP 章の表 1(§2.3)は、DHCPv4 の client option を、Product ID = 124・シリアル番号と MAC アドレス = 61/toggles・Cisco Network PnP = 60 としていました。AutoInstall 章は、多くの Cisco IOS XE の機器は DHCP で IP アドレスを求める時に MAC アドレスを使わず、より長い client identifier を使うと書き、その形を見本で示します(見本の機器の機種・版の記載なし)。

Many Cisco IOS XE-based devices do not use their MAC address when they request an IP address via DHCP. They use a much longer client identifier instead.

(AutoInstall 章「DHCP Servers」)

The client-identifier looks like this: 0063.6973.636f.2d30.3030.362e.3533.6237.2e38.6537.312d.4661.332f.30 The format is nullcisco-0006.53b7.8e71-fa3/0 where 0006.53b7.8e71 is the MAC address and fa3/0 is the short interface name for the interface that the IP address request is made for.

(AutoInstall 章「Determining the Value for the DHCP Client Identifier Manually」の見本)

iPXE 章は、起動に使う DHCP サーバが、Product ID(option 60)・筐体のシリアル番号(option 61)・MAC アドレスで機器を見分けられると書き、option 60 と 61 には rommon の環境変数の値が入ると書きます。iPXE 章の機器は rommon で起動する Catalyst のスイッチで(§13.2)、ZTP とは対象の違う文として並べます。

The DHCP server used for booting can identify a device through the Product ID (PID) (available in DHCP Option 60), chassis serial number (available in DHCP option 61), or the MAC address of the device.

(iPXE 章「iPXE Overview」)

DHCP Option 60—Vendor Class Identifier. This option is populated with the value of the ROMMON environment variable MODEL_NUM.

DHCP Option 61—Client Identifier. This option is populated with the value of theROMMON environment variable SYSTEM_SERIAL_NUM.

(iPXE 章「iPXE-Supported DHCP Options」)

上の option 61 の引用の theROMMON は、語の間の空白が無い形で、取得した本文のまま引いています(§15.8)。

option 60 の文字列は、PnP の本の中で ‘cisco pnp’ と “ciscopnp” に割れていました(§2.5)。本ラボの機器が送った値は、以下の §6.2 と §6.5 です。

6.2 本ラボの Discover と Offer

WEB1 の tcpdump には、cycle A の DHCP の 4 パケット(Discover・Offer・Request・ACK)が broadcast で残りました。〔ツール側〕WEB1 の tcpdump の cycle A の Discover(WEB1 の時計)は以下のとおりです。

snippet
$ cat ~/tcpdump-A.txt
tcpdump: listening on ens3, link-type EN10MB (Ethernet), snapshot length 262144 bytes
22:14:22.006284 52:54:00:e8:9b:71 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 365: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 351)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 52:54:00:e8:9b:71, length 323, xid 0x1649, Flags [Broadcast] (0x8000)
	  Client-Ethernet-Address 52:54:00:e8:9b:71
	  Vendor-rfc1048 Extensions
	    Magic Cookie 0x63825363
	    DHCP-Message (53), length 1: Discover
	    MSZ (57), length 2: 1200
	    Client-ID (61), length 25: "cisco-5254.00e8.9b71-Gi1"
	    Hostname (12), length 6: "Router"
	    Parameter-Request (55), length 12:
	      Subnet-Mask (1), TFTP (66), Domain-Name-Server (6), Domain-Name (15)
	      Netbios-Name-Server (44), Default-Gateway (3), BF (67), Hostname (12)
	      Static-Route (33), TFTP-Server-Address (150), Vendor-Option (43), Unknown (125)
	    Vendor-Class (60), length 8: "ciscopnp"
	    Unknown (124), length 14: 0,9,2312,17235,21041,12336,12374
	    END (255), length 0
…(省略)

NEW1 の Discover には、option 61(Client-ID)・12(Hostname)・55(Parameter-Request)・60(Vendor-Class)・124(tcpdump の表示は Unknown)が在りました。55 の一覧には BF (67)・TFTP-Server-Address (150)・Vendor-Option (43) が在ります。〔ツール側〕同じ tcpdump の SRV1 の Offer は以下のとおりです。

snippet
$ cat ~/tcpdump-A.txt
…(省略)
22:14:24.016694 52:54:00:e9:b9:d2 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 383: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 369)
    10.76.0.1.67 > 255.255.255.255.68: [udp sum ok] BOOTP/DHCP, Reply, length 341, xid 0x1649, Flags [Broadcast] (0x8000)
	  Your-IP 10.76.0.100
	  Client-Ethernet-Address 52:54:00:e8:9b:71
	  Vendor-rfc1048 Extensions
	    Magic Cookie 0x63825363
	    DHCP-Message (53), length 1: Offer
	    Client-ID (61), length 25: "cisco-5254.00e8.9b71-Gi1"
	    Server-ID (54), length 4: 10.76.0.1
	    Lease-Time (51), length 4: 86400
	    RN (58), length 4: 43200
	    RB (59), length 4: 75600
	    Subnet-Mask (1), length 4: 255.255.255.0
	    Default-Gateway (3), length 4: 10.76.0.1
	    BF (67), length 32: "http://10.76.0.10:8000/ztp76a.py"
	    END (255), length 0
…(省略)

cycle A の Offer と ACK に値の付いた option 150・43 の行は 0 行で、option 67(tcpdump の表示は BF)は http://10.76.0.10:8000/ztp76a.py の 32 バイトでした。ACK は Offer と同じ option の組でした。Request は、Discover の option に、Discover に無い Server-ID (54)・Requested-IP (50)・Lease-Time (51) の 3 つが在る組でした。WEB1 の時計の Discover → Offer は 2.010410 秒、Offer → Request は 0.003941 秒、Request → ACK は 0.002213 秒でした(計算した値)。

6.3 option 124 の中身

tcpdump は option 124 を Unknown と表示し、中身を 16 ビットずつの十進数の 7 個(0,9,2312,17235,21041,12336,12374)で表示しました。7 個の数を 2 バイトずつの 16 進(上位のバイトが先)に戻すと、14 バイトは以下のとおりです(記事の側で計算した値)。

表示の数16 進(2 バイト)ASCII(文字の範囲だけ)
000 00—
900 09—
231209 08—
1723543 53C S
2104152 31R 1
1233630 300 0
1237430 560 V

先頭の 4 バイト(00 00 00 09)は 9、6 バイト目は 8、7〜14 バイト目の 8 バイトは ASCII で CSR1000V です。SRV1 の DHCP サーバの debug は、同じ option を Enterprise ID・データの長さ・データの 3 つで表示しました。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の cycle A の show logging の DHCP の debug の抜粋は以下のとおりです。

snippet
SRV1# show logging
…(省略)
*Oct 30 22:14:23.054: Option 82 not present
*Oct 30 22:14:23.054: DHCPD: Reload workspace interface GigabitEthernet2 tableid 0.
*Oct 30 22:14:23.054: DHCPD: tableid for 10.76.0.1 on GigabitEthernet2 is 0
*Oct 30 22:14:23.055: DHCPD: client's VPN is .
*Oct 30 22:14:23.055: DHCPD: No option 125
*Oct 30 22:14:23.055: DHCPD: Option 124: Vendor Class Information
*Oct 30 22:14:23.055:   DHCPD: Enterprise ID: 9
*Oct 30 22:14:23.055:   DHCPD: Vendor-class-data-len: 8
*Oct 30 22:14:23.055:   DHCPD: Data: CSR1000V
*Oct 30 22:14:23.055: DHCPD: Option 125 not present in the msg.
*Oct 30 22:14:23.055: Option 82 not present
*Oct 30 22:14:23.055: Option 82 not present
*Oct 30 22:14:23.055: DHCPD: Option 125 not present in the msg.
*Oct 30 22:14:23.055: DHCPD: Sending notification of DISCOVER:
*Oct 30 22:14:23.056:   DHCPD: htype 1 chaddr 5254.00e8.9b71
*Oct 30 22:14:23.056:   DHCPD: remote id 020a00000a4c000100000000
*Oct 30 22:14:23.056:   DHCPD: interface = GigabitEthernet2
*Oct 30 22:14:23.056:   DHCPD: class id 636973636f706e70
*Oct 30 22:14:23.056: DHCPD: DHCPDISCOVER received from client 0063.6973.636f.2d35.3235.342e.3030.6538.2e39.6237.312d.4769.31 on interface GigabitEthernet2.
…(省略)

SRV1 の debug の Enterprise ID: 9・Vendor-class-data-len: 8・Data: CSR1000V は、上の計算の 9・8・CSR1000V と同じ値です。5 バイト目の 9 の意味は書きません。119 行目は CSR1000V の直後に表示されない 0x7f の 1 バイトを持ち、その行は逐語のまま載せています。128 行目の class id 636973636f706e70 を ASCII に戻すと ciscopnp で、option 60 の文字列と同じです。

同じ SRV1 の debug には、cycle A の 3 組目の option 124 の解読(22:17:26.077)の Data: の行で、CSR1000V の後に別の文字が続いた崩れた行が 1 行在りました。この行は引きません(§15.6)。

6.4 option 61(Client-ID)

option 61 の形は cycle によって違いました。cycle A は cisco-5254.00e8.9b71-Gi1(length 25)で、cycle B〜F は length 12 の別の形でした。

cycleWEB1 の tcpdump の Client-ID (61)同じ cycle の NEW1 のコンソールの Processor board ID
Alength 25: “cisco-5254.00e8.9b71-Gi1”939JLUI2PQA
Blength 12: “9C8YU3YPD06”9C8YU3YPD06
Clength 12: “9F8FO8YFAAK”9F8FO8YFAAK
Dlength 12: “9G7MX6FFG9X”9G7MX6FFG9X
Elength 12: “95OW9D5DJJ0”95OW9D5DJJ0
Flength 12: “95SCC54D7RI”95SCC54D7RI

cycle B〜F の Client-ID は、同じ cycle のコンソールの記録の Processor board ID の行と同じ文字列で、cycle C は show version の Processor board ID 9F8FO8YFAAK とも同じでした。cycle A の Client-ID は 939JLUI2PQA を含まず、5254.00e8.9b71 の 12 桁の 16 進を含みます。この 12 桁は、tcpdump の NEW1 の MAC アドレス(52:54:00:e8:9b:71)と SRV1 の debug の chaddr 5254.00e8.9b71 と同じ並びです。cycle A と cycle B〜F で形が違った理由は撮っていません(§14)。

SRV1 の binding は、Client-ID を 16 進で表示しました。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の cycle A の show ip dhcp binding は以下のとおりです。

snippet
SRV1# show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address      Client-ID/ 		Lease expiration 	Type       State      Interface
		Hardware address/
		User name
10.76.0.100     0063.6973.636f.2d35.    Oct 31 2026 10:17 PM    Automatic  Active     GigabitEthernet2
                3235.342e.3030.6538.
                2e39.6237.312d.4769.
                31

Client-ID の 16 進を文字に戻すと、先頭の 1 バイトが 0x00 で、残りの 24 バイトが cisco-5254.00e8.9b71-Gi1 です(記事の側で計算した値)。NEW1 の側の show dhcp lease は、同じ文字列を Client-ID として表示しました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の show dhcp lease は以下のとおりです。

snippet
NEW1# show dhcp lease
Temp IP addr: 10.76.0.100  for peer on Interface: GigabitEthernet1
Temp  sub net mask: 255.255.255.0
   DHCP Lease server: 10.76.0.1, state: 5 Bound
   DHCP transaction id: 1649
   Lease: 86400 secs,  Renewal: 43200 secs,  Rebind: 75600 secs
Temp default-gateway addr: 10.76.0.1
   Next timer fires after: 11:56:21
   Retry count: 0   Client-ID: cisco-5254.00e8.9b71-Gi1
   Client-ID hex dump: 636973636F2D353235342E303065382E
                       396237312D476931
   Hostname: NEW1

NEW1 の Client-ID hex dump は 24 バイトで、SRV1 の binding の先頭の 0x00 を含みません。DHCP transaction id: 1649 は tcpdump の xid 0x1649 と同じ数字で、Lease・Renewal・Rebind の 86400・43200・75600 は Offer の option 51・58・59 と同じ数です。先頭の 0x00 の差の理由は撮っていません。

AutoInstall 章の見本の client identifier(§6.1)は、16 進の頭が 0063.6973.636f.2d で、形を nullcisco-0006.53b7.8e71-fa3/0 と書きます。

本ラボの cycle A の binding の 16 進の頭も 0063.6973.636f.2d です。2 つを並べるだけにします。

ZTP 章の表 1 は、DHCPv4 の欄で、シリアル番号の行と MAC アドレスの行をどちらも 61/toggles とし、toggles の意味は書いていません(§2.3)。

本ラボのこの run の option 61 は、cycle A が NEW1 の MAC アドレスと同じ並びの 12 桁の 16 進を含む cisco-5254.00e8.9b71-Gi1(length 25)、cycle B〜F が同じ cycle の Processor board ID と同じ文字列(length 12)でした(上の表)。2 つを並べるだけにします。

6.5 option 60 と 12

この run の 6 本の WEB1 の tcpdump(各 cycle の NEW1 の start の前の起動から待ちの後の停止まで)の Discover と Request の 12 パケットには、option 60 の Vendor-Class (60), length 8: "ciscopnp" が 12 行在りました(数えた)。

PnP の本の 2 つの節の文字列(‘cisco pnp’ と “ciscopnp”)のうち、本ラボの機器の値は空白の無い形と同じ文字列です。どちらの節の文が正しいとは書きません。

この run の 6 本の WEB1 の tcpdump(同じ範囲)の Discover と Request の 12 パケットには、option 12 の Hostname (12), length 6: "Router" が 12 行在りました(数えた)。SRV1 の debug の Using hostname の行は、cycle A では 22:14:25 の 1 回目の REQUEST の処理で Router.lab.local.、22:17:26 の 2 回目の REQUEST の処理で NEW1.lab.local. でした。WEB1 の tcpdump の cycle A の Request は 1 パケットで、SRV1 の debug の DHCPREQUEST received from client の行は 2 行(22:14:25.063 と 22:17:26.077・SRV1 の時計)です。2 回目の REQUEST は WEB1 の視野(broadcast と WEB1 のフレーム)に入っておらず、unicast だったかは撮っていません。


7. スクリプトと実行の環境

7.1 資料の Python と cli モジュール

Python API 章は、EXEC と設定のコマンドを打てる Python のモジュールを Cisco が用意していると書き、Python を動かすには Guest Shell を有効にしておく必要があると書きます。CLI Python Module 章は、Python のスクリプトで機器の CLI を扱えることを、ZTP と EEM の action に結び付けて書きます。

Cisco provides a Python module that provides access to run EXEC and configuration commands.

(Python API 章「Cisco Python Module」)

Guest Shell must be enabled for Python to run.

(Python API 章「Cisco Python Module to Execute IOS CLI Commands」)

The Python scripting capability gives programmatic access to a device’s CLI to perform various tasks and Zero Touch Provisioning or Embedded Event Manager (EEM) actions.

(CLI Python Module 章「About Python」)

Guest Shell 章は、17.3.1 以降は Python 3 だけを支えると書き、17.3.1 以降の見出しの節の Catalyst 9000 の見本は guestshell run python3 の後に Python 3.6.8 の表示を置きます(見本のビルドの時刻は 22:10:21)。

In Cisco IOS XE Amsterdam 17.3.1 and later releases, only Python version 3 is supported.

(Guest Shell 章「Managing the Guest Shell」)

In Cisco IOS XE Amsterdam 17.3.1 and later releases, only Python V3.6 is supported.

The following example shows how to enable Python on Cisco Catalyst 9000 Series Switches: Device# guestshell run python3 Python 3.6.8 (default, Nov 21 2019, 22:10:21) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)] on linux Type “help”, “copyright”, “credits” or “license” for more information.»»>

(Guest Shell 章「In Cisco IOS XE Amsterdam 17.3.1 and Later Releases」)

CLI Python Module 章の Python 2.7 の記述と、同じ章の対話の見本の Python 2.7.5 の表示は、7-4 §13.5 に引いてあります。Python API 章の help(configure) が cli.configure の戻り値を list(ConfigResult) と書くことは 7-4 §13.3 に引いてあり、7-4 の同じ節は、その出力が Python API 章の対話の見本の Python 2.7.5 の表示の後に置かれていると書いています。

スクリプトの置き場所の書き方は、資料の中で 2 つの形があります。CLI Python Module 章は /bootflash/guest-share/script.py の形で、Guest Shell 章の 17.3.1 より前の見出しの節の例は /flash/guest-share/sample_script.py の形です。

To run a Python script from the Guest Shell, execute the guestshell run python /bootflash/guest-share/script.py command at the device prompt.

(CLI Python Module 章「Python Script」)

Guestshell run python /flash/guest-share/sample_script.py parameter1 parameter2

(Guest Shell 章「In Releases Prior to Cisco IOS XE Amsterdam 17.3.1」)

7.2 配ったスクリプト

本ラボのスクリプトは、実行環境を印字し、印のファイルを 2 つの場所に書き、show を 5 回(show ip interface brief は設定の前と後の 2 回)打ち、設定を 3 回に分けて入れる 33 行です。〔ツール側〕取得スクリプトが cycle A で配る直前に保存した ztp76a.py の本文(資格情報の値を固定の伏せ字に置き換えた形)は以下のとおりです。

snippet
# ztp76.py - NW guide 7-6 lab (Day 0 ZTP)
import os
import sys
import cli

TAG = "A"
print("\n\n *** ZTP76 START " + TAG + " *** \n\n")
print("ZTP76 python " + sys.version.replace("\n", " "))
print("ZTP76 executable " + str(sys.executable))
print("ZTP76 argv " + repr(sys.argv))
print("ZTP76 file " + os.path.abspath(__file__))
print("ZTP76 cwd " + os.getcwd())
for d in ("/bootflash/guest-share", "/flash/guest-share"):
    try:
        with open(d + "/ztp76-ran-" + TAG + ".txt", "w") as f:
            f.write("ztp76 ran " + TAG + "\n")
        print("ZTP76 marker written " + d)
    except Exception as e:
        print("ZTP76 marker error " + d + " " + type(e).__name__)
cli.executep("show version")
cli.executep("show ip interface brief")
cli.executep("show ip route")
cli.executep("show app-hosting list")
cli.configurep(["hostname NEW1", "interface Loopback76", "description ZTP76 " + TAG, "ip address 10.76.76.76 255.255.255.255", "end"])
cli.configurep(["ip domain name lab.local", "crypto key generate rsa general-keys label SSH76 modulus 2048", "ip ssh rsa keypair-name SSH76", "ip ssh version 2", "end"])
try:
    results = cli.configure(["username netops privilege 15 secret 9 [build が伏せた資格情報]", "line vty 0 4", "login local", "transport input ssh", "end"])
    print("ZTP76 access lines " + " ".join("ok" if getattr(r, "success", False) else "ng" for r in results))
    print("ZTP76 access result " + type(results).__name__ + " " + str(len(results)) + " " + type(results[0]).__name__ + " " + repr(getattr(results[0], "_fields", None)))
except Exception as e:
    print("ZTP76 access error " + type(e).__name__)
cli.executep("show ip interface brief")
print("\n\n *** ZTP76 END " + TAG + " *** \n\n")

〔ツール側〕取得スクリプトの判定メモは、伏せ字が 1 か所だけであること・伏せ字の外が雛形と 1 字ずつ一致すること・配った本文の sha256 が WEB1 の sha256sum と一致することの 3 点を True と記録しました。本文に保存のコマンド(write memory・copy running-config)の行は 0 行です(数えた)。WEB1 の ztp76a.py の大きさは 1760 バイトでした(〔ツール側〕判定メモ)。

7.3 Python と実行の場所

スクリプトは、Python の版・実行ファイル・argv・ファイルの場所・カレントディレクトリを印字し、印のファイルを 2 つの場所に書けたと印字しました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A のコンソールの記録の 253〜262 行目は以下のとおりです。

snippet
…(省略)
 *** ZTP76 START A ***


ZTP76 python 3.6.8 (default, Nov 21 2019, 19:31:34)  [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)]
ZTP76 executable /usr/bin/python3
ZTP76 argv ['/bootflash/guest-share/downloaded_script.py']
ZTP76 file /bootflash/guest-share/downloaded_script.py
ZTP76 cwd /home/guestshell
ZTP76 marker written /bootflash/guest-share
ZTP76 marker written /flash/guest-share
…(省略)

Python の版は 3.6.8 で、ビルドの日時は Nov 21 2019, 19:31:34 でした。実行ファイルは /usr/bin/python3、スクリプトのファイルは /bootflash/guest-share/downloaded_script.py、カレントディレクトリは /home/guestshell です。

版の番号は Guest Shell 章の 17.3.1 以降の見本(3.6.8)と同じで、ビルドの時刻は見本の 22:10:21 と違います。7-4 §6.2 の Guest Shell の python3 も Python 3.6.8 でした。

印のファイルは /bootflash/guest-share と /flash/guest-share の両方に書けました。ZTP の後の dir bootflash:guest-share/ には ztp76-ran-A.txt(12 バイト)が在りました(§8.5)。/flash/guest-share の側のファイルは撮っていません。スクリプトがどこで走ったかは、印字した値と印のファイルの行を並べるだけで、説明は資料の文(ZTP 章の概要の Guest Shell が実行するという文 = §2.2)に残します。

7.4 スクリプトの中の show

スクリプトの中の show ip interface brief には VirtualPortGroup31 が在り、show app-hosting list には day0guestshell が RUNNING で在りました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A のコンソールの記録の抜粋(スクリプトが打った show の出力)は以下のとおりです。

snippet
…(省略)
Interface              IP-Address      OK? Method Status                Protocol
GigabitEthernet1       10.76.0.100     YES DHCP   up                    up
VirtualPortGroup31     192.168.2.1     YES TFTP   up                    up
…(省略)
Gateway of last resort is 10.76.0.1 to network 0.0.0.0
S*    0.0.0.0/0 [254/0] via 10.76.0.1
      10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C        10.76.0.0/24 is directly connected, GigabitEthernet1
S        10.76.0.1/32 [254/0] via 10.76.0.1, GigabitEthernet1
L        10.76.0.100/32 is directly connected, GigabitEthernet1
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, VirtualPortGroup31
L        192.168.2.1/32 is directly connected, VirtualPortGroup31

App id                                   State
---------------------------------------------------------
day0guestshell                           RUNNING
…(省略)

VirtualPortGroup31 は 192.168.2.1 で、Method の列は TFTP です(Method の列の語で、TFTP の転送の行ではありません)。既定経路は S* の [254/0] via 10.76.0.1 です。ZTP の後に SSH で撮った show ip interface brief には VirtualPortGroup31 の行が無く(§8.4)、NEW1 の show logging には VirtualPortGroup31 の up・administratively down・down の 3 行が在りました(§5.7)。VirtualPortGroup31 を何が作り、何が外したかは撮っていません(§14)。

7.5 configurep と configure

スクリプトの 2 回の cli.configurep は、「Line N SUCCESS:」の形の行を 5 行ずつ印字しました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A のコンソールの記録の 339〜358 行目は以下のとおりです。

snippet
…(省略)
Line 1 SUCCESS:  hostname NEW1
Line 2 SUCCESS:  interface Loopback76
Line 3 SUCCESS:  description ZTP76 A
Line 4 SUCCESS:  ip address 10.76.76.76 255.255.255.255
Line 5 SUCCESS:  end


*Oct 30 22:17:23.801: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback76, changed state to up
*Oct 30 22:17:23.939: %SYS-5-CONFIG_P: Configured programmatically by process iosp_vty_100001_6AE5176AAB55FC619C000001_fd_177 from console as vty116Line 1 SUCCESS:  ip domain name lab.local
Line 2 SUCCESS:  crypto key generate rsa general-keys label SSH76 modulus 2048
Line 3 SUCCESS:  ip ssh rsa keypair-name SSH76
Line 4 SUCCESS:  ip ssh version 2
Line 5 SUCCESS:  end

ZTP76 access lines ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng
ZTP76 access result str 234 str None
Interface              IP-Address      OK? Method Status                Protocol
GigabitEthernet1       10.76.0.100     YES DHCP   up                    up
Loopback76             10.76.76.76     YES other  up                    up
VirtualPortGroup31     192.168.2.1     YES TFTP   up                    up
…(省略)

347 行目は、%SYS-5-CONFIG_P の syslog の行(主体は iosp_vty_…・as vty116)の末尾に、2 回目の configurep の 1 行目(ip domain name lab.local の行)が続いた形です。configurep の「Line N SUCCESS:」の形の行は 10 行で、FAIL か ERROR の語を持つ「Line N」の行は 0 行でした(数えた)。

cli.configure の呼び出しの印字は、ZTP76 access result str 234 str None でした。式の順に、返り値の型が str、長さが 234、最初の要素の型が str、最初の要素に _fields が無い(None)ことを表します。353 行目の ZTP76 access lines の行の ng は 234 個でした(数えた)。この行は、スクリプトの 28 行目が返り値を 1 要素ずつ見て、success の属性の無い要素に ng を印字する作りで(〔ツール側〕スクリプトの組み立て)、返り値の str の 234 文字の数と同じ数の ng が並んだ観測です。設定の行が 234 行失敗したという意味の行ではありません。返り値の中身は、資格情報の行を含みうるので印字していません(§14)。

Python API 章の list(ConfigResult) の記述と、本ラボの Day 0 の Guest Shell の str の返り値は、両方を並べ、どちらが正しいとも書きません(§15.7)。


8. ZTP の後の状態(cycle A)

cycle A の待ちの終わりの後、取得スクリプトは WEB1 を踏み台に NEW1 の 10.76.0.100 へ netops で SSH し、閉じた一覧の 18 本の show を撮りました(〔ツール側〕)。NEW1 の show logging の最後の行は、この SSH のログインの行(22:20:44・Source: 10.76.0.10)です。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の SSH の show users は以下のとおりです。

snippet
NEW1# show users
    Line       User       Host(s)              Idle       Location
*  1 vty 0     netops     idle                 00:00:00 10.76.0.10

  Interface    User               Mode         Idle     Peer Address

8.1 startup-config

ZTP の後の show startup-config は、startup-config が無いという表示でした。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の表示は以下のとおりです。

snippet
NEW1# show startup-config
startup-config is not present

配ったスクリプトに保存のコマンドの行は 0 行でした(§7.2)。この run の cycle A と cycle C の ZTP の後の show startup-config(各 cycle で 1 回)は、どちらも startup-config is not present の 1 行でした(cycle C は §9.6)。

資料の側では、AutoInstall 章が、AutoInstall の処理の後に設定を確かめて保存する必要があると書きます。取得した ZTP 章の本文には、スクリプトの後に設定を保存するかを書いた文がありません(save の語は大小を問わず 1 回で、ページの冒頭の操作の欄の Save の語でした。数えた)。

In all cases, you must verify and save the configuration on the networking device after the AutoInstall process is complete. If you do not save the configuration, you must repeat the entire process.

(AutoInstall 章「How to Use AutoInstall to Remotely Configure Cisco Networking Devices」)

8.2 running-config

ZTP の後の running-config には、配ったスクリプトの configurep の行と同じ文字列の行と、IF の DHCP の行と、http・tftp の source-interface の行が在りました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の show running-config の抜粋は以下のとおりです(資格情報の行は取得スクリプトが伏せた形)。

snippet
NEW1# show running-config
Building configuration...

Current configuration : 3878 bytes
!
! Last configuration change at 22:17:40 UTC Fri Oct 30 2026
!
version 17.3
service timestamps debug datetime msec
service timestamps log datetime msec
! Call-home is enabled by Smart-Licensing.
service call-home
platform qfp utilization monitor load 80
platform punt-keepalive disable-kernel-core
platform console serial
!
hostname NEW1
…(省略)
ip domain name lab.local
…(省略)
! [build が伏せた行: username / enable secret]
…(省略)
interface Loopback76
 description ZTP76 A
 ip address 10.76.76.76 255.255.255.255
!
interface GigabitEthernet1
 ip dhcp client client-id ascii cisco-5254.00e8.9b71-Gi1
 ip address dhcp
 negotiation auto
 no mop enabled
 no mop sysid
!
ip forward-protocol nd
ip http server
ip http authentication local
ip http secure-server
ip http client source-interface GigabitEthernet1
!
ip tftp source-interface GigabitEthernet1
ip ssh rsa keypair-name SSH76
ip ssh version 2
…(省略)
line con 0
 stopbits 1
line vty 0 4
 login local
 transport input ssh
…(省略)

running-config の行と、行を入れた主体の書き方は以下のとおりです。主体を書けるのは、show auto install trace に主体の在る行(§5.7 の 14・15 行目の 2 行)が在る行だけです。

running-config の行同じ文字列が在る別の記録(並べるだけ)show auto install trace の主体の行
hostname NEW1配った本文の 1 回目の configurep・コンソールの Line 1 SUCCESS: の行無い
ip domain name lab.local配った本文の 2 回目の configurep・コンソールの 2 回目の 1 行目無い
interface Loopback76・description ZTP76 A・ip address 10.76.76.76 255.255.255.255配った本文の 1 回目の configurep・コンソールの Line 2〜4無い
ip dhcp client client-id ascii cisco-5254.00e8.9b71-Gi1tcpdump の Client-ID・show dhcp lease在る: Configured ip add dhcp client cisco-5254.00e8.9b71-Gi1(22:14:42.601)
ip address dhcp—在る: autoinstall: ip address dhcp configured on GigabitEthernet1(22:14:41.220)
ip http server・ip http authentication local・ip http secure-server—無い
ip http client source-interface GigabitEthernet1・ip tftp source-interface GigabitEthernet1show running-config | section interface GigabitEthernet1 にも出る無い
ip ssh rsa keypair-name SSH76・ip ssh version 2配った本文の 2 回目の configurep・コンソールの Line 3・4無い
line vty 0 4・login local・transport input ssh配った本文の cli.configure の引数(伏せ字の行)無い

表の「無い」の行を、何が入れたかは書きません。ip http client source-interface と ip tftp source-interface の行と、ip http server の系統の行の主体は §14 に置きます。running-config に iox・app-hosting・guestshell の語を含む行は 0 行でした(§8.6)。

8.3 IF の設定と SSH

show running-config の section interface GigabitEthernet1 は、IF の設定の行と、http と tftp の source-interface の行を表示しました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の表示は以下のとおりです。

snippet
NEW1# show running-config | section interface GigabitEthernet1
interface GigabitEthernet1
 ip dhcp client client-id ascii cisco-5254.00e8.9b71-Gi1
 ip address dhcp
 negotiation auto
 no mop enabled
 no mop sysid
ip http client source-interface GigabitEthernet1
ip tftp source-interface GigabitEthernet1

ip address dhcp と ip dhcp client client-id ascii の 2 行は、show auto install trace の 14・15 行目の 2 行(§5.7)と同じ IF の設定です。ZTP の後に WEB1 から netops で SSH のログインが通ったことは、NEW1 の show logging の %SEC_LOGIN-5-LOGIN_SUCCESS の行と、上の show users の vty 0 の行が示します。

8.4 IF と経路

ZTP の後の show ip interface brief は、GigabitEthernet1 と Loopback76 の 2 行で、VirtualPortGroup31 の行は在りませんでした。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の表示は以下のとおりです。

snippet
NEW1# show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
GigabitEthernet1       10.76.0.100     YES DHCP   up                    up
Loopback76             10.76.76.76     YES other  up                    up

スクリプトの中の同じコマンドの出力には、2 回とも VirtualPortGroup31 192.168.2.1 が在りました(§7.4・§7.5)。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の show ip route の抜粋は以下のとおりです。

snippet
NEW1# show ip route
…(省略)
Gateway of last resort is 10.76.0.1 to network 0.0.0.0

S*    0.0.0.0/0 [254/0] via 10.76.0.1
      10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C        10.76.0.0/24 is directly connected, GigabitEthernet1
S        10.76.0.1/32 [254/0] via 10.76.0.1, GigabitEthernet1
L        10.76.0.100/32 is directly connected, GigabitEthernet1
C        10.76.76.76/32 is directly connected, Loopback76

既定経路は S* の [254/0] via 10.76.0.1 で、192.168.2.0/24 の行は 0 行でした(スクリプトの中の show ip route には在った)。

ZTP 章の DHCP サーバの節は、機器が DHCP サーバの渡した既定の経路を使うと書いていました(§2.3)。経路の行と資料の文は並べるだけにします。

8.5 guest-share に残ったファイル

ZTP の後の dir bootflash:guest-share/ には、downloaded_script.py と印のファイルが在りました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の表示は以下のとおりです。

snippet
NEW1# dir bootflash:guest-share/
Directory of bootflash:guest-share/

88707   -rw-               12  Oct 30 2026 22:17:21 +00:00  ztp76-ran-A.txt
88706   -rw-             1760  Oct 30 2026 22:14:54 +00:00  downloaded_script.py

6286540800 bytes total (5436022784 bytes free)

downloaded_script.py の大きさは 1760 で、時刻は 22:14:54 です。印のファイル ztp76-ran-A.txt は 12 バイトで、時刻は 22:17:21 です。downloaded_script.py の中身は撮っていません。dir bootflash: には、.day0gs_vpgt と .day0gs_configured(どちらも大きさ 0・22:17:12)・pnp-tech・SHARED-IOX などの名前の行も在りました。名前だけを並べ、何が作ったかは書きません。

8.6 Guest Shell と IOx

ZTP の後の show app-hosting list は、アプリケーションが無いという表示でした。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の表示は以下のとおりです。

snippet
NEW1# show app-hosting list
No App found

資料の側では、ZTP 章の概要が、初期のプロビジョニングが終わった後も Guest Shell は有効のままと書いていました(§2.2)。同じ章のブートログの見本は、見出しの版の範囲によって destroyed の行の有無が違います。見出しが 16.12.x〜17.1.x と 17.2.x 以降の節の見本は、Execution Complete の後に destroyed の行を出し、ISR4451-X/K9 の見本(版の記載なし)と C9300-48UXM・16.9.4 のログは destroyed の行を出さずに Press RETURN の行を出します。

*** ZTP Day0 Python Script Execution Complete *** Guestshell destroyed successfully

*** ZTP Day0 Python Script Execution Complete *** Guestshell destroyed successfully Press RETURN to get started!

(ZTP 章「Cisco IOS XE Gibraltar 16.12.x to Cisco IOS XE Amsterdam 17.1.x」)

*** ZTP Day0 Python Script Execution Complete *** Press RETURN to get started!

(ZTP 章のブートログの見本・ISR4451-X/K9 と C9300-48UXM・16.9.4)

本ラボのこの run の cycle A では、スクリプトの中の show app-hosting list の出力は day0guestshell が RUNNING でした(§7.4)。cycle A と cycle C は、コンソールの記録に Guestshell destroyed successfully の行が在り、ZTP の後の show app-hosting list は No App found でした。資料の概要の文と、本ラボの表示の両方を並べ、どちらが正しいとも書きません。

ZTP の後の show iox-service は、CAF と IOxman が Running でした。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の表示は以下のとおりです。

snippet
NEW1# show iox-service

IOx Infrastructure Summary:
---------------------------
IOx service (CAF) 1.11.0.7     : Running
IOx service (HA)               : Not Supported
IOx service (IOxman)           : Running
IOx service (Sec storage)      : Not Supported
Libvirtd 1.3.4                 : Running

running-config の iox・app-hosting・guestshell の行は 0 行でした。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の show running-config の include の表示は以下のとおりで、ヘッダの行の後は空行だけです。

snippet
NEW1# show running-config | include ^iox|app-hosting|guestshell

資料の側では、ZTP 章の冒頭が ZTP の機能は設定が要らないと書く(§2.2)一方で、Guest Shell 章は guestshell enable の前に IOx を設定する必要があると書き、Guest Shell を有効にして動かすには application か management の IF の設定も要ると書きます。ZTP 章の C9300-48UXM・16.6.5 のログ(見出しは 16.6.x〜16.8.x)は、[IOX DEBUG] の行で iox の機能を自動で設定するという行を出します。

IOx must be configured before the guestshell enable command is used.

(Guest Shell 章「Enabling and Running the Guest Shell」)

An application or management interface must also be configured to enable and operate Guest Shell.

(Guest Shell 章「Managing the Guest Shell」)

*Sep 4 20:36:19.562: [IOX DEBUG] Auto-configuring iox feature

(ZTP 章「Cisco IOS XE Everest 16.6.x to Cisco IOS XE Fuji 16.8.x」)

ZTP 章の文は ZTP の機能の文、Guest Shell 章の 2 文は guestshell enable と Guest Shell の手順の前提の文で、対象の違う文として並べます。

本ラボの NEW1 の show logging には、Server iox has been notified to start の行(22:14:23.819)と IOX is ready の行(22:16:48.615)が在り、running-config に iox の行はありませんでした。設定の行が無いまま IOx が Running だったことの理由は撮っていません。

8.7 CONFIG_P の主体

NEW1 の show logging の %SYS-5-CONFIG_P の行は 17 行で、主体(process の後の語)は 3 種類でした(数えた)。

主体(process の後)行の数as の語NEW1 の時刻
DHCP Autoinstall11vty0(4 行)・console(7 行)22:14:41.215〜22:14:42.594(vty0)・22:14:54.865〜22:17:40.657(console)
PnP Agent Discovery3vty022:17:24.756・22:17:24.835・22:17:25.061
iosp_vty_100001_6AE5176AAB55FC619C000001_fd_1773vty11622:17:23.939・22:17:25.239・22:17:25.355

7-4 §8.2 では、Guest Shell の中の cli モジュールの設定変更の記録の user@line が netops@vty116 でした。上の表の CONFIG_P の行は、主体と as の語と時刻を並べるだけで、どの行がどの設定に当たるかは結び付けません。

8.8 pnp_python の profile

ZTP の後の show pnp profile には、pnp_python という profile が載り、作った主体の表示は pname=DHCP Autoinstall でした。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の show pnp profile の抜粋は以下のとおりです。

snippet
NEW1# show pnp profile
PnP Profiles: Active:1, Created:1, Deleted:0, Hidden:1

first-profile-created-name=[pnp_python] by:[pid=664, pname=DHCP Autoinstall, time=22:17:12 UTC Fri Oct 30 2026])
last-profile-created-name=[pnp_python] by:[pid=664, pname=DHCP Autoinstall, time=22:17:12 UTC Fri Oct 30 2026]
last-profile-deleted-name=[-] by:[-]

Name            CBType Node     Primary-Path           Primary-Trans  Backup-Trans
pnp_python      User   hidden   /pnp_python            HTTP           none


Listener Profile pnp_python: 0 open connections: 0 closing connections
…(省略)
	Listening via http
  Listening to path /pnp_python.  Max Idle 0 ms.  Accepting post on plaintext connections.
  Established at *22:17:12.625 UTC Fri Oct 30 2026
…(省略)

7-4 と 7-5 の機器にも、同じ名前の profile が載っていました。3 つの節の first-profile-created-name の行の by: の表示を、逐語で並べます。

節first-profile-created-name の行
7-4 §8.3(最初の guestshell run の後)first-profile-created-name=[pnp_python] by:[pid=19, pname=SSH Process, time=05:27:38 UTC Mon Oct 19 2026])
7-5 §3.3(最初の Guest Shell の操作の直後の、最初の show pnp profile)first-profile-created-name=[pnp_python] by:[pid=293, pname=SSH Process, time=16:38:40 UTC Mon Oct 26 2026])
7-6 cycle A(ZTP の後)first-profile-created-name=[pnp_python] by:[pid=664, pname=DHCP Autoinstall, time=22:17:12 UTC Fri Oct 30 2026])
7-6 cycle C(ZTP の後)first-profile-created-name=[pnp_python] by:[pid=664, pname=DHCP Autoinstall, time=22:49:28 UTC Fri Oct 30 2026])

7-5 §3.3 は、この profile が何のためのものかと、最初の Guest Shell の操作の前に在ったかを撮っていないと書いていました。本ラボも、pnp_python が何のための profile かは撮っていません(§14)。pid の番号どうしは比べません。

取得した出典の 12 本に、pnp_python の文字列は 0 件でした(数えた)。PnP の本の Cloud Redirection の節の profile の見本(§13.1)は、この profile の説明には使いません。

8.9 show pnp trace

NEW1 の show pnp trace は、行頭に NEW1 の時計の時刻を持つ 374 行の記録で、末尾の表示は 374 entries printed です。取得の記録の行番号は、この 374 行のほかに、見出しの行・空行・字下げの続きの行・末尾の表示の行も数えた番号です。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle A の後の show pnp trace の抜粋は以下のとおりです。

snippet
NEW1# show pnp trace
…(省略)
[10/30/26 22:14:16.089 UTC 1 3] Non-redundancy mode (0) after 1 retries.
[10/30/26 22:14:16.093 UTC 2 3] Info: Checking if PnP discovery should start
[10/30/26 22:14:16.093 UTC 3 3] Device is in Autonomous mode
[10/30/26 22:14:16.093 UTC 4 3] Device is in Autonomous mode
[10/30/26 22:14:16.093 UTC 5 3] Info: PnP discovery process is not running
[10/30/26 22:14:16.094 UTC 6 3] Info: Started PnP Discovery Process, pid=591
[10/30/26 22:14:16.094 UTC 7 3] 1 _paati.info: _xmastt.info (1) 16. PnP Subsystem Init PT: 5 ms, FirstPT: 5 ms, LastPT: 0 ms, Notified:1, Annotation:[pid=3, pname=Init, time=22:14:16 UTC Fri Oct 30 2026]
[10/30/26 22:14:16.094 UTC 8 3] 1 _psi.info: System Subsystem Init (PT=5).
[10/30/26 22:14:18.007 UTC 9 591] 2 _paati.info: _xmastt.info (2) 17. PnP Discovery Start PT: 1918 ms, FirstPT: 1918 ms, LastPT: 0 ms, Notified:1, Annotation:[pid=591, pname=PnP Agent Discovery, time=22:14:18 UTC Fri Oct 30 2026]
[10/30/26 22:14:18.007 UTC A 591] 1 _spd.info: System PnP Discovery Start (PT=1918).
[10/30/26 22:14:18.008 UTC B 591] 1 _pbnbi.info: [PnP Discovery Manager] inited
[10/30/26 22:14:18.008 UTC C 591] No platform. No wait
[10/30/26 22:14:18.008 UTC D 591] 1 _pbnbs.info: [PnP Discovery Manager] started
[10/30/26 22:14:18.012 UTC E 591] 2 _pisce.wAr.moe: nvram:/startup-config missing or empty
[10/30/26 22:14:18.012 UTC F 591] Platform discovery not required
[10/30/26 22:14:18.012 UTC 10 591] 1 spd.drc: PnP Discovery trial number[1]
[10/30/26 22:14:18.012 UTC 11 591] WebUI: Not supported on platform
[10/30/26 22:14:18.012 UTC 12 591] 1 spd.idm: Initiating PnP discovery manager
[10/30/26 22:14:18.012 UTC 13 591] Info: PNP discovery reqd - DHCP Reqd:1
…(省略)
[10/30/26 22:14:19.255 UTC 2A 591] 1.0 _pdm.inf: no ipv4 idb, skipping PnP DHCP ipv4 Discovery
[10/30/26 22:14:19.261 UTC 2B 591] 1.1 _pdm.inf: no ipv6 idb, skipping PnP DHCP ipv6 Discovery
[10/30/26 22:14:19.261 UTC 2C 591] 1.2 _pdm.inf: no ipv4 idb, skipping PnP DNS ipv4 Discovery
[10/30/26 22:14:19.261 UTC 2D 591] 1.3 _pdm.inf: no ipv6 idb, skipping PnP DNS ipv6 Discovery
[10/30/26 22:14:19.261 UTC 2E 591] 1.4 _pdm.inf: no ipv4 idb, skipping PnP CCO ipv4 Discovery
[10/30/26 22:14:19.262 UTC 2F 591] 1.5 _pdm.inf: no ipv6 idb, skipping PnP CCO ipv6 Discovery
[10/30/26 22:14:19.262 UTC 30 591] 1.6 _pdm.inf: no ipv4 idb, skipping PnP VBOND ONPREM ZTP IPv4 Discovery
[10/30/26 22:14:19.262 UTC 31 591] 1.7 _pdm.inf: no ipv6 idb, skipping PnP VBOND ONPREM ZTP IPv6 Discovery
[10/30/26 22:14:19.262 UTC 32 591] Info: PnP profile configuration was unsuccessful
[10/30/26 22:14:19.262 UTC 33 591] CLEAN UP VRF
[10/30/26 22:14:19.262 UTC 34 591] 1 _pdcr.def: PnP discovery failed on 9
[10/30/26 22:14:19.267 UTC 35 591] 1 _pbnbs.info: [PnP Discovery Manager] stopped, reason:[Discovery Failed]
…(省略)
[10/30/26 22:14:50.722 UTC 7C 591] 1 _pddio.err.pro: no op43 discovered
[10/30/26 22:14:50.722 UTC 7D 591] cant discover via dhcp ipv4 op43
[10/30/26 22:14:50.722 UTC 7E 591] 1 _pdh4d.wAr.fin: PnP DHCP ipv4 discovery not successful
[10/30/26 22:14:52.722 UTC 7F 591] 4.1 _pdm.inf: no ipv6 idb, skipping PnP DHCP ipv6 Discovery
[10/30/26 22:14:52.722 UTC 80 591] 1 _pd4d.info: Starting PnP DNS ipv4 discovery
[10/30/26 22:14:52.722 UTC 81 591] CLEAN UP VRF
[10/30/26 22:14:52.722 UTC 82 591] 1 _pddd.info: Domain Name [-] on Interface [GigabitEthernet1]
[10/30/26 22:14:52.722 UTC 83 591] 1 _pddd.wAr.dna: cant obtain good domain name from any interface
[10/30/26 22:14:52.722 UTC 84 591] 1 _pd4d.wAr.fin: PnP DNS ipv4 discovery not successful
…(省略)
[10/30/26 22:14:58.096 UTC 95 591] 1 _pcraci.wAr.psr: pnp_server not resolved
[10/30/26 22:14:58.096 UTC 96 591] 2 _pcdd.eRr.rai: Hostname resolution failed
[10/30/26 22:14:58.097 UTC 97 591] 1 _pc4d.don: PnP CCO ipv4 discovery not successful
…(省略)
[10/30/26 22:17:24.469 UTC 162 591] 36 _pmaocwi.uec: User has entered console. Not retrying PnP.
[10/30/26 22:17:24.469 UTC 163 591] Info: PnP profile configuration was unsuccessful
[10/30/26 22:17:24.469 UTC 164 591] CLEAN UP VRF
[10/30/26 22:17:24.469 UTC 165 591] 10 _pdcr.acw: PnP discovery aborted by config wizard
[10/30/26 22:17:24.469 UTC 166 591] 1 spd.dle: PnP Discovery Loop exited on 1.10th run
…(省略)

この run の cycle A の後の show pnp trace(行頭に時刻を持つ 374 行)に、PnP Discovery trial number[ の行は 10 行、no op43 discovered の行は 7 行、Starting PnP DNS ipv4 discovery と Starting PnP CCO ipv4 discovery の行は 6 行ずつ、pnp_server not resolved の行は 6 行在りました(数えた)。取得の記録の 18 行目の nvram:/startup-config missing or empty は、Day 0 の証拠にしない行です(§15.3)。取得の記録の 374 行目(記録の最後の行ではありません)は User has entered console を含む行ですが、取得スクリプトは NEW1 のコンソールに入力していません(〔ツール側〕)。この行が何を指すかは撮っていません。show pnp trace の各行の内部の語(_pbnbs.info など)と PnP discovery failed on 9 の 9 の意味は書きません。


9. TFTP での配布(cycle C)

9.1 資料の option 150 と tftp-server

ZTP 章は、option 150 を、Python のスクリプトを置く HTTP か TFTP のサーバの IP アドレスの一覧と書いていました(§2.3)。AutoInstall 章は、TFTP サーバが無い時は Cisco IOS のルータを TFTP サーバにできると書きます。

If you do not have a TFTP server available you can configure a Cisco IOS-based router as a TFTP server using the tftp-server file-system :filename command.

(AutoInstall 章「Storage and Transmission of Configuration Files」)

ZTP 章の C9300-48UXM・16.6.5 のログ(見出しは 16.6.x〜16.8.x)は、option 150 で TFTP サーバのアドレスを得た行と、PNPA の行を並べます。

*Sep 4 20:35:43.511: AUTOINSTALL: Obtain tftp server address (opt 150) 159.14.27.2 *Sep 4 20:35:43.511: PNPA: Setting autoinstall complete to true for 159.14.27.2

(ZTP 章「Cisco IOS XE Everest 16.6.x to Cisco IOS XE Fuji 16.8.x」)

9.2 SRV1 の準備と pool

cycle C の前に、取得スクリプトは SRV1 の bootflash に ztp76c.py を copy し、verify /md5 の値を WSL の md5 と照合してから、tftp-server を入れました(〔ツール側〕判定メモは一致)。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の copy は以下のとおりです。

snippet
SRV1# copy http://10.76.0.10:8000/ztp76c.py bootflash:ztp76c.py
Accessing http://10.76.0.10:8000/ztp76c.py...
Loading http://10.76.0.10:8000/ztp76c.py
1760 bytes copied in 0.016 secs (110000 bytes/sec)

SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の verify /md5 は以下のとおりです。

snippet
SRV1# verify /md5 bootflash:ztp76c.py
.Done!
verify /md5 (bootflash:ztp76c.py) = bca2db13ed2dc413b3188db12cc3b79e

copy の後、WEB1 の ~/ztp/ztp76c.py は ~/ztp-used/ へ退避し、cycle C の間に WEB1 の :8000 の受け手が ztp76c.py を配れない形にしました(〔ツール側〕test ! -e の確かめは 0)。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の tftp-server の投入のエコーは以下のとおりです。

snippet
configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
SRV1(config)#tftp-server bootflash:ztp76c.py
SRV1(config)#end
SRV1#

SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の cycle C の pool の投入のエコーは以下のとおりです。

snippet
configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
SRV1(config)#ip dhcp pool ZTP76
SRV1(dhcp-config)# option 150 ip 10.76.0.1
SRV1(dhcp-config)# option 67 ascii ztp76c.py
SRV1(dhcp-config)#end
SRV1#

SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の投入の後の pool は以下のとおりです。

snippet
SRV1# show running-config | section ip dhcp pool
ip dhcp pool ZTP76
 network 10.76.0.0 255.255.255.0
 default-router 10.76.0.1
 option 67 ascii ztp76c.py
 option 150 ip 10.76.0.1

投入した順(option 150 → option 67)と、running-config の表示の順(option 67 → option 150)が違いました。option 67 の値は URL ではなく、ファイル名の ztp76c.py だけです。

9.3 NEW1 のコンソールの記録

cycle C の NEW1 は、option 67 のファイル名と option 150 のアドレスを 2 項目で印字し、tftp://10.76.0.1/ztp76c.py を取りに行くという行を出しました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle C のコンソールの記録の 147〜175 行目は以下のとおりです。

snippet
…(省略)
Acquired IPv4 address 10.76.0.102 on Interface GigabitEthernet1
Received following DHCPv4 options:
        bootfile        : ztp76c.py
        tftp-server-ip  : 10.76.0.1

OK to enter CLI now...

pnp-discovery can be monitored without entering enable mode

Entering enable mode will stop pnp-discovery

Attempting bootfile tftp://10.76.0.1/ztp76c.py
day0guestshell activated successfully
Current state is: ACTIVATED
day0guestshell started successfully
Current state is: RUNNING
Guestshell enabled successfully


 *** ZTP76 START C ***


ZTP76 python 3.6.8 (default, Nov 21 2019, 19:31:34)  [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)]
ZTP76 executable /usr/bin/python3
ZTP76 argv ['/bootflash/guest-share/downloaded_script.py']
ZTP76 file /bootflash/guest-share/downloaded_script.py
ZTP76 cwd /home/guestshell
ZTP76 marker written /bootflash/guest-share
ZTP76 marker written /flash/guest-share
…(省略)

Attempting bootfile の URL の tftp://10.76.0.1/ztp76c.py は、その前の行の tftp-server-ip : 10.76.0.1 と bootfile : ztp76c.py の値と同じ文字を含みます。URL がどこで組み立てられたかは書きません。cycle C のコンソールの記録に Loading を含む行は 0 行でした(cycle A は 2 行・cycle B は 6 行)。day0guestshell の行は activated → RUNNING → enabled の順で、installed successfully の行は 0 行でした。

スクリプトの印字は cycle A と同じ文言で、Python の版は 3.6.8・印のファイルは 2 か所に書けました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle C のコンソールの記録の 264〜292 行目は以下のとおりです。

snippet
…(省略)
ZTP76 access lines ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng ng
ZTP76 access result str 234 str None
Interface              IP-Address      OK? Method Status                Protocol
GigabitEthernet1       10.76.0.102     YES DHCP   up                    up
Loopback76             10.76.76.76     YES other  up                    up
VirtualPortGroup31     192.168.2.1     YES TFTP   up                    up



 *** ZTP76 END C ***



Guestshell destroyed successfully
Script execution success!



Press RETURN to get started!


*Oct 30 22:50:03.472: %CRYPTO_ENGINE-5-KEY_ADDITION: A key named TP-self-signed-1337980579 has been generated or imported by crypto-engine
*Oct 30 22:50:03.575: %PKI-4-NOCONFIGAUTOSAVE: Configuration was modified.  Issue "write memory" to save new IOS PKI configuration
*Oct 30 22:50:03.578: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as vty0
*Oct 30 22:50:04.413: %SYS-5-CONFIG_P: Configured programmatically by process PnP Agent Discovery from console as vty0
*Oct 30 22:50:04.440: %SYS-5-CONFIG_P: Configured programmatically by process PnP Agent Discovery from console as vty0
*Oct 30 22:50:04.664: %SYS-5-CONFIG_P: Configured programmatically by process PnP Agent Discovery from console as vty0
*Oct 30 22:50:04.769: %PNP-6-PNP_TECH_SUMMARY_SAVED_OK: PnP tech summary (/pnp-tech/pnp-tech-discovery-summary) saved successfully (elapsed time: 21 seconds).
*Oct 30 22:50:04.770: %PNP-6-PNP_DISCOVERY_STOPPED: PnP Discovery stopped (Config Wizard)

cycle C の ZTP76 access result の行も str 234 str None でした。cycle A と違い、Guestshell destroyed successfully(277 行目)と Script execution success!(278 行目)はそれぞれ単独の行で、その後に Press RETURN to get started!(282 行目)と syslog の 8 行が続きました。

9.4 SRV1 の TFTP の記録

SRV1 の debug tftp events は、ztp76c.py を探し・開き・終えた 3 行の組を 4 組残しました。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の cycle C の後の show logging の抜粋は以下のとおりです。

snippet
SRV1# show logging
…(省略)
*Oct 30 22:48:10.079: TFTP: Looking for ztp76c.py
*Oct 30 22:48:10.080: TFTP: Opened bootflash:ztp76c.py, fd 10, size 1760 for process 19
*Oct 30 22:48:10.086: TFTP: Finished bootflash:ztp76c.py, time 00:00:00 for process 19
*Oct 30 22:48:10.087: TFTP: Looking for ztp76c.py
*Oct 30 22:48:10.089: TFTP: Opened bootflash:ztp76c.py, fd 11, size 1760 for process 534
*Oct 30 22:48:10.093: TFTP: Finished bootflash:ztp76c.py, time 00:00:00 for process 534
*Oct 30 22:48:10.096: TFTP: Looking for ztp76c.py
*Oct 30 22:48:10.097: TFTP: Opened bootflash:ztp76c.py, fd 10, size 1760 for process 19
*Oct 30 22:48:10.102: TFTP: Finished bootflash:ztp76c.py, time 00:00:00 for process 19
*Oct 30 22:48:10.103: TFTP: Looking for ztp76c.py
*Oct 30 22:48:10.105: TFTP: Opened bootflash:ztp76c.py, fd 10, size 1760 for process 534
*Oct 30 22:48:10.110: TFTP: Finished bootflash:ztp76c.py, time 00:00:00 for process 534
…(省略)

この run の cycle C の後の SRV1 の show logging に、TFTP: の行は 12 行在り、Looking for ztp76c.py・Opened bootflash:ztp76c.py・Finished bootflash:ztp76c.py の 3 行の組が 4 組でした(数えた)。行頭の時刻は 22:48:10.079〜22:48:10.110(SRV1 の時計)でした。4 組とも Opened の行は size 1760 を持ち、copy の大きさと同じ数です。process 19 と process 534、fd 10 と fd 11 の意味は書きません。

同じ 12 行に、送り元の IP アドレスを持つ行は 0 行でした(数えた)。4 組が NEW1 の何回の要求かは撮れていません。NEW1 のコンソールの Attempting bootfile は 1 行、NEW1 の show logging の PNP_SCRIPT_STARTED は 1 行で、4 組との対応は書きません。

この run の cycle C の WEB1 の tcpdump(NEW1 の start の前の起動から待ちの後の停止まで・38 パケット)に、udp 69 の行・RRQ の行・tcp 8000 の行は 0 行でした。NEW1 から SRV1 への unicast は WEB1 の視野の外です。〔ツール側〕同じ tcpdump の SRV1 の Offer は以下のとおりです。

snippet
$ cat ~/tcpdump-C.txt
…(省略)
22:47:29.783194 52:54:00:e9:b9:d2 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 353: (tos 0x0, ttl 255, id 5, offset 0, flags [none], proto UDP (17), length 339)
    10.76.0.1.67 > 255.255.255.255.68: [udp sum ok] BOOTP/DHCP, Reply, length 311, xid 0xcd3, Flags [Broadcast] (0x8000)
	  Your-IP 10.76.0.102
	  Client-Ethernet-Address 52:54:00:0c:bc:15
	  Vendor-rfc1048 Extensions
	    Magic Cookie 0x63825363
	    DHCP-Message (53), length 1: Offer
	    Client-ID (61), length 12: "9F8FO8YFAAK"
	    Server-ID (54), length 4: 10.76.0.1
	    Lease-Time (51), length 4: 86400
	    RN (58), length 4: 43200
	    RB (59), length 4: 75600
	    Subnet-Mask (1), length 4: 255.255.255.0
	    Default-Gateway (3), length 4: 10.76.0.1
	    BF (67), length 9: "ztp76c.py"
	    TFTP-Server-Address (150), length 4: 10.76.0.1
	    END (255), length 0
…(省略)

cycle C の Offer と ACK は、BF (67), length 9: "ztp76c.py" と TFTP-Server-Address (150), length 4: 10.76.0.1 の 2 つの option を持ちました。cycle A の Offer に option 150 の値の行は在りませんでした(§6.2)。

9.5 NEW1 の show logging と show auto install trace

cycle C の NEW1 の show logging には、cycle A の show logging に無い 2 行(option 150 の TFTP サーバのアドレスを得た行と、PNPA の行)が在りました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle C の後の show logging の抜粋は以下のとおりです。

snippet
NEW1# show logging
…(省略)
*Oct 30 22:47:44.843: %SYS-5-CONFIG_P: Configured programmatically by process DHCP Autoinstall from console as vty0
*Oct 30 22:47:52.386: %PNP-3-PNP_DOMAIN_NAME_NOT_FOUND: Domain name not found (1/10) on (GigabitEthernet1) by (pid=591, pname=PnP Agent Discovery, time=22:47:52 UTC Fri Oct 30 2026)
*Oct 30 22:47:54.973: AUTOINSTALL: Obtain tftp server address (opt 150) 10.76.0.1
*Oct 30 22:47:54.973: PNPA: Setting autoinstall complete to true for 10.76.0.1
*Oct 30 22:47:56.387: %PNP-3-PNP_DOMAIN_NAME_NOT_FOUND: Domain name not found (2/10) on (GigabitEthernet1) by (pid=591, pname=PnP Agent Discovery, time=22:47:56 UTC Fri Oct 30 2026)
…(省略)

74・75 行目の文言は、ZTP 章の C9300-48UXM・16.6.5 のログ(§9.1)の 2 行と、アドレスの部分のほかは同じ形です。

NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle C の後の show auto install trace の抜粋は以下のとおりです。

snippet
NEW1# show auto install trace
…(省略)
[10/30/26 22:47:44.025 UTC A 664] Received following DHCP options:
[10/30/26 22:47:44.026 UTC B 664]         bootfile        : ztp76c.py
[10/30/26 22:47:44.026 UTC C 664]         tftp-server-ip  : 10.76.0.1
[10/30/26 22:47:44.026 UTC D 664] Autoinstall: resolved ipv4 for Gi1 is 10.76.0.102
[10/30/26 22:47:44.827 UTC E 664] autoinstall: ip address dhcp configured on GigabitEthernet1
[10/30/26 22:47:44.843 UTC F 664] Configured ip add dhcp client 9F8FO8YFAAK
…(省略)
[10/30/26 22:47:54.972 UTC 14 664] autoinstall:boot file retrieved from DHCPC ztp76c.py
…(省略)

cycle C の boot file retrieved from DHCPC の値は、ファイル名の ztp76c.py でした(cycle A は URL の丸ごと)。NEW1 の時計で、PNP_SCRIPT_STARTED(22:48:10.143)から PNP_PYTHON_SCRIPT_DONE(22:50:01.075)までは 110.932 秒でした(計算した値)。cycle C の show logging には %IM-6-IOX_INST_INFO の行が 1 行在り(cycle A は 0 行)、行の中の日時は 09/30/2026 22:49:27 で、行頭の日付の Oct 30 と月が違います(§15.9)。cycle A と cycle C の show logging の行の有無と件数の差の理由は撮っていません。

9.6 受け手の記録と、配り終えたもの

〔ツール側〕cycle C の後に読んだ :8000 の受け手の記録は以下のとおりです。

snippet
$ cat ~/http-8000.log
10.76.0.10 - - [30/Oct/2026 22:11:21] "GET /ztp76a.py HTTP/1.1" 200 -
10.76.0.100 - - [30/Oct/2026 22:14:53] "GET /ztp76a.py HTTP/1.1" 200 -
10.76.0.100 - - [30/Oct/2026 22:14:53] "GET /ztp76a.py HTTP/1.1" 200 -
10.76.0.101 - - [30/Oct/2026 22:26:13] "GET /doc_sample.py HTTP/1.1" 200 -
10.76.0.101 - - [30/Oct/2026 22:26:13] "GET /doc_sample.py HTTP/1.1" 200 -
10.76.0.101 - - [30/Oct/2026 22:28:06] "GET /doc_sample.py HTTP/1.1" 200 -
10.76.0.101 - - [30/Oct/2026 22:28:06] "GET /doc_sample.py HTTP/1.1" 200 -
10.76.0.101 - - [30/Oct/2026 22:31:39] "GET /doc_sample.py HTTP/1.1" 200 -
10.76.0.101 - - [30/Oct/2026 22:31:39] "GET /doc_sample.py HTTP/1.1" 200 -
10.76.0.1 - - [30/Oct/2026 22:43:58] "GET /ztp76c.py HTTP/1.1" 200 -
10.76.0.1 - - [30/Oct/2026 22:43:58] "GET /ztp76c.py HTTP/1.1" 200 -

cycle C の後の記録で、前の cat(cycle B の後)に無かった行は 11・12 行目の 2 行で、送り元は 10.76.0.1(SRV1)です。SRV1 の copy のコマンドは 1 本で、送り元 10.76.0.1 の行は 2 行でした。2 つの数を並べるだけにします。この run の cycle C の :8000 の受け手の記録(cycle B の後の cat から cycle C の後の cat まで)に、送り元が WEB1 と SRV1 でない要求の行は 0 行です。

cycle C の後の SSH の show でも、startup-config is not present・No App found・IOx service (CAF) 1.11.0.7 : Running・guest-share の downloaded_script.py(1760)と ztp76-ran-C.txt(12)が在りました。running-config の client-id の値は 9F8FO8YFAAK で(cycle A は cisco-5254.00e8.9b71-Gi1)、crypto pki trustpoint TP-self-signed-1337980579 のブロックと line con 0 の exec-timeout 0 0 は cycle C の running-config にだけ在りました。差の理由は撮っていません。

cycle C の後、取得スクリプトは SRV1 の tftp-server の行を外しました。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の外す前の件数は以下のとおりです。

snippet
SRV1# show running-config | count tftp-server
Number of lines which match regexp = 1

SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の投入のエコーは以下のとおりです。

snippet
configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
SRV1(config)#no tftp-server bootflash:ztp76c.py
SRV1(config)#end
SRV1#

SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の外した後の件数は以下のとおりです。

snippet
SRV1# show running-config | count tftp-server
Number of lines which match regexp = 0

10. 資料の見本のスクリプトと試みの数(cycle B)

10.1 資料の見本のスクリプト

ZTP 章は、HTTP と TFTP のどちらのサーバからでも使えるとする見本のスクリプトを載せています(見本の機種と版の記載なし)。見本の 1 行目は、print を括弧の無い形で書きます。

The following is a sample Python script can be used from either an HTTP or a TFTP server:

print “\n\n *** Sample ZTP Day0 Python Script *** \n\n”

(ZTP 章「Sample Python Provisioning Script」)

本ラボは、見本のスクリプトを WEB1 の ~/ztp/doc_sample.py に写して、cycle B で配りました。〔ツール側〕WEB1 の doc_sample.py の cat は以下のとおりです(685 バイト)。

snippet
$ cat ~/ztp/doc_sample.py
print "\n\n *** Sample ZTP Day0 Python Script *** \n\n"

# Importing cli module
import cli


print "\n\n *** Executing show platform  *** \n\n"
cli_command = "show platform"
cli.executep(cli_command)

print "\n\n *** Executing show version *** \n\n"
cli_command = "show version"
cli.executep(cli_command)

print "\n\n *** Configuring a Loopback Interface *** \n\n"
cli.configurep(["interface loop 100", "ip address 10.10.10.10 255.255.255.255", "end"])


print "\n\n *** Executing show ip interface brief  *** \n\n"
cli_command = "sh ip int brief"
cli.executep(cli_command)

print "\n\n *** ZTP Day0 Python Script Execution Complete *** \n\n"

〔ツール側〕WEB1 の doc_sample.py(見本の写し)の print は、6 か所とも括弧の無い形です(数えた)。

Guest Shell 章は 17.3.1 以降は Python 3 だけを支えると書いていました(§7.1)。見本の print の形と Guest Shell 章のこの文は、対象の違う文として並べます。

7-5 §15.10 は EEM Python Module 章の別の見本(print が括弧の無い形)と Python 3.6.8 を並べただけで、本ラボは ZTP 章の見本を Day 0 の Guest Shell で走らせたところを撮りました。

10.2 pool

cycle B の pool は、option 67 を doc_sample.py の URL に替えた形です。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の投入のエコーは以下のとおりです。

snippet
configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
SRV1(config)#ip dhcp pool ZTP76
SRV1(dhcp-config)# option 67 ascii http://10.76.0.10:8000/doc_sample.py
SRV1(dhcp-config)#end
SRV1#

10.3 NEW1 のコンソールの記録

cycle B の待ちは、取得スクリプトの設計で固定の 1200 秒でした(〔ツール側〕SyntaxError の行を見ても待ちを切らない)。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle B のコンソールの記録の 144〜201 行目は以下のとおりです。

snippet
…(省略)
         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]:
Acquired IPv4 address 10.76.0.101 on Interface GigabitEthernet1
Received following DHCPv4 options:
        bootfile        : http://10.76.0.10:8000/doc_sample.py

OK to enter CLI now...

pnp-discovery can be monitored without entering enable mode

Entering enable mode will stop pnp-discovery

Attempting bootfile http://10.76.0.10:8000/doc_sample.py

Loading http://10.76.0.10:8000/doc_sample.py
Loading http://10.76.0.10:8000/doc_sample.py day0guestshell activated successfully
Current state is: ACTIVATED
day0guestshell started successfully
Current state is: RUNNING
Guestshell enabled successfully
  File "/bootflash/guest-share/downloaded_script.py", line 1
    print "\n\n *** Sample ZTP Day0 Python Script *** \n\n"
                                                          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("\n\n *** Sample ZTP Day0 Python Script *** \n\n")?

Guestshell destroyed successfully

Loading http://10.76.0.10:8000/doc_sample.py
Loading http://10.76.0.10:8000/doc_sample.py day0guestshell installed successfully
Current state is: DEPLOYED
day0guestshell activated successfully
Current state is: ACTIVATED
day0guestshell started successfully
Current state is: RUNNING
Guestshell enabled successfully
  File "/bootflash/guest-share/downloaded_script.py", line 1
    print "\n\n *** Sample ZTP Day0 Python Script *** \n\n"
                                                          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("\n\n *** Sample ZTP Day0 Python Script *** \n\n")?

Guestshell destroyed successfully

Loading http://10.76.0.10:8000/doc_sample.py
Loading http://10.76.0.10:8000/doc_sample.py day0guestshell installed successfully
Current state is: DEPLOYED
day0guestshell activated successfully
Current state is: ACTIVATED
day0guestshell started successfully
Current state is: RUNNING
Guestshell enabled successfully
  File "/bootflash/guest-share/downloaded_script.py", line 1
    print "\n\n *** Sample ZTP Day0 Python Script *** \n\n"
                                                          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("\n\n *** Sample ZTP Day0 Python Script *** \n\n")?

Guestshell destroyed successfully
Script execution failed for http://10.76.0.10:8000/doc_sample.py

試みの数は、コンソールの記録の File "/bootflash/guest-share/downloaded_script.py", line 1 の行の数で数えます。この run の cycle B の NEW1 のコンソールの記録(start から 1210 秒の読み)に、この行は 3 行(165・180・195 行目)在り、試みの数は 3 回、取り直しは 2 回でした。SyntaxError: Missing parentheses in call to 'print' の行も 3 行で、どの行も見本の 1 行目の print を引いています。見本の 2 行目以降の print の文字列(Executing show platform など)は、コンソールの記録に 0 行でした(数えた)。

3 回の並びは以下のとおりです(コンソールの記録の行番号の順)。

行の種類1 回目2 回目3 回目
Loading の行159・160172・173187・188
installed successfully無い(160 行目は Loading の行の末尾の activated successfully)173 行目の末尾188 行目の末尾
Current state is: DEPLOYED無い174189
Current state is: RUNNING163178193
Guestshell enabled successfully164179194
File "…downloaded_script.py", line 1165180195
SyntaxError168183198
Guestshell destroyed successfully170185200

3 回目の destroyed の行の次の 201 行目は Script execution failed for http://10.76.0.10:8000/doc_sample.py で、この行の後、記録の終わりまで印字された行は 0 行でした。Script execution success の行は 0 行です。cycle B の記録に、installed successfully の行は 2 行、Guestshell destroyed successfully の行は 3 行在りました。取り直しの間隔の理由と、3 回で終わった理由は撮っていません。同じ手順で取り直しが何回になるかも確かめていません(1 回の run の値)。

cycle B のコンソールの記録には、--- System Configuration Dialog --- と初期設定の問いの行が 1 回ずつ在り(144・146 行目)、Press RETURN to get started! の行は 0 行でした。ZTP76・%PNP-・AUTOINSTALL の語を含む行も 0 行です。コンソールは印字されたものだけの記録で、0 行は NEW1 が何もしなかったことの証拠ではありません。cycle B では NEW1 への SSH を撮っておらず、待ちの後の NEW1 の startup-config・Guest Shell・IOx の状態は見ていません。

10.4 受け手の記録と試みの数

WEB1 の :8000 の受け手の記録には、cycle B の NEW1 のアドレス 10.76.0.101 からの GET /doc_sample.py が 6 行在りました。〔ツール側〕cycle B の後に読んだ受け手の記録は以下のとおりです。

snippet
$ cat ~/http-8000.log
10.76.0.10 - - [30/Oct/2026 22:11:21] "GET /ztp76a.py HTTP/1.1" 200 -
10.76.0.100 - - [30/Oct/2026 22:14:53] "GET /ztp76a.py HTTP/1.1" 200 -
10.76.0.100 - - [30/Oct/2026 22:14:53] "GET /ztp76a.py HTTP/1.1" 200 -
10.76.0.101 - - [30/Oct/2026 22:26:13] "GET /doc_sample.py HTTP/1.1" 200 -
10.76.0.101 - - [30/Oct/2026 22:26:13] "GET /doc_sample.py HTTP/1.1" 200 -
10.76.0.101 - - [30/Oct/2026 22:28:06] "GET /doc_sample.py HTTP/1.1" 200 -
10.76.0.101 - - [30/Oct/2026 22:28:06] "GET /doc_sample.py HTTP/1.1" 200 -
10.76.0.101 - - [30/Oct/2026 22:31:39] "GET /doc_sample.py HTTP/1.1" 200 -
10.76.0.101 - - [30/Oct/2026 22:31:39] "GET /doc_sample.py HTTP/1.1" 200 -

2〜4 行目は cycle A までの行で、cycle B の後の cat で初めて出た行は 5〜10 行目の 6 行です。この run の cycle B の :8000 の受け手の記録(cycle A の後の cat から cycle B の後の cat まで)に、送り元 10.76.0.101 の GET は 6 行(22:26:13・22:28:06・22:31:39 に 2 行ずつ。応答は全部 200)でした。この run の cycle B の WEB1 の tcpdump(NEW1 の start の前の起動から待ちの後の停止まで・WEB1 の時計)には、NEW1 から WEB1 の :8000 への TCP の接続が 6 本(3 つの秒に 2 本ずつ)在り、各接続の WEB1 から NEW1 への最後のデータは 685 バイトでした。685 は doc_sample.py の大きさと同じ数です。

GET の行の数(6)は試みの数(3)ではありません。2 つの数を並べるだけで、試みと GET の行の対応は書きません。cycle C の SRV1 の copy のコマンドは 1 本で、受け手の記録の送り元 10.76.0.1 の行は 2 行でした(§9.6)。

この run の cycle B の WEB1 の tcpdump(NEW1 の start の前の起動から待ちの後の停止まで)には、NEW1 から 255.255.255.255 の 53 番への DNS の問い合わせが 138 本在りました(A? devicehelper.cisco.com. 82・A? tools.cisco.com. 28・AAAA? tools.cisco.com. 28)。udp 69 と RRQ の行は 0 行です。DNS の問い合わせは §12.4 にほかの cycle と並べます。


11. 取れない時(cycle D・404)

11.1 資料の失敗の行き先

ZTP 章の概要の Note は、ZTP が失敗した時は機器が設定ファイルを読み込むために AutoInstall に落ちると書いていました(§2.2)。同じ章の DHCPv6 Support の小節は、冒頭の段落で、DHCPv6 は既定で有効で startup configuration 無しで起動するどの機器でも動くと書き、Note で DHCPv6 を支えるのは Catalyst 9300 と 9500 Series Switches だけと書き、続く段落で、HTTP か TFTP でのスクリプトの取得に失敗した時は機器が設定の無い最初に戻ると書きます。小節の冒頭の段落の 2 つ目の文・Note・続く段落の 3 つの文は以下のとおりです。

DHCPv6 is enabled by default, and will work on any device that boots without a startup configuration.

(ZTP 章「DHCPv6 Support」)

DHCPv6 is only supported on Catalyst 9300 and 9500 Series Switches.

(ZTP 章「DHCPv6 Support」の Note)

DHCPv6 is supported by both TFTP and HTTP download of Python scripts.

If the HTTP or TFTP download of Python scripts fail, the device will revert to the start (without any configuration).

For both DHCPv4, and DHCPv6 to work, the correct HTTP file path must be available in the DHCP configuration.

(ZTP 章「DHCPv6 Support」)

3 つの文は DHCPv6 Support の小節の段落の文で、第 3 文は DHCPv4 にも触れます。DHCPv4 のスクリプトの取得の失敗に第 2 文が当たるかは、文面から決まりません。概要の Note(AutoInstall に落ちる)と、この段落の第 2 文(設定の無い最初に戻る)は、両方を並べ、どちらが正しいとも書きません。

DHCPv6 の対象の機種の書き方も、同じ章の中で割れます。小節の冒頭の段落はどの機器でも動くと書き、Note は Catalyst 9300 と 9500 Series Switches だけと書きます。同じ章の機能情報の表の DHCPv6 Support for Zero-Touch Provisioning の行は、16.9.1 で Catalyst 9300 と 9500 Series Switches に、17.3.2a で Catalyst 9800-40 と 9800-80 Wireless Controllers に実装したと書きます。3 か所を並べ、どれが正しいとも書きません。

In Cisco IOS XE Amsterdam 17.3.2a, this feature was implemented on the following platforms: Cisco Catalyst 9800-40 Wireless Controllers Cisco Catalyst 9800-80 Wireless Controllers

(ZTP 章「Table 2. Feature Information for Zero-Touch Provisioning」)

AutoInstall 章は、TFTP サーバのアドレスを option 150 で知らない時の TFTP の要求を broadcast で送ると書き(§2.4)、同じ段落で、ルータは broadcast を止めるので要求が TFTP サーバに届かず、AutoInstall は失敗すると書きます。この段落は続けて、問題の解決として ip helper-address のコマンドを挙げ、そのコマンドが要求の宛先を 255.255.255.255 から address の引数のアドレスに替えると書きます。段落の前の箇条は、TFTP サーバと機器が別の LAN の区間にある時と、機器が WAN に繋がる時の注意として、要求を受ける全ての IF にこのコマンドを設定するよう書きます。

Routers block network layer broadcast datagrams which prevents the TFTP session initialization requests from reaching the TFTP server, and AutoInstall will fail.

The solution to this problem is to use the ip helper-address address command. The ip helper-address address command changes the broadcast address of TFTP session initialization request from 255.255.255.255 to the address that is configured with the address argument.

(AutoInstall 章「Storage and Transmission of Configuration Files」)

本ラボの ZTP 区間は、NEW1 の Gi1・SRV1 の Gi2・WEB1 の ens3 が繋がる 1 つの L2 の区間で(§3)、ルータを挟んだ先の TFTP サーバの形と ip helper-address は撮っていません(§14)。cycle E・F の TFTP の broadcast の要求(§12.2)は、この区間の中の WEB1 の tcpdump の記録です。

11.2 pool と前の確かめ

cycle D の pool は、option 150 を外し、option 67 を WEB1 に置いていないファイルの URL に替えた形です。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の投入のエコーは以下のとおりです。

snippet
configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
SRV1(config)#ip dhcp pool ZTP76
SRV1(dhcp-config)# no option 150
SRV1(dhcp-config)# option 67 ascii http://10.76.0.10:8000/missing76.py
SRV1(dhcp-config)#end
SRV1#

取得スクリプトは NEW1 の start の前に、WEB1 の ~/ztp/missing76.py が無いことと、受け手が無いファイルに 404 を返すことを、別の名前で確かめました。〔ツール側〕WEB1 の確かめの 1 本目(置いていない = 0)は以下のとおりです。

snippet
$ test ! -e ~/ztp/missing76.py; echo $?
0

〔ツール側〕WEB1 の確かめの 2 本目(無いファイルの名前 selfcheck76-404 に 404)は以下のとおりです。

snippet
$ curl -s -o /dev/null -w '%{http_code}' http://10.76.0.10:8000/selfcheck76-404
404

確かめは missing76.py の名前で受け手に要求を送らない形で、受け手の記録に WEB1 自身の GET /missing76.py の行は残りません(〔ツール側〕取得スクリプトの設計)。

11.3 NEW1 のコンソールの記録

cycle D のコンソールの記録は、Attempting bootfile の 2 行後の Couldn't open bootfile の行で終わりました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle D のコンソールの記録の 136〜159 行目は以下のとおりです。

snippet
…(省略)
No startup-config, starting autoinstall/pnp/ztp...

Autoinstall will terminate if any input is detected on console

Autoinstall trying DHCPv4 on GigabitEthernet1



         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]:
Acquired IPv4 address 10.76.0.103 on Interface GigabitEthernet1
Received following DHCPv4 options:
        bootfile        : http://10.76.0.10:8000/missing76.py

OK to enter CLI now...

pnp-discovery can be monitored without entering enable mode

Entering enable mode will stop pnp-discovery

Attempting bootfile http://10.76.0.10:8000/missing76.py

Couldn't open bootfile http://10.76.0.10:8000/missing76.py

159 行目の Couldn't open bootfile http://10.76.0.10:8000/missing76.py は記録の最後の行で、この run の cycle D のコンソールの記録(start から 1210 秒・取得 119 回)に、この行の後の行は 0 行でした。Autoinstall trying の行は DHCPv4 の 1 行だけで、tftp か TFTP の語を含む行と、day0guestshell・Guestshell の語を含む行は 0 行です(数えた)。cycle D では NEW1 への SSH を撮っておらず、NEW1 の show logging・show auto install trace・show pnp trace は在りません。

11.4 WEB1 の記録(WEB1 の時計)

WEB1 の :8000 の受け手の記録には、cycle D の NEW1 のアドレス 10.76.0.103 からの GET /missing76.py が 3 行在り、応答は 3 行とも 404 でした。〔ツール側〕cycle D の後に読んだ受け手の記録の抜粋は以下のとおりです。

snippet
$ cat ~/http-8000.log
…(省略)
10.76.0.10 - - [30/Oct/2026 22:55:21] code 404, message File not found
10.76.0.10 - - [30/Oct/2026 22:55:21] "GET /selfcheck76-404 HTTP/1.1" 404 -
10.76.0.103 - - [30/Oct/2026 22:58:50] code 404, message File not found
10.76.0.103 - - [30/Oct/2026 22:58:50] "GET /missing76.py HTTP/1.1" 404 -
10.76.0.103 - - [30/Oct/2026 22:58:51] code 404, message File not found
10.76.0.103 - - [30/Oct/2026 22:58:51] "GET /missing76.py HTTP/1.1" 404 -
10.76.0.103 - - [30/Oct/2026 22:58:52] code 404, message File not found
10.76.0.103 - - [30/Oct/2026 22:58:52] "GET /missing76.py HTTP/1.1" 404 -

13・14 行目は WEB1 自身の確かめ(/selfcheck76-404)の行で、回数に数えません。この run の cycle D の :8000 の受け手の記録(cycle C の後の cat から cycle D の後の cat まで)に、送り元 10.76.0.103 の GET /missing76.py は 3 行(22:58:50・22:58:51・22:58:52)でした。404 の要求は、code 404, message File not found の行と GET の行の 2 行で記録されます。

WEB1 の tcpdump(WEB1 の時計)には、受け手の 404 の後に、NEW1 から 255.255.255.255 の 53 番への DNS の問い合わせが続きました。〔ツール側〕cycle D の tcpdump の抜粋(3 本目の接続の終わりと、最初の DNS の問い合わせ)は以下のとおりです。

snippet
$ cat ~/tcpdump-D.txt
…(省略)
22:58:52.208787 52:54:00:21:2c:0b > 52:54:00:dd:97:32, ethertype IPv4 (0x0800), length 54: (tos 0x0, ttl 255, id 25672, offset 0, flags [DF], proto TCP (6), length 40)
    10.76.0.103.51228 > 10.76.0.10.8000: Flags [.], cksum 0x9f33 (correct), seq 138, ack 522, win 32508, length 0
22:58:52.209264 52:54:00:21:2c:0b > 52:54:00:dd:97:32, ethertype IPv4 (0x0800), length 54: (tos 0x0, ttl 255, id 25673, offset 0, flags [DF], proto TCP (6), length 40)
    10.76.0.103.51228 > 10.76.0.10.8000: Flags [FP.], cksum 0x9f2a (correct), seq 138, ack 522, win 32508, length 0
22:58:52.209275 52:54:00:dd:97:32 > 52:54:00:21:2c:0b, ethertype IPv4 (0x0800), length 54: (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 40)
    10.76.0.10.8000 > 10.76.0.103.51228: Flags [.], cksum 0x1c3a (correct), seq 522, ack 139, win 501, length 0
22:59:14.199946 52:54:00:21:2c:0b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 93: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 79)
    10.76.0.103.64332 > 255.255.255.255.53: [no cksum] 55643+ [1au] A? devicehelper.cisco.com. ar: . OPT UDPsize=4096 (51)
22:59:15.201397 52:54:00:21:2c:0b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 93: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 79)
    10.76.0.103.53787 > 255.255.255.255.53: [no cksum] 61597+ [1au] A? devicehelper.cisco.com. ar: . OPT UDPsize=4096 (51)
22:59:35.209713 52:54:00:21:2c:0b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 93: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 79)
    10.76.0.103.49145 > 255.255.255.255.53: [no cksum] 41201+ [1au] A? devicehelper.cisco.com. ar: . OPT UDPsize=4096 (51)
22:59:39.211113 52:54:00:21:2c:0b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 93: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 79)
    10.76.0.103.36489 > 255.255.255.255.53: [no cksum] 23078+ [1au] A? devicehelper.cisco.com. ar: . OPT UDPsize=4096 (51)
22:59:55.196593 52:54:00:21:2c:0b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 86: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 72)
    10.76.0.103.23287 > 255.255.255.255.53: [no cksum] 18873+ [1au] A? tools.cisco.com. ar: . OPT UDPsize=4096 (44)
22:59:59.196981 52:54:00:21:2c:0b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 86: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 72)
    10.76.0.103.30074 > 255.255.255.255.53: [no cksum] 58603+ [1au] A? tools.cisco.com. ar: . OPT UDPsize=4096 (44)
23:00:01.220318 52:54:00:21:2c:0b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 93: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 79)
    10.76.0.103.44754 > 255.255.255.255.53: [no cksum] 12670+ [1au] A? devicehelper.cisco.com. ar: . OPT UDPsize=4096 (51)
23:00:03.199389 52:54:00:21:2c:0b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 86: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 72)
    10.76.0.103.19548 > 255.255.255.255.53: [no cksum] 41086+ [1au] AAAA? tools.cisco.com. ar: . OPT UDPsize=4096 (44)
…(省略)

コンソールの記録の中の並びと、WEB1 の時計の上の並びは、以下の 2 つの欄に分けて置きます。2 つの記録をまたぐ前後と、受け手の 404 と Couldn't open bootfile の因果は書きません。

NEW1 のコンソールの記録の行番号の順行
Acquired IPv4 address 10.76.0.103 on Interface GigabitEthernet1147
bootfile : http://10.76.0.10:8000/missing76.py149
Attempting bootfile http://10.76.0.10:8000/missing76.py157
Couldn't open bootfile http://10.76.0.10:8000/missing76.py159(記録の最後)
WEB1 の時計の上の並び(〔ツール側〕)WEB1 の時刻
DHCP の Discover・Offer・Request・ACK22:58:12.754262〜22:58:14.769237
:8000 への TCP の接続 3 本と、受け手の GET /missing76.py の 404 の 3 行22:58:50.193906〜22:58:52.205552(SYN)・22:58:50〜22:58:52(受け手の記録)
255.255.255.255:53 への DNS の問い合わせの最初(A? devicehelper.cisco.com.)22:59:14.199946
DNS の問い合わせの最後 = tcpdump の最後のパケット23:16:19.460555

この run の cycle D の WEB1 の tcpdump(NEW1 の start の前の起動から待ちの後の停止まで・175 パケット)には、DHCP の 4 パケット・:8000 の TCP の 33 パケット(3 本 × 11)・DNS の問い合わせ 138 本(A? devicehelper.cisco.com. 82・A? tools.cisco.com. 28・AAAA? tools.cisco.com. 28)が在りました。DNS の答えの行(送り元のポートが 53)と udp 69 の行は 0 行です(WEB1 の視野)。

cycle D で NEW1 が AutoInstall の TFTP を送ったか、DHCP をやり直したかは撮れていません。WEB1 の視野(broadcast と WEB1 のフレーム)では udp 69 の行が 0 行・DHCP は 1 回分(4 パケット)で、SRV1 の show logging の cycle D で初めて出た行にも TFTP の行は 0 行でした。

NEW1 から SRV1 への unicast は WEB1 の視野の外です。SRV1 の tftp-server の行は cycle C の後に外しており(show running-config | count tftp-server は 1 → 0・§9.6)、cycle D の間には読み直していません。SRV1 の debug tftp events が cycle D の間に有効だったかも読み返していません。これらの 0 行は、NEW1 が送っていないことの証拠ではありません。


12. PnP の機器の側の振る舞い(cycle D・E・F)

この図を大きく開く ↗

cycle D・E・F の 3 回の起動で NEW1 が送った・引いたもの(DNS・GET /pnp/HELLO・RRQ)を、tcpdump の記録と受け手の記録〔ツール側〕で並べた図です。

PnP の振る舞いのうち実測とするのは、機器が送った・引いたもの(送り先・名前・回数)だけです。ZTP 区間の中に PnP のサーバは置いておらず、:8080 の受け手は python3 -m http.server で、10.76.0.10 の 53 番に DNS の受け手は置いていません。PnP のサーバとクラウドが何を返すかは、出典の層(§13)と確かめていないこと(§14)に分けます。cycle D・E・F は別々の起動で(各 cycle の頭で NEW1 を stop・wipe して起動し直した〔ツール側〕)、1 つの起動の中の順序ではありません。

12.1 option 43(cycle E)

PnP の本は、DHCP の応答を受けた機器の PnP agent が、応答の option 43 から PnP サーバの IP アドレスかホスト名を取り出し、それで PnP サーバと通信すると書きます。同じ本の IPv4 の節は、option 43 の書式の見本を 1 行で示します(見本の版と機種の記載なし)。

When the DHCP response is received by the device, the PnP agent extracts the option 43 from the response to get the IP address or the hostname of the PnP server. PnP agent then uses this IPv4 address or hostname to communicate with the PnP server.

(PnP の本「Cisco Network Plug and Play Discovery through DHCP Server」)

The following is the format for defining the option 43 for PnP deployments: option 43 ascii “5A;K5;B2;I10.30.30.10;J443;Ttftp://10.30.30.10/ ios.p7b;Z10.30.30.1

(PnP の本「DHCP Option based Discovery over an IPv4 Network」)

この見本は、ascii の文字列を " で開き、閉じる " がありません。T の欄の 10.30.30.10/ と ios.p7b の間には空白が 1 個あります(取得した本文の形)。見本は直さずに引いています(§15.8)。同じ節は、T の欄を証明書の bundle の置き場所の指定、Z の欄を NTP サーバの指定と書きます。

The field ‘T’ in the PnP string provides an option for the network administrator to specify the location of the certificate bundle, which can be hosted on a local or remote file server.

In such a scenario, an IP address or a URL can be specified as an alternative parameter in the option 43 with the prefix ‘Z’, which can point the device to a NTP server.

(PnP の本「DHCP Option based Discovery over an IPv4 Network」)

取得した出典の 12 本で、引用符で囲んだ 1 文字の欄の名前は、PnP の本の T(3 か所)と Z(1 か所)だけでした(数えた)。見本の 5A・K5・B2・I…・J… の欄が何を指すかは確かめていません。

本ラボの option 43 の文字列は、取得スクリプトの設計で、同じ本の DHCPv6 の pool の見本の先頭(5A1D;K4)と、IPv4 の見本の B・I・J の欄の形を組み合わせ、I と J の値を区間の受け手(10.76.0.10・8080)に替えた形です(〔ツール側〕)。各欄の意味は書かず、機器が 10.76.0.10 の 8080 番へ送った要求だけを実測とします。

cycle E の pool は、option 67 を外し、option 43 を入れた形です。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の投入のエコーは以下のとおりです。

snippet
configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
SRV1(config)#ip dhcp pool ZTP76
SRV1(dhcp-config)# no option 67
SRV1(dhcp-config)# option 43 ascii "5A1D;K4;B2;I10.76.0.10;J8080"
SRV1(dhcp-config)#end
SRV1#

:8080 の受け手は、cycle E の前に WEB1 で起こしました。〔ツール側〕起動の直後の ps は以下のとおりです(~/pnp8080 は P0 の ls の時点で . と .. だけのディレクトリ)。

snippet
$ sleep 1; ps -o pid=,ppid=,user=,args= -p 1515 --ppid 1515
   1515       1 labuser  python3 -m http.server 8080 --bind 10.76.0.10 --directory /home/labuser/pnp8080

cycle E の NEW1 は、受けた option を vendor の 1 項目で印字しました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle E のコンソールの記録の 136〜156 行目は以下のとおりです。

snippet
…(省略)
No startup-config, starting autoinstall/pnp/ztp...

Autoinstall will terminate if any input is detected on console

Autoinstall trying DHCPv4 on GigabitEthernet1



         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]:
Acquired IPv4 address 10.76.0.104 on Interface GigabitEthernet1
Received following DHCPv4 options:
        vendor          : 5A1D;K4;B2;I10.76.0.10;J8080

OK to enter CLI now...

pnp-discovery can be monitored without entering enable mode

Entering enable mode will stop pnp-discovery
Guestshell destroyed successfully

vendor : 5A1D;K4;B2;I10.76.0.10;J8080 の値は、pool の option 43 の引用符の中の文字列と同じです。cycle E のコンソールの記録に、bootfile・Attempting bootfile・%PNP- の行は 0 行で、156 行目の Guestshell destroyed successfully が記録の最後の行です(§12.5)。WEB1 の tcpdump の Offer と ACK の Vendor-Option (43), length 28 の 28 個の十進数を ASCII に戻すと、pool の文字列と同じ 5A1D;K4;B2;I10.76.0.10;J8080 でした(記事の側で計算した値)。

:8080 の受け手の記録には、cycle E の NEW1 のアドレス 10.76.0.104 からの GET /pnp/HELLO の行と、code 404, message File not found の行が在りました。〔ツール側〕cycle E の後に読んだ :8080 の受け手の記録の抜粋は以下のとおりです。

snippet
$ cat ~/http-8080.log
10.76.0.104 - - [30/Oct/2026 23:20:36] code 404, message File not found
10.76.0.104 - - [30/Oct/2026 23:20:36] "GET /pnp/HELLO HTTP/1.1" 404 -
10.76.0.104 - - [30/Oct/2026 23:20:46] code 404, message File not found
10.76.0.104 - - [30/Oct/2026 23:20:46] "GET /pnp/HELLO HTTP/1.1" 404 -
10.76.0.104 - - [30/Oct/2026 23:21:27] code 404, message File not found
10.76.0.104 - - [30/Oct/2026 23:21:27] "GET /pnp/HELLO HTTP/1.1" 404 -
…(省略)
10.76.0.104 - - [30/Oct/2026 23:37:20] code 404, message File not found
10.76.0.104 - - [30/Oct/2026 23:37:20] "GET /pnp/HELLO HTTP/1.1" 404 -
10.76.0.104 - - [30/Oct/2026 23:38:06] code 404, message File not found
10.76.0.104 - - [30/Oct/2026 23:38:06] "GET /pnp/HELLO HTTP/1.1" 404 -
10.76.0.104 - - [30/Oct/2026 23:38:16] code 404, message File not found
10.76.0.104 - - [30/Oct/2026 23:38:16] "GET /pnp/HELLO HTTP/1.1" 404 -

この run の :8080 の受け手の記録(cycle E の前の起動から、cycle E の後と cycle F の後の 2 回の cat まで。2 回の cat は同じ内容)に、送り元 10.76.0.104 の GET /pnp/HELLO は 40 行で、どの行も応答の欄は 404 でした(最初 23:20:36・最後 23:38:16。送り元が WEB1 と SRV1 の行は 0 行・数えた)。WEB1 の tcpdump では、隣り合う接続の SYN の間隔が 10.0 秒と 41.0 秒か 46.0 秒の交互に並びました(WEB1 の時計どうしの引き算)。間隔の理由と、記録の最後の GET の行(23:38:16)の後に要求が続いたかは撮っていません。

WEB1 の tcpdump は :8080 の中身を HTTP として表示し、要求の頭の行と、受け手の応答の頭の行が残りました。〔ツール側〕cycle E の tcpdump の抜粋(最初の RRQ の 3 本と、最初の :8080 の接続)は以下のとおりです。

snippet
$ cat ~/tcpdump-E.txt
…(省略)
23:20:25.640915 52:54:00:53:d7:a4 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 64: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 50)
    10.76.0.104.52611 > 255.255.255.255.69: [no cksum] TFTP, length 22, RRQ "network-confg" octet
23:20:29.640936 52:54:00:53:d7:a4 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 64: (tos 0x0, ttl 255, id 1, offset 0, flags [none], proto UDP (17), length 50)
    10.76.0.104.52611 > 255.255.255.255.69: [no cksum] TFTP, length 22, RRQ "network-confg" octet
23:20:34.642614 52:54:00:53:d7:a4 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 64: (tos 0x0, ttl 255, id 2, offset 0, flags [none], proto UDP (17), length 50)
    10.76.0.104.52611 > 255.255.255.255.69: [no cksum] TFTP, length 22, RRQ "network-confg" octet
23:20:36.821405 52:54:00:53:d7:a4 > 52:54:00:dd:97:32, ethertype IPv4 (0x0800), length 58: (tos 0x0, ttl 255, id 63660, offset 0, flags [none], proto TCP (6), length 44)
    10.76.0.104.29907 > 10.76.0.10.8080: Flags [S], cksum 0x693e (correct), seq 1817184523, win 4128, options [mss 1460], length 0
23:20:36.821429 52:54:00:dd:97:32 > 52:54:00:53:d7:a4, ethertype IPv4 (0x0800), length 58: (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 44)
    10.76.0.10.8080 > 10.76.0.104.29907: Flags [S.], cksum 0x236c (correct), seq 1301810520, ack 1817184524, win 64240, options [mss 1460], length 0
23:20:36.822399 52:54:00:53:d7:a4 > 52:54:00:dd:97:32, ethertype IPv4 (0x0800), length 54: (tos 0x0, ttl 255, id 63661, offset 0, flags [none], proto TCP (6), length 40)
    10.76.0.104.29907 > 10.76.0.10.8080: Flags [.], cksum 0x25fa (correct), seq 1, ack 1, win 4128, length 0
23:20:36.822778 52:54:00:53:d7:a4 > 52:54:00:dd:97:32, ethertype IPv4 (0x0800), length 188: (tos 0x0, ttl 255, id 63662, offset 0, flags [none], proto TCP (6), length 174)
    10.76.0.104.29907 > 10.76.0.10.8080: Flags [.], cksum 0xd2fe (correct), seq 1:135, ack 1, win 4128, length 134: HTTP, length: 134
	GET /pnp/HELLO HTTP/1.1
	User-Agent: cisco-IOS
	Host: 10.76.0.10:8080
	Date: Fri, 30 Oct 2026 23:20:37 GMT
	Connection: Keep-Alive

23:20:36.822788 52:54:00:dd:97:32 > 52:54:00:53:d7:a4, ethertype IPv4 (0x0800), length 54: (tos 0x0, ttl 64, id 21853, offset 0, flags [DF], proto TCP (6), length 40)
    10.76.0.10.8080 > 10.76.0.104.29907: Flags [.], cksum 0x3b29 (correct), seq 1, ack 135, win 64106, length 0
23:20:36.825742 52:54:00:dd:97:32 > 52:54:00:53:d7:a4, ethertype IPv4 (0x0800), length 239: (tos 0x0, ttl 64, id 21854, offset 0, flags [DF], proto TCP (6), length 225)
    10.76.0.10.8080 > 10.76.0.104.29907: Flags [P.], cksum 0x8ebe (correct), seq 1:186, ack 135, win 64106, length 185: HTTP, length: 185
	HTTP/1.0 404 File not found
	Server: SimpleHTTP/0.6 Python/3.12.3
	Date: Fri, 30 Oct 2026 23:20:36 GMT
	Connection: close
	Content-Type: text/html;charset=utf-8
	Content-Length: 335
…(省略)

この run の cycle E の WEB1 の tcpdump(NEW1 の start の前の起動から待ちの後の停止まで)の :8080 への要求は GET /pnp/HELLO HTTP/1.1 で、User-Agent: cisco-IOS と Host: 10.76.0.10:8080 を持ちました(40 本とも同じ形・数えた)。応答の HTTP/1.0 404 File not found と Server: SimpleHTTP/0.6 Python/3.12.3 は、受け手の python3 -m http.server が返したもの(〔ツール側〕)で、PnP のサーバの応答ではありません。要求の Date: の行は要求を送った側が書いた文字列、応答の Date: の行は受け手が書いた文字列で、2 つの時計の比較は書きません。

12.2 TFTP の broadcast(cycle E・F)

この run の cycle E と cycle F の WEB1 の tcpdump(各 cycle の NEW1 の start の前の起動から待ちの後の停止まで)には、NEW1 から 255.255.255.255 の 69 番への TFTP の要求(RRQ)が 72 本ずつ在りました。ファイル名は 4 つで、各 18 本でした(数えた)。

ファイル名cycle E の RRQcycle F の RRQ取得した出典に在るか
network-confg1818在る(AutoInstall 章の network configuration file の名前)
cisconet.cfg1818在る(同上)
router-confg1818無い(12 本に 0 件・数えた)
ciscortr.cfg1818無い(12 本に 0 件・数えた)

network-confg と cisconet.cfg は、AutoInstall 章がホスト名を決めるために TFTP サーバから読み込む network configuration file として挙げる名前です(§2.4)。宛先の 255.255.255.255 は、AutoInstall 章が option 150 で TFTP サーバのアドレスを知らない時の broadcast の宛先として書くアドレスと同じです(§2.4)。router-confg と ciscortr.cfg は取得した出典に無い名前で(12 本に 0 件・数えた)、並べるだけにします。RRQ を送ったプロセスは撮っていません。

cycle E の RRQ は、同じ名前が 6 本ずつ続く塊が 12 個(network-confg → cisconet.cfg → router-confg → ciscortr.cfg の順を 3 巡)で、最初は 23:20:25.640915、最後は 23:29:49.846989 でした(WEB1 の時計)。最後の RRQ の後、tcpdump の最後のパケット(23:38:16.205238)まで RRQ は 0 本です。この run の cycle A〜D の WEB1 の tcpdump(各 cycle の NEW1 の start の前の起動から待ちの後の停止まで)に、RRQ の行は 0 行でした。

SRV1 の show logging には、cycle E と cycle F の RRQ に当たる行が 0 行でした(この数は SRV1 の show logging の視野での数で、SRV1 に届かなかった要求はこの視野の外です。debug tftp events が cycle E・F の間に有効だったかは読み返していません)。SRV1 の tftp-server の行は cycle C の後に外しており(§9.6)、cycle E・F の間には読み直していません。

12.3 DNS の発見(cycle F)

PnP の本の DNS Lookup の節は、agent が前もって決めた deployment server の名前と、DHCP の応答から得た顧客のネットワークの domain 名で FQDN を作ると書き、前提に、顧客が “pnpserver” の名前で PnP サーバを置いたとします。DNS-based Discovery の節は、PnP 用の FQDN を pnpserver.<domain_name> のような形と書きます。

PnP agent then uses a preset deployment server name. The agent obtains the domain name of the customer network from the DHCP response and constructs the fully qualified domain name (FQDN).

Customer deployed PnP server in the network with the name “pnpserver”

(PnP の本「Cisco Network Plug and Play Discovery through DNS Lookup」)

In DNS-based discovery, a DHCP server receives the domain name of the customer network. The domain name is used to create a PnP-specific, fully qualified domain name (FQDN) such as pnpserver.<domain_name>. In this method, the customer network resolves this URL to a valid PnP server IP address.

(PnP の本「DNS-based Discovery」)

DNS Lookup の節の FQDN の例(deployment.customer.com)と、DNS-based Discovery の節の名前(pnpserver.<domain_name>)は、書き方が違います。

cycle F の pool は、option 43 を外し、domain-name と dns-server を入れた形です。dns-server の 10.76.0.10 は WEB1 の ens3 のアドレスで、WEB1 は 10.76.0.10 の 53 番で DNS を待ち受けていません。SRV1(csr1000v 17.03.08a・RAM は上書きしていない)の投入のエコーは以下のとおりです。

snippet
configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
SRV1(config)#ip dhcp pool ZTP76
SRV1(dhcp-config)# no option 43
SRV1(dhcp-config)# domain-name lab76.local
SRV1(dhcp-config)# dns-server 10.76.0.10
SRV1(dhcp-config)#end
SRV1#

〔ツール側〕cycle F の start の前の WEB1 の UDP の待ち受けの一覧は以下のとおりです。

snippet
$ ss -lunp
State  Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
UNCONN 0      0         127.0.0.54:53        0.0.0.0:*
UNCONN 0      0      127.0.0.53%lo:53        0.0.0.0:*

WEB1 の 53 番の待ち受けは、127.0.0.53 と 127.0.0.54 だけです。

cycle F の NEW1 は、受けた option を domain-name と dns-server-ip の 2 項目で印字しました。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle F のコンソールの記録の 136〜157 行目は以下のとおりです。

snippet
…(省略)
No startup-config, starting autoinstall/pnp/ztp...

Autoinstall will terminate if any input is detected on console

Autoinstall trying DHCPv4 on GigabitEthernet1



         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]:
Acquired IPv4 address 10.76.0.105 on Interface GigabitEthernet1
Received following DHCPv4 options:
        domain-name     : lab76.local
        dns-server-ip   : 10.76.0.10

OK to enter CLI now...

pnp-discovery can be monitored without entering enable mode

Entering enable mode will stop pnp-discovery
Guestshell destroyed successfully

〔ツール側〕cycle F の tcpdump の SRV1 の Offer は以下のとおりです。

snippet
$ cat ~/tcpdump-F.txt
…(省略)
23:41:54.255654 52:54:00:e9:b9:d2 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 355: (tos 0x0, ttl 255, id 15, offset 0, flags [none], proto UDP (17), length 341)
    10.76.0.1.67 > 255.255.255.255.68: [udp sum ok] BOOTP/DHCP, Reply, length 313, xid 0xd0a, Flags [Broadcast] (0x8000)
	  Your-IP 10.76.0.105
	  Client-Ethernet-Address 52:54:00:1b:16:d2
	  Vendor-rfc1048 Extensions
	    Magic Cookie 0x63825363
	    DHCP-Message (53), length 1: Offer
	    Client-ID (61), length 12: "95SCC54D7RI"
	    Server-ID (54), length 4: 10.76.0.1
	    Lease-Time (51), length 4: 86400
	    RN (58), length 4: 43200
	    RB (59), length 4: 75600
	    Subnet-Mask (1), length 4: 255.255.255.0
	    Default-Gateway (3), length 4: 10.76.0.1
	    Domain-Name (15), length 11: "lab76.local"
	    Domain-Name-Server (6), length 4: 10.76.0.10
	    END (255), length 0
…(省略)

この Offer では、option 15 と 6 が domain-name と dns-server の値を持ちます。

NEW1 は、10.76.0.10 の 53 番へ unicast で DNS の問い合わせを送りました。〔ツール側〕cycle F の tcpdump の抜粋(最初の問い合わせのあたり)は以下のとおりです。

snippet
$ cat ~/tcpdump-F.txt
…(省略)
23:42:40.567234 52:54:00:1b:16:d2 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 64: (tos 0x0, ttl 255, id 4, offset 0, flags [none], proto UDP (17), length 50)
    10.76.0.105.50777 > 255.255.255.255.69: [no cksum] TFTP, length 22, RRQ "network-confg" octet
23:42:41.680023 52:54:00:1b:16:d2 > 52:54:00:dd:97:32, ethertype IPv4 (0x0800), length 92: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 78)
    10.76.0.105.20588 > 10.76.0.10.53: [udp sum ok] 55767+ [1au] A? pnpserver.lab76.local. ar: . OPT UDPsize=4096 (50)
23:42:43.680492 52:54:00:1b:16:d2 > 52:54:00:dd:97:32, ethertype IPv4 (0x0800), length 92: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 78)
    10.76.0.105.21107 > 10.76.0.10.53: [udp sum ok] 32245+ [1au] A? pnpserver.lab76.local. ar: . OPT UDPsize=1472 (50)
23:42:45.681073 52:54:00:1b:16:d2 > 52:54:00:dd:97:32, ethertype IPv4 (0x0800), length 92: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 78)
    10.76.0.105.10154 > 10.76.0.10.53: [udp sum ok] 57694+ [1au] A? pnpserver.lab76.local. ar: . OPT UDPsize=4096 (50)
23:42:48.567809 52:54:00:1b:16:d2 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 64: (tos 0x0, ttl 255, id 5, offset 0, flags [none], proto UDP (17), length 50)
    10.76.0.105.50777 > 255.255.255.255.69: [no cksum] TFTP, length 22, RRQ "network-confg" octet
23:42:49.681079 52:54:00:1b:16:d2 > 52:54:00:dd:97:32, ethertype IPv4 (0x0800), length 92: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 78)
    10.76.0.105.31809 > 10.76.0.10.53: [udp sum ok] 61762+ [1au] A? pnpserver.lab76.local. ar: . OPT UDPsize=1472 (50)
23:42:55.685488 52:54:00:1b:16:d2 > 52:54:00:dd:97:32, ethertype IPv4 (0x0800), length 82: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 68)
    10.76.0.105.54255 > 10.76.0.10.53: [udp sum ok] 40206+ A? devicehelper.cisco.com. (40)
23:42:56.686687 52:54:00:1b:16:d2 > 52:54:00:dd:97:32, ethertype IPv4 (0x0800), length 93: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 79)
    10.76.0.105.29064 > 10.76.0.10.53: [udp sum ok] 50571+ [1au] A? devicehelper.cisco.com. ar: . OPT UDPsize=4096 (51)
…(省略)

この run の cycle F の WEB1 の tcpdump(NEW1 の start の前の起動から待ちの後の停止まで・92 パケット)に、10.76.0.10 の 53 番への問い合わせは 16 本在りました(数えた)。

型と名前本数取得した出典に在るか
A? pnpserver.lab76.local.5pnpserver の名前は在る(PnP の本の DNS の節)
A? devicehelper.cisco.com.3在る(PnP の本の Cloud Redirection の節)
A? ztp.lab76.local.2無い(12 本に 0 件・数えた)
AAAA? tools.cisco.com.2無い(同上)
AAAA? tools.cisco.com.lab76.local.1無い(同上)
PTR? 105.0.76.10.in-addr.arpa.2無い(同上)
PTR? 6.1.168.192.in-addr.arpa.1無い(同上)

pnpserver・ztp・tools.cisco.com.lab76.local. の名前の末尾の lab76.local は、NEW1 が印字した domain-name : lab76.local の値と同じ文字列です。PTR の名前の数字を逆の順に読むと、10.76.0.105(cycle F で NEW1 が受けたアドレス)と 192.168.1.6 になります。表で「無い」とした名前の問い合わせが、どの機能の問い合わせかは書きません(§14)。DNS の答えの行(送り元のポートが 53)は、この tcpdump に 0 行でした。この run の :8000 と :8080 の受け手の記録(cycle E の後の cat から cycle F の後の cat まで)に、増えた行は 0 行です。

192.168.1.6 は、7-4 §7.3 で CSR1(csr1000v 17.03.08a)の Guest Shell で走らせたスクリプトの中の show tcp brief all にも、Local Address の欄の 192.168.1.6.30209 として出ていました。本ラボでも 7-4 でも、192.168.1.6 が何のアドレスかは確かめていません(7-4 §12.1)。別の run の別の機器の表示で、並べるだけにします。

12.4 devicehelper.cisco.com の問い合わせ

devicehelper.cisco.com は、PnP の本の Cloud Redirection の節が、DHCP と DNS の発見が失敗した時に機器が繋ごうとする Cisco Cloud server の名前として書く名前です(§2.5)。

本ラボの WEB1 の tcpdump には、6 回の cycle のどれにも A? devicehelper.cisco.com. の問い合わせが在りました。

cycle宛先A? devicehelper.cisco.com. の本数ほかの名前(同じ tcpdump。型を問わず名前ごとに足した本数)
A(HTTP)255.255.255.255:5312tools.cisco.com 24・tools.cisco.com.lab.local 15
B(資料の見本)255.255.255.255:5382tools.cisco.com 56
C(TFTP)255.255.255.255:536tools.cisco.com 16・tools.cisco.com.lab.local 12
D(404)255.255.255.255:5382tools.cisco.com 56
E(option 43)255.255.255.255:5338tools.cisco.com 56・104.0.76.10.in-addr.arpa 12・6.1.168.192.in-addr.arpa 12
F(DNS)10.76.0.10:533上の §12.3 の表

各 cycle の本数は、その cycle の WEB1 の tcpdump(NEW1 の start の前の起動から待ちの後の停止まで)の値で、A と C の待ちは終わりの印の後 180 秒、B・D・E・F の待ちは固定の 1200 秒でした。待ちの長さが cycle で違うので、本数を cycle どうしで比べません。tools.cisco.com は取得した出典に無い名前で(12 本に 0 件・数えた)、.lab.local の付いた形は NEW1 の running-config の ip domain name lab.local と同じ文字列の末尾を持ちます(並べるだけ)。

NEW1 の側の記録(NEW1 の時計)では、cycle A の show logging に CCO server (devicehelper.cisco.com.) can't be resolved の行が (1/10)〜(6/10) の 6 行、cycle C の show logging に (1/10)〜(3/10) の 3 行在りました。WEB1 の時計の問い合わせの本数と、NEW1 の時計の行の数は、別の時計の別の記録で、対応づけません。

取得スクリプトは、問い合わせを区間の外へ出さない設計にしました(〔ツール側〕10.76.0.10 の 53 番に DNS の受け手を置かない(cycle F の start の前の WEB1 の UDP の待ち受けの一覧・§12.3)・WEB1 の ip_forward が 0)。SRV1 の global の経路表は、P0 と各 cycle の NEW1 の start の前の 7 回の読みのどれも Gateway of last resort is not set でした(§3.3。NEW1 が動いている間の SRV1 の経路表は撮っていません)。DNS の答えの行(送り元のポートが 53)は、6 回の cycle のどの tcpdump にも 0 行でした(WEB1 の視野・数えた)。devicehelper.cisco.com の先が何を返すかは撮っていません(§13.1・§14)。

12.5 cycle E・F の Guestshell destroyed successfully

cycle E と cycle F のコンソールの記録は、どちらも Guestshell destroyed successfully の行で終わりました。2 つの記録で Guestshell の語を含む行はこの 1 行ずつで、installed・activated・enabled・RUNNING・day0guestshell の語を含む行は 0 行でした(数えた)。cycle D のコンソールの記録には、Guestshell の語を含む行が 0 行でした。

day0guestshell の行の形を cycle ごとに並べると、以下のとおりです(コンソールの記録の行番号の順)。

cycleday0guestshell と Guest Shell の行の形
A・Cactivated → ACTIVATED → started → RUNNING → enabled → … → destroyed(installed の行は無い)
B1 回目は activated から、2 回目と 3 回目は installed → DEPLOYED から。3 回とも destroyed で終わる
DGuest Shell の行が無い
E・F作成の行の無い destroyed の 1 行だけ

cycle E・F の destroyed の行を何が出したか、何を消したかは撮っていません(§14)。cycle E・F では NEW1 への SSH を撮っておらず、show app-hosting list と show iox-service の状態も見ていません。

12.6 発見の順序(資料)と、本ラボの WEB1 の時刻の並び

PnP の本の発見の順序の文は、どれか 1 つを通る形(Discovery Process の節)と、順に次へ落ちる形(DNS Lookup の節・Cloud Redirection の節)がありました(§2.5)。Cloud Redirection の節は、non-backoff の PnP request が既定の待ち時間の内に届かなければ、発見は次の発見の仕組みへ進むと書きます。待ち時間の値と、次の仕組みの名前は書かれていません。

If the non-backoff PnP request is not received within default wait time, Cisco Network PnP discovery process continues with the next discovery mechanism.

(PnP の本「Cisco Cloud Redirection over an IPv4 and IPv6 Network」)

本ラボの WEB1 の時計の上で、cycle E の種類ごとの最初の行は、DHCP の 4 パケット(23:19:59.225326〜23:20:01.254746)→ 最初の RRQ(23:20:25.640915)→ 最初の :8080 の SYN(23:20:36.821405)→ 最初の DNS の問い合わせ(23:21:00.846684)→ 最初の PTR(23:21:43.681533)の順でした。その後は 3 種類が混ざり、最後の RRQ は 23:29:49.846989、最後の DNS の問い合わせは 23:37:38.195230、最後の :8080 の SYN は 23:38:16.201708 でした。cycle F は、DHCP(23:41:52.252065〜23:41:54.259797)→ 最初の RRQ(23:42:18.558558)→ 最初の A? pnpserver.lab76.local.(23:42:41.680023)の順で、最後の RRQ は 23:53:42.787886、最後の問い合わせは 23:57:22.933416(A? ztp.lab76.local.)でした。

この並びは WEB1 の時計の上の記録の並びで、資料の発見の順序の文とは対応づけません。NEW1 の時計の上の発見の順は、cycle E・F では NEW1 の show logging と show pnp trace を撮っていないので書けません。


13. 撮れない系統のうち出典で書けるもの

本ラボは、Cisco のクラウドと、CML に載らない管理の仕組みを撮っていません。撮っていない系統の名前のうち、「PnP Connect のクラウド」「Catalyst Center の PnP サーバ」「自動キッティング」の 3 つは、取得した出典に無い語です(PnP Connect・Catalyst Center・kitting の文字列は 12 本に 0 件・数えた)。

取得した出典に在るのは、PnP の本の Cisco Cloud Redirection と、iPXE 章の iPXE の 2 つの系統です。どちらも本ラボでは未実測で、以下は資料の文だけで書きます。上の 3 つの名前の系統は §14 に置きます。

13.1 Cisco Cloud Redirection(devicehelper.cisco.com の先)

PnP の本は、PnP サーバを企業が置く形のほかに、Cisco が提供するクラウドの配備のサービスを使う形があり、機器はそのサービスと通信して初期の配備をした後、顧客の配備のサーバへ redirect されうると書きます。同じ本の機能情報の表は、Cisco Cloud Redirection の行を Everest 16.5.1b に置きます。

A PnP server can be hosted by an enterprise. This solution allows for a cloud based deployment service provided by Cisco. In this case, a device discovers and communicates with Cisco’s cloud based deployment service for initial deployment. After that, it can be redirected to the customer’s deployment server.

(PnP の本「Cisco Network Plug and Play Server」)

Cisco Cloud Redirection over an IPv4 and IPv6 Network Cisco IOS XE Everest 16.5.1b Cisco Network PnP zero-touch discovery through the Cisco Cloud Redirection service is supported on both IPv4 and IPv6 based Cisco cloud discovery. For more details, see Cisco Cloud Redirection over an IPv4 and IPv6 Network.

(PnP の本の機能情報の表の Cisco Cloud Redirection over an IPv4 and IPv6 Network の行)

同じ本の Cloud Redirection の節は、devicehelper.cisco.com に届けば agent が trustpool の bundle を取り、Cloud Redirection のサービスと secure HTTP の接続を張ると書き、クラウドへの hello と、機器に作られる profile の見本を示します。

If the devicehelper.cisco.com is reachable, the Cisco Network PnP agent downloads the trustpool bundle and establishes a secure HTTP connection with the Cisco Cloud Redirection service.

Cisco Network PnP agent sends a HTTPS hello message to the Cisco cloud. The Cisco Network PnP redirection service running at Cisco cloud server replies to the HTTP request.

A Cisco cloud server PnP profile is created on the device as shown in this example. pnp profile pnp_cco_profile transport https host devicehelper.cisco.com port 443

(PnP の本「Cisco Cloud Redirection over an IPv4 and IPv6 Network」)

上の 2 つ目の引用(hello の段落の初めの 2 文)は、1 つ目の文で agent が Cisco のクラウドへ送るものを HTTPS の hello と書き、2 つ目の文でクラウドのサーバの redirection のサービスが答えるものを HTTP の要求と書きます。上の 1 つ目の引用(1 つ前の段落の文)は、agent が Cloud Redirection のサービスと張る接続を secure HTTP の接続と書いています。hello の段落の HTTPS と HTTP は、同じ段落の中で語が違う所として文面のまま並べ、両立しない 2 つの仕様としては並べません。

同じ節の Note は、16.5 から一部の機器は root の証明書を内蔵している場合があり、その機器は初めから HTTPS で CCO のサーバと通信すると書きます。

From Cisco IOS XE 16.5 release, some of the Cisco PnP devices may have root certificate embedded in the devices. These devices will communicate with the CCO server using HTTPS from the beginning. If the device does not have the embedded certificate then the legacy behavior is initiated.

(PnP の本「Cisco Cloud Redirection over an IPv4 and IPv6 Network」の Note)

クラウドへの hello・trustpool の取得・profile の作成・redirect は、本ラボでは未実測です。本ラボの devicehelper.cisco.com の問い合わせの記録は §12.4 に、cycle E の :8080 の受け手の記録の HTTP の GET は §12.1 に置きます。資料の HTTPS の hello と、本ラボの受け手の記録の HTTP の GET は、語が違うものとして §15.7 に並べます。PnP の本の pnp_cco_profile の見本は、§8.8 の pnp_python の profile の説明に使いません。

13.2 iPXE

iPXE 章は、netboot の主な要件を、DHCP サーバと、FTP/HTTP/TFTP のサーバの上の起動イメージと、ネットワークから起動するよう設定した機器の 3 つと書きます。iPXE の流れは、bootloader が DHCP の discover と request を送り、DHCP の応答の boot file name が起動イメージの在りかを示し、bootloader がイメージを取って起動する形です。

The following are the primary requirements for netbooting: DHCP server with proper configuration. Boot image available on the FTP/HTTP/TFTP server. Device configured to boot from a network-based source.

(iPXE 章「Netboot Requirements」)

Bootloader sends a DHCP discover message, and when the server replies, the Bootloader sends a DHCP request.

The DHCP response includes the IP address and boot file name. The boot file name indicates that the boot image is to be retrieved from a TFTP server (tftp://server/filename), FTP server (ftp://userid:password@server/filename), or an HTTP server (http://server/filename).

Bootloader downloads and boots the image from the network source.

(iPXE 章「iPXE Overview」)

ZTP の DHCP の option 67 が Python のスクリプトを指す(§2.3)のに対し、iPXE の boot file name は起動イメージを指します。iPXE 章は、今の iPXE は管理ポート(GigabitEthernet0/0)だけで動くと書き、機能情報の表の行の機種は Catalyst のスイッチです。

Because the current iPXE implementation works only via the management port (GigabitEthernet0/0), DHCP requests sent through the front panel ports are not supported.

(iPXE 章「iPXE Overview」)

Cisco IOS XE Denali 16.6.1 In Cisco IOS XE Denali 16.6.1, this feature was implemented on the following platforms: Catalyst 9300 Series Switches Catalyst 9500 Series Switches

(iPXE 章「Table 2. Feature Information for iPXE」)

iPXE 章の機能情報の表の機種は、Catalyst 3650 / 3850 / 9200 / 9300 / 9400 / 9500 / 9600 の系統で、csr1000v の名はありません。表に csr1000v の名が無いことは、csr1000v で iPXE を使えるかどうかの根拠になりません。iPXE と rommon の変数は、本ラボでは未実測です。


14. 本ラボで確かめていないこと

本ラボの実測は、csr1000v 17.03.08a(NEW1 は RAM 4096 MB)の 1 回の run の撮影です。以下は観測していません。

14.1 撮らなかったもの

  • Catalyst Center(DNA Center)の PnP サーバ。取得した出典に無い語です(Catalyst Center・DNA Center の文字列は 12 本に 0 件・数えた)。PnP の本に在るのは汎用の PnP サーバの段落と、関連文書としての APIC-EM の題名で、本ラボにも PnP サーバは置いていません。6-6 が引いた Catalyst Center の Provision の Plug and Play も、本ラボでは撮っていません
  • 自動キッティングの運用。取得した出典に無い語です(kitting の文字列は 12 本に 0 件・数えた)
  • 「PnP Connect」という名前と devicehelper.cisco.com の先との対応。「PnP Connect」は取得した出典に無い語です(12 本に 0 件・数えた)。devicehelper.cisco.com の先は、PnP の本の Cisco Cloud Redirection の語で書いています(§13.1)
  • PnP のサーバとクラウドが何を返すか。区間の中に PnP のサーバは無く、:8080 の受け手は python3 -m http.server で、GET /pnp/HELLO に HTTP の 404 を返しただけです(§12.1)
  • iPXE(§13.2)と、DHCPv6 での取得(ZTP 章の DHCPv6 Support の小節の冒頭の段落と Note、機能情報の表の DHCPv6 の行は、対象の機種の書き方が割れる・§11.1)
  • Guest Shell Lite とスタック(7-4 §12.1 が Day Zero のプロビジョニングと同じ項に挙げたもの)
  • option 150 だけ・option 67 だけ(ファイル名)・option 66 の cycle。cycle C は option 150 と option 67 のファイル名の組み合わせ 1 つだけです(§9)
  • IOS の TFTP サーバが Mgmt-vrf の IF の要求に答えるか。SRV1 の Gi1 の入りには DHCP と TFTP を落とす ACL を置いており、撮っていません(§3.3)
  • tftp-server の行を外した後の SRV1 の debug tftp events が、udp 69 の要求を記録するか。SRV1 の tftp-server の行は cycle C の後に外し(§9.6)、cycle D〜F の間には読み直していません。show debugging も撮っていません(§11.4・§12.2)
  • ルータを挟んだ先の TFTP サーバと ip helper-address。本ラボは ZTP 区間の中だけで撮っています(§3・§11.1)
  • Day 0 の間にコンソールへ入力した時の振る舞い(§5.8)
  • ZTP の後に設定を保存する手順と、guest-share の downloaded_script.py を消す手順(§8.1・§15.1)
  • CML の node definition の値(3072 MB)のままの NEW1 で、同じ Day 0 の流れになるか(§3.1。7-4 §13.2 は同じ版を 3072 MB で起動した run で Guest Shell の有効化を撮り、4 GB 未満の対応を意味しないと書いています)
  • 別の機種と、同じ手順を繰り返した時に同じ値・同じ順になるか

14.2 撮れなかったもの・書かないもの

  • cli.configure の返り値の中身。資格情報の行を含みうるので印字していません。型(str)と長さ(234)だけです(§7.5)
  • pnp_python が何のための profile か。created (1/3)・Hidden:1・pid 664 が PNP_SCRIPT_STARTED と同じこと・cycle C の Guestshell is up の行との前後・show pnp trace の PnP profile configuration was unsuccessful の意味も撮っていません(§8.8・§8.9・§15.9)
  • VirtualPortGroup31・Guest Shell・IOx の状態を何が作り、何が外したか。running-config の ip http client source-interface GigabitEthernet1・ip tftp source-interface GigabitEthernet1・ip http server の系統の行を何が入れたかも書きません。主体を書けたのは、show auto install trace に主体の在る IF の 2 行だけです(§8.2・§8.3)
  • NEW1 の %CVAC-3-FILE_ERROR と %CVAC-4-FILE_IGNORED の 2 行が何を示すか(§5.2)。CML の読み返しの files の項目(§3.2)は、別の記録として並べるだけにしています
  • cycle の間の違いの理由。option 61 の形(cycle A と cycle B〜F・§6.4)・コンソールの記録の形(cycle A に初期設定の問いの行が無い・§15.5)・物理メモリの行の値(§3.1)・show logging の行の有無と件数(§9.5)
  • 取得した出典に無い名前の問い合わせが、どの機能の問い合わせか。tools.cisco.com・ztp.lab76.local・in-addr.arpa の名前です(12 本に 0 件・数えた・§12.3・§12.4)
  • RRQ を送ったプロセスと、router-confg・ciscortr.cfg の名前の由来(§12.2)
  • 本ラボの option 43 の文字列の各欄が、機器にとって何を指すか。本ラボの文字列(5A1D;K4;B2;I10.76.0.10;J8080)に T と Z の欄は無く、取得した出典の 12 本で引用符で囲んだ 1 文字の欄の名前は T と Z だけでした(数えた・§12.1)
  • NEW1 が区間の外の宛先へ送ろうとした unicast と、NEW1 から SRV1 への unicast(cycle C の TFTP の要求を含む)。WEB1 の tcpdump の視野の外です(§3.6)
  • cycle D の Couldn't open bootfile の後に NEW1 が何をしたか。コンソールの記録はこの行で終わり(§11.3)、WEB1 の時計の上の DNS の問い合わせ(§11.4)とは対応づけていません
  • cycle B の取り直しの間隔と、3 回で終わった理由(§10.3)
  • cycle E・F の Guestshell destroyed successfully の行を出したものと、消したもの(§12.5)
  • show pnp trace の User has entered console を含む行が何を指すか(§8.9)
  • 2 つの時計をまたぐ前後。NEW1・SRV1・WEB1 の時計の記録は、1 本の時間軸に載せていません
  • downloaded_script.py の中身(名前と大きさだけ。§8.5)

15. 落とし穴・補足

15.1 guest-share に残る downloaded_script.py

本ラボのこの run では、ZTP の後の guest-share に downloaded_script.py(1760 バイト)が残っていました(cycle A・cycle C とも。§8.5・§9.6)。配ったスクリプトの本文には資格情報の行(type 9 の値)が在り、配った ztp76a.py と ztp76c.py の大きさも 1760 バイトでした(§7.2・§9.2)。downloaded_script.py の中身は撮っていないので、配った本文と同じかは確かめていません。7-4 §13.7 では、Guest Shell の destroy → enable の後も、dir bootflash:guest-share/ にスクリプトが残っていました。消す手順は確かめていません。

15.2 資料の見本の configurep による資格情報の印字

ZTP 章の見本のスクリプト(§10.1)には username の段がありません。一方、同じ章の C9300-48UXM の全体のブートログ 4 本(Version 16.6.5・16.9.4・16.12.3a・17.2.1)は、show ip interface brief の後に username・ip domain name・line vty の段を出し、configurep の行に資格情報を印字します。16.9.4・16.12.3a・17.2.1 の 3 本は、type 0 の password の警告の行も出します。

*** Configuring username, password, SSH *** Line 1 SUCCESS: username cisco privilege 15 password cisco Line 2 SUCCESS: ip domain name domain Line 3 SUCCESS: line vty 0 15 Line 4 SUCCESS: login local Line 5 SUCCESS: transport input all Line 6 SUCCESS: end

(ZTP 章「Cisco IOS XE Everest 16.6.x to Cisco IOS XE Fuji 16.8.x」)

Line 1 SUCCESS: username cisco privilege 15 password cisco **CLI Line # 1: WARNING: Command has been added to the configuration using a type 0 password. However, type 0 passwords will soon be deprecated. Migrate to a supported password type

(ZTP 章「Cisco IOS XE Fuji 16.9.x to Cisco IOS XE Gibraltar 16.11.x」)

見本のスクリプトとブートログの食い違いは、資料のまま引いています。

本ラボのスクリプトは、資格情報の行を cli.configure で入れ(入れた行の文字列は印字していない)、値は WSL で作った type 9 にしました(§3.8・§7.2)。本ラボの configurep も、「Line N SUCCESS:」の行に入れた設定の行をそのまま印字し、その行はコンソールの記録に残りました(§7.5)。

15.3 Day 0 の証拠にしない行

Day 0 の証拠にしない行と、その行が在った記録は以下のとおりです。どれも観測として並べるだけです。

行在った記録本ラボの対照
No startup-config, starting autoinstall/pnp/ztp...NEW1 のコンソールの記録(6 回の cycle とも 1 行)・NEW1 の show auto install trace(No startup-config, starting autoinstall...)CML の day0 の設定が入った SRV1 のコンソールの記録にも 1 行在った(§3.5)
% Failed to initialize nvramNEW1 のコンソールの記録(6 回の cycle とも 1 行)SRV1 のコンソールの記録にも 1 行在った(§3.5)
%CVAC-3-FILE_ERROR・%CVAC-4-FILE_IGNOREDNEW1 の show logging(cycle A・C)・cycle A の NEW1 のコンソールの記録SRV1 の show logging は %CVAC-4-CONFIG_DONE(§3.4)
%IOXN_APP-6-PRE_INIT_DAY0_GS_INFONEW1 の show logging(cycle A・C)・cycle A の NEW1 のコンソールの記録SRV1 の show logging にも 3 行在った(§3.4)
autoinstall: start-up config empty・nvram:/startup-config missing or emptyNEW1 の show auto install trace・show pnp trace—

ZTP 章の ISR 4000 の節のブートログの見本(ISR4451-X/K9・版の記載なし)は、% failed to initialize nvram(小文字の f)の行に、startup configuration が無いことを示し、Day Zero の流れが始まる最初の印だという注記を付けます。

% failed to initialize nvram ! <This message indicates that the startup configuration is absent on the device. This is the first indication that the Day Zero work flow is going to start.>

(ZTP 章「Boot Log for Cisco 4000 Series Integrated Services Routers」)

この注記は ISR4451-X の見本の注記として並べるだけで、本ラボの NEW1 の行(大文字の F の % Failed to initialize nvram)の意味の説明には使いません。本ラボの Day 0 の根拠は、CML の読み返し(§3.2)と、DHCP・bootfile・スクリプトの実行の行(§5.3〜§5.6)です。

15.4 cli.configure の返り値と ng の数

本ラボのこの run の ZTP76 access lines の行の ng の 234 個は、返り値の str の長さ(234)と同じ数が並んだ観測です(§7.5)。本ラボのスクリプトは、返り値を 1 要素ずつ見て、success の属性の無い要素に ng を印字する作りでした(〔ツール側〕スクリプトの組み立て)。この ng の数は、設定の行の成否の数ではありません。

資料の側の Python API 章の list(ConfigResult) の記述(7-4 §13.3)と、この run の str の返り値の並びは、§7.5 と §15.7 に置いています。

15.5 コンソールの記録の並びの cycle ごとの違い

本ラボのこの run では、NEW1 のコンソールの記録の形が cycle で違いました。行番号は各 cycle のコンソールの記録の行番号です。

cycle初期設定の問いの行Press RETURN to get started!show logging の Console logging
A0 行1 行(144 行目・ZTP76 END A の 362 行目より前)。その後に syslog の行が流れた106 messages logged
B・D・E・F1 行(146 行目)0 行(NEW1 の show logging を撮っていない)
C1 行(146 行目)1 行(282 行目・Script execution success! の 278 行目の後)。その後に syslog の 8 行9 messages logged

NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle C の後の show logging の見出しの抜粋は以下のとおりです。

snippet
NEW1# show logging
…(省略)
    Console logging: level debugging, 9 messages logged, xml disabled,
                     filtering disabled
    Monitor logging: level debugging, 0 messages logged, xml disabled,
                     filtering disabled
    Buffer logging:  level debugging, 111 messages logged, xml disabled,
…(省略)

cycle A の同じ見出しは Console logging: level debugging, 106 messages logged で(§5.7)、cycle C は 9 でした。cycle A の Guestshell destroyed successfully と Script execution success! は syslog の行の末尾に続けて書かれ(§5.6)、cycle C では単独の行でした(§9.3)。違いの理由は撮っていません。図(§5)のコンソールの見え方の注記は、cycle A の並びのとおりです。

15.6 SRV1 の debug の Data: の行

SRV1 の debug の option 124 の Data: の行は、CSR1000V の直後に表示されない 0x7f の 1 バイトを持ちました(§6.3)。この run の SRV1 の PZ の show logging(バッファに残った cycle A〜F の DHCP の debug)に Data: の行は 20 行で、そのうち 9 行は、0x7f の後にさらに文字が続いた崩れた行でした(数えた)。9 行のうち 8 行の続きの文字は、同じ cycle か 1 つ前の cycle の pool の option 67 の URL か option 43 の文字列の末尾と同じ並びで(例: cycle C の行の 10:8000/doc_sample.py は cycle B の option 67 の末尾)、残る 1 行(cycle D)は 0x7f が 2 個続いた形です。崩れた行は引かず、§6.3 には崩れていない行を載せました。崩れた原因は撮っていません。

15.7 割れた所の一覧(資料の中・資料と実機)

両方を並べた所は以下のとおりです。どれも、どちらが正しいとは書いていません。最後の行は語が違う所として並べた行で、両立しない仕様としては並べていません。

項目資料本ラボ(csr1000v 17.03.08a・RAM 4096 MB の 1 回の run)場所
ZTP の後の Guest ShellZTP 章の概要は有効のまま。同じ章の 16.12.x 以降の見出しの見本は destroyed の行を出すdestroyed の行が在り、ZTP の後は No App found§8.6
失敗の行き先概要の Note は AutoInstall に落ちる。DHCPv6 Support の小節は設定の無い最初に戻るcycle D は Couldn't open bootfile の行で記録が終わった§11
option 60 の文字列PnP の本の中で ‘cisco pnp’ と “ciscopnp”"ciscopnp"§6.5
option 61 の中身ZTP 章の表 1 の DHCPv4 は、シリアル番号と MAC アドレスがどちらも 61/toggles(toggles の意味は書かれていない)。AutoInstall 章は、多くの Cisco IOS XE の機器は MAC アドレスを使わず、より長い client identifier を使うcycle A は NEW1 の MAC アドレスと同じ並びの 12 桁の 16 進を含む cisco-5254.00e8.9b71-Gi1(length 25)、cycle B〜F は同じ cycle の Processor board ID と同じ文字列(length 12)§2.3・§6.1・§6.4
cli.configure の返り値Python API 章は list(ConfigResult)str・長さ 234§7.5
AutoInstall の IFAutoInstall 章は Gigabit Ethernet 0 だけ。設定の基礎の概要の章は LAN の Ethernet などの IFAutoinstall trying DHCPv4 on GigabitEthernet1§2.4・§5.7
見本のスクリプトの Python見本の print は括弧の無い形。Guest Shell 章は 17.3.1 以降は Python 3 だけSyntaxError の行が 3 行§10
Python の版の表示Python API 章の対話の見本は Python 2.7.5(7-4 §13.3)スクリプトが印字した版は 3.6.8§7.1・§7.3
ZTP の設定の要否と IOxZTP 章は設定が要らない。Guest Shell 章は guestshell enable の前に IOx の設定が要るrunning-config に iox の行が無いまま IOx は Running§8.6
option 67 の中身DHCP サーバの節はフォルダのパス・ファイルパス。同じ章の HTTP の見本は option 67 に http:// の URL を丸ごと入れるcycle A は URL の丸ごと、cycle C はファイル名§2.3・§4.1・§9
PnP の発見の順序どれか 1 つを通る形と、順に次へ落ちる形WEB1 の時計の上の記録の並びだけを撮った§12.6
DHCPv6 の対象の機種ZTP 章の DHCPv6 Support の小節の冒頭の段落はどの機器でも動く。同じ小節の Note は Catalyst 9300 と 9500 だけ。機能情報の表の DHCPv6 の行は 16.9.1 に 9300・9500、17.3.2a に 9800-40・9800-80DHCPv6 での取得は撮っていない(§14.1)§11.1
hello の語(語が違う所)PnP の本の Cloud Redirection の節の hello の段落は、agent が Cisco のクラウドへ送るものを HTTPS の hello、クラウドのサービスが答えるものを HTTP の要求と書く。1 つ前の段落は secure HTTP の接続と書くcycle E の :8080 の受け手の記録は HTTP の GET(GET /pnp/HELLO HTTP/1.1)で、宛先は 10.76.0.10:8080(WEB1 の受け手)。Cisco のクラウドへの hello は撮っていない§12.1・§13.1

15.8 原典の見本の形の食い違い

資料の見本には、同じ見本の中や、同じ章のほかの所と形が合わない箇所があります。見本は取得した本文の形のまま引き、どこが何と合わないかを並べます。本ラボの機器で走らせた見本(ZTP 章の見本のスクリプト)の括弧の無い print と、cycle B のコンソールの記録の SyntaxError の行は、§10 と §15.7 に置いています。

ZTP 章の ISC の DHCPv4 の見本(/etc/dhcp/dhcpd.conf・機種と版の記載なし)は、host の塊の option host-name の行だけが ; でなく . で終わります。前後の行は ; で終わります。

The following is a sample DHCPv4: /etc/dhcp/dhcpd.conf: host <hostname> { hardware ethernet xx:xx:xx:xx:xx:xx; option dhcp-client-identifier “xxxxxxxxxxxxxx”; option host-name “<hostname>”. option log-servers x.x.x.x; fixed-address x.x.x.x; if option vendor-class-identifier = “…” { option vendor-class-identifier “…”; if exists user-class and option user-class = “iPXE” { filename “http://x.x.x.x/…/<image>”; } else { filename “http://x.x.x.x/…/<script-name>”; } } }

(ZTP 章の ISC の DHCPv4 の見本)

PnP の本の option 43 の書式の見本は、閉じる " が無く、T の欄の URL の途中に空白が 1 個あります(§12.1)。

AutoInstall 章の LAN の例(FastEthernet の R1〜R4・機種と版の記載なし)の r4-confg は、hostname が R3 です。同じ例の network-confg は 172.16.28.100 を r4 に対応づけ、保存の手順は 172.16.28.100 へ telnet した先のプロンプトを R4 と示します。r4-confg の FastEthernet0/0 の ip address は 172.16.28.101 で、r3-confg と同じ値です。

r4-confg ! hostname R3

(AutoInstall 章「Creating Configuration Files for Each Router」)

AutoInstall 章の IP-to-Hostname Mapping の節の iphost hostnameip-address は、語の間の空白が無い形で、同じ章のほかの所は ip host hostname ip-address の形です(§2.4)。これは取得した本文の形で、Cisco の資料の誤りかは決めません。同じ章の client identifier の見本(§6.1)は、16 進を文字に戻すと末尾が「-Fa3/0」(大文字の F)になり、同じ段落の文の fa3/0 と大小が合いません(記事の側で計算した値)。

iPXE 章の option 61 の文の theROMMON(§6.1)と、PnP の本の節の名前 Cisco NetworkPlug and Play Agent Initialization(§2.5 の引用の出典)も、語の間の空白が無い形です。同じ iPXE 章の option 60 の文は the ROMMON の形で、同じ PnP の本のほかの所は Network Plug and Play のように Network と Plug の間に空白があります。どちらも取得した本文のまま引いており、Cisco の資料の誤りかは決めません。

15.9 表示の日付

cycle C の NEW1 の show logging の %IM-6-IOX_INST_INFO の行は、行頭の日付が Oct 30 で、行の中の日付が 09/30/2026 でした。NEW1(csr1000v 17.03.08a・RAM 4096 MB)の cycle C の後の show logging の 114 行目は以下のとおりです。

snippet
NEW1# show logging
…(省略)
*Oct 30 22:49:27.966: %IM-6-IOX_INST_INFO: R0/0: ioxman: IOX SERVICE day0guestshell LOG: Guestshell is up at 09/30/2026 22:49:27
…(省略)

§5.7 と §9.5 の時刻の並びは行頭の時刻で、IOX_INST_INFO の行の中の日時は使っていません。7-4 §13.15(行頭 Oct 19・行の中 09/19/2026)と 7-5 §15.8(行頭 Oct 26・行の中 09/26/2026)でも、Guest Shell の LOG の行の中の日付と行頭の日付の月が違っていました。並べるだけで、理由は調べていません。


16. 本節と第 7 章のまとめ

本節では、CML の configuration を空にした csr1000v 17.03.08a(NEW1・RAM 4096 MB)を Day 0 の機器として 6 回起動し、SRV1 の DHCP の pool の option を cycle ごとに替えて、機器が受けたもの・取ったもの・送ったものを撮りました。Day 0 の根拠は、CML の読み返し(configuration が空・files は iosxe_config.txt の大きさ 0 の 1 本)と、DHCP・bootfile・スクリプトの実行の行に置き、コンソールの No startup-config の行は根拠にしていません(§3・§5・§15.3)。

cycle A(HTTP)の NEW1 は、DHCP で option 67 の URL を受けました。コンソールの記録では、Attempting bootfile の行の後に、day0guestshell の activated〜RUNNING の行と配ったスクリプトの印字が並びました(見え方の順・§5.4・§5.5)。スクリプトは、Python の版を 3.6.8、スクリプトのファイルを /bootflash/guest-share/downloaded_script.py と印字しました(§5・§7)。

配ったスクリプトの configurep の行と同じ文字列の行は、ZTP の後の running-config に在り、show startup-config は startup-config is not present、show app-hosting list は No App found でした。guest-share には downloaded_script.py が残りました(§8)。cli.configure の返り値は str で、Python API 章の list(ConfigResult) とは違う型でした(§7.5)。

NEW1 の DHCP の要求は、option 60 の "ciscopnp"・option 61・option 124 を持ち、option 124 の中身は Enterprise ID 9 と CSR1000V でした(§6)。cycle C(TFTP)は option 150 と option 67 のファイル名の組み合わせで、NEW1 は tftp://10.76.0.1/ztp76c.py を取りに行くという行を出し、SRV1 の debug tftp events は ztp76c.py の行の組を残しました(§9)。資料の見本のスクリプト(cycle B)は、括弧の無い print の行で SyntaxError の行を出し、404 の cycle D のコンソールの記録は Couldn't open bootfile の行で終わりました(§10・§11)。

option 43 の cycle E の NEW1 は WEB1 の :8080 へ GET /pnp/HELLO を送り、DNS の cycle F の NEW1 は pnpserver.lab76.local を問い合わせました。cycle E・F の WEB1 の tcpdump には、4 つのファイル名の TFTP の broadcast の要求も在りました(§12)。A? devicehelper.cisco.com. の問い合わせは 6 回の cycle の WEB1 の tcpdump のどれにも在り、その先の Cisco Cloud Redirection は資料の文だけで書いています(§12.4・§13)。確かめていないことは §14 にまとめてあります。

第 7 章は、機器をプログラムから扱う方法を 6 節で扱いました。

7-1 NETCONF / RESTCONF は、NETCONF と RESTCONF で csr1000v 17.03.08a の設定と状態を WSL のプログラムから読み書きしました。NETCONF は SSH の netconf サブシステムで hello を交わし、RESTCONF は同じ資源を Accept の指定で JSON と XML に分けて返しました。candidate を有効にすると、running へ直接は書けなくなり、commit で確定する形になりました。

7-2 YANG モデル は、NETCONF と RESTCONF が運ぶデータの形を書く YANG の本文を、get-schema で機器から取り出して読みました。機器は持っているモデルを hello の capability・yang-library・schemas の 3 つの場所で名乗り、同じ Loopback0 は IETF・OpenConfig・Cisco native の 3 系統で、URL・JSON の最上位の名前・key の型が違う形で読めました。モデルに合わない値は、RESTCONF でも NETCONF でも拒まれました。

7-3 gNMI と Model-Driven Telemetry は、YANG のモデルで定めたデータを購読に応じて機器が送り出す MDT と、要求と応答の Capabilities・Get・Set と購読の Subscribe を 1 つの gRPC のサービスに持つ gNMI を扱いました。NETCONF の動的購読・CLI の設定購読・gNMI の STREAM は、どれも要求か設定で始まり、その後は機器が要求を待たずに送り出しました。

7-4 Python on Box / Guest Shell は、IOS XE の機器の上の仮想化された Linux の環境で IOx が管理する Guest Shell を扱いました。中は CentOS Linux 8 で、python3 は Python 3.6.8 でした。cli モジュールは show の表示を返し、cli.configure の戻り値は str でした。destroy → enable の後も、guest-share の印とスクリプトは残りました。

7-5 Embedded Event Manager(EEM) は、設定が入った後の機器の上で、syslog の行・timer・CLI のコマンドと event manager run を契機に、登録した applet・Tcl・Python のポリシーを動かしました。syslog の event の applet の窓では、Loopback75 の administratively down の行の 0.005 秒後に、その applet の action syslog の行が在りました。ファイルを書く Python のポリシーは、Guest Shell の /tmp と guest-share に印のファイルを書きました。

本節 7-6 は、7-5 までの設定が入った後の機器ではなく、設定が入る前の機器が、DHCP の option の指す Python のスクリプトを取って初期設定を入れるところを撮りました。スクリプトの設定の行には、7-4 の cli モジュールの configurep と configure を使っています。第 7 章は、7-1〜7-3 で機器の外のプログラムから、7-4〜7-6 で機器の上の Guest Shell・EEM・ZTP の仕組みから、設定と状態を扱いました。

第 6 章の 6-6 SD-Access (SDA) では、Catalyst Center の Provision が Plug and Play を含んでいました。6-8 §19 が触れ、7-1 §1 が 7-6 へ送ったこの Plug and Play は、本節では機器の側の振る舞い(Day 0 の機器が DHCP で受けた option・送った要求・引いた名前)までを撮りました。Catalyst Center の PnP サーバの側は、取得した出典に無く(Catalyst Center の文字列は 12 本に 0 件・数えた)、本ラボでも撮っていません(§14)。


17. 次章(第 8 章 運用/トラブル編・8-1 show と debug の使い分け)

第 7 章では、機器をプログラムから扱う方法と、設定が入る前の機器に初期設定を入れる仕組みを扱いました。次章の主題は、機器の運用とトラブルシューティングです。

第 8 章 運用/トラブル編の最初の節 8-1 は、show と debug の使い分けを扱います。conditional debug と、安全な debug の運用が主題です。

第 7 章にも、その入口がありました。本節は、Day 0 の機器の状態を show auto install trace と show pnp trace で読み、SRV1 の DHCP サーバと TFTP サーバの動きを debug ip dhcp server packet・debug ip dhcp server events・debug tftp events の行で読みました。本節では、これらを状態を読む道具として使っただけで、debug の運用の作法には触れていません。次章では、show と debug を使い分けて機器の状態を読む方法を見ていきましょう。


18. 出典

本節が参照した資料です。引用の原典 8 章(17.3.x の Programmability Configuration Guide の 5 章、17.x の System Management Configuration Guide の 2 章、16.6 の PnP agent の本)を 2026 年 10 月 30 日に取得しました。本文中の > の引用は、表の参照日の時点のページのテキストの逐語です。

NEW1 は csr1000v 17.03.08a なので、ZTP・iPXE・Guest Shell・Python の章は 17.3.x の Programmability Configuration Guide から、AutoInstall と設定の基礎の概要の章は 17.x の System Management Configuration Guide から取りました。PnP agent の本は Cisco IOS XE Everest 16.6 の版で、置き場は Cisco 4000 Series Integrated Services Routers の Configuration Guides の下です(§2.1)。

目次の 2 ページとリダイレクトの記録 2 本は、章の資料名と URL の出所で、> の引用の原典ではありません。

資料版・更新日(資料の表記)参照日URL
Programmability Configuration Guide, Cisco IOS XE Amsterdam 17.3.x — Chapter: Zero-Touch ProvisioningIOS XE Amsterdam 17.3.x・Updated: July 31, 20202026-10-30https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/173/b_173_programmability_cg/zero_touch_provisioning.html
Programmability Configuration Guide, Cisco IOS XE Amsterdam 17.3.x — Chapter: iPXEIOS XE Amsterdam 17.3.x・Updated: July 31, 20202026-10-30https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/173/b_173_programmability_cg/ipxe.html
Programmability Configuration Guide, Cisco IOS XE Amsterdam 17.3.x — Chapter: Guest ShellIOS XE Amsterdam 17.3.x・Updated: July 31, 20202026-10-30https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/173/b_173_programmability_cg/guest_shell.html
Programmability Configuration Guide, Cisco IOS XE Amsterdam 17.3.x — Chapter: Python APIIOS XE Amsterdam 17.3.x・Updated: July 31, 20202026-10-30https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/173/b_173_programmability_cg/python_api.html
Programmability Configuration Guide, Cisco IOS XE Amsterdam 17.3.x — Chapter: CLI Python ModuleIOS XE Amsterdam 17.3.x・Updated: July 31, 20202026-10-30https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/173/b_173_programmability_cg/cli_python_module.html
System Management Configuration Guide, Cisco IOS XE 17.x — Chapter: Using AutoInstall to Remotely Configure Cisco Networking DevicesIOS XE 17.x・Updated: August 21, 20232026-10-30https://www.cisco.com/c/en/us/td/docs/routers/ios/config/17-x/syst-mgmt/b-system-management/m_cf-autoinstall-0.html
System Management Configuration Guide, Cisco IOS XE 17.x — Chapter: Overview Basic Configuration of a Cisco Networking DeviceIOS XE 17.x・Updated: August 21, 20232026-10-30https://www.cisco.com/c/en/us/td/docs/routers/ios/config/17-x/syst-mgmt/b-system-management/m_cf-config-overview-0.html
Cisco Network Plug and Play Agent Configuration Guide, Cisco IOS XE Everest 16.6(置き場: Cisco 4000 Series Integrated Services Routers の Configuration Guides)IOS XE Everest 16.6・Updated: November 21, 20162026-10-30https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/pnp/configuration/xe-16-6/pnp-xe-16-6-book.html
Programmability Configuration Guide, Cisco IOS XE Amsterdam 17.3.x — 本の目次のページ(Provisioning と Shells and Scripting の章の一覧の抜き出し。引用の原典ではない)IOS XE Amsterdam 17.3.x(取得したテキストに Updated の行は無い)2026-10-30https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/173/b_173_programmability_cg.html
System Management Configuration Guide, Cisco IOS XE 17.x — 本の目次のページ(Configuration Fundamentals の章の一覧の抜き出し。引用の原典ではない)IOS XE 17.x(取得したテキストに Updated の行は無い)2026-10-30https://www.cisco.com/c/en/us/td/docs/routers/ios/config/17-x/syst-mgmt/b-system-management.html
ZTP 章が Using AutoInstall and Setup に張る Cisco IOS Release 12.2 の本の URL(リダイレクトの記録。引用の原典ではない)HTTP 200・移った先は Cisco の support の IOS & NX-OS のページ2026-10-30http://www.cisco.com/c/en/us/td/docs/ios/12_2/configfun/configuration/guide/ffun_c/fcf002.html
16.x の PnP agent の本の URL(リダイレクトの記録。引用の原典ではない)HTTP 200・移った先は Cisco の support の目次のページ2026-10-30https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/pnp/configuration/xe-16/pnp-xe-16-book.html

本文の「取得した出典に無い」は、この表の 12 本の中での話です。「12 本に 0 件」は、この 12 本の取得したテキストで文字列を数えた件数です。