show ndp サブコマンド¶
概要¶
show ndp は IPv6 の Neighbor Discovery テーブルを表示する click コマンド。show arp と対称な実装で、内部では scripts/nbrshow を -6 付きで起動する1。
シグネチャ¶
| オプション | 意味 |
|---|---|
<ip6address> (positional, optional) |
絞り込む IPv6 アドレス |
-if, --iface |
インタフェース名フィルタ |
-n, --namespace |
multi-ASIC 時の namespace |
-d, --display |
表示スコープ (all / frontend など) |
--verbose |
起動コマンド文字列を echo |
起動コマンド¶
cmd = ['nbrshow', '-6']
if ip6address: cmd += ['-ip', str(ip6address)]
if iface: cmd += ['-if', str(iface)]
if namespace: cmd += ['-n', str(namespace)]
cmd += ['-d', str(display)]
注意: show arp 側は alias モード時に iface_alias_converter.alias_to_name() でインタフェース名を変換するロジックがあるが、show ndp 側にはそれが無い。alias モード環境で -if を使う場合、内部名(例: Ethernet0)を直接指定する必要がある。
別名と関連¶
show ipv6 グループにも add_command(ndp) されており、show ipv6 neighbors 系のサブコマンド経由でも近い情報が引ける。
クリア側は sonic-clear ndp [<ipaddress>] [-n <ns>]。詳細は clear (sonic-clear) コマンド を参照。
CONFIG_DB との接点¶
NDP テーブルは kernel の IPv6 neighbor table および swss/neighsyncd で APPL_DB に同期されるもので、CONFIG_DB を読まない。
データフロー (自動生成)¶
flowchart LR
CLI["show ndp"]
SRC0[("APP_DB<br/>NEIGH_TABLE")]
V0["nbrshow (-6)"]
SRC0 --> V0 --> CLI
凡例
show 系 (データソース → ラッパスクリプト → CLI) のミニ図。CONFIG_DB は経由しない。
関連リファレンス¶
- (関連リンクなし)
引用元¶
運用ヒント¶
典型的な利用シーン¶
- IPv6 隣接の NS/NA 状態確認、SLAAC 動作検証。
よくある落とし穴¶
- Link-local アドレスは scope 付き表示。
fe80::xxx%Ethernet0の%以降は interface scope。 - Duplicate Address Detection (DAD) 失敗時は state が
FAILEDで kernel に残る。
関連する show / debug¶
関連 CLI コマンド¶
config bgp— config bgp サブコマンドconfig default route— config default-route(デフォルトルート設定パターン)config route— config route サブコマンド(static route)config vrf— config vrf サブコマンドshow arp— show arp サブコマンド
-
ndpの click 定義とnbrshow -6起動はshow/main.pyL452-L472。https://github.com/sonic-net/sonic-utilities/blob/39732bceb8bdefe706518ab40623bbbba6ff33b9/show/main.py#L452 ↩