はじめに
本ドキュメントでは IOS-XE において利用可能な BGP の event-trace 機能について紹介します。
※本ドキュメントでは、ドキュメント用 IP address および AS 番号を使用しています。
使用方法
BGP の event-trace 機能は exec mode でコマンドを実行することよって記録されるようになります。パラメータの設定はconfiguration mode で行います。デフォルトでは 10000 イベント記録することができます。
機能が有効になっているかどうかは show monitor event-trace bgp all コマンドを実行して確認します。"Tracing currently disabled, from exec command" と出力される場合は無効となっていますので、monitor event-trace bgp neighbor enable コマンドで有効にします。
機能が有効になっていると、show monitor event-trace bgp all コマンドを実行した場合、何も出力されないか、それまでに記録されたイベントが出力されるようになります。
R2#
R2#show monitor event-trace bgp all
Tracing currently disabled, from exec command
R2#
R2#monitor event-trace bgp neighbor enable
R2#
R2#show monitor event-trace bgp all
R2#
出力例
おおむね debug ip bgp 相当の内容を記録しています。そのため、BGP の Peer の確立に問題がある場合などに有用なコマンドとなります。debug に比べ負荷も少ないので、Peer 数が多い場合にも利用できます。
以下の出力は、機能を有効にした後に BGP peer を clear ip bgp * コマンドでリセットした場合の出力の一部です。
R2#clear ip bgp *
R2#
R2#show monitor event-trace bgp all detail
05:25:55.765: 198.51.100.1 went from Established to Closing
05:25:55.765: 198.51.100.18 went from Established to Closing
05:25:55.765: 198.51.100.34 went from Established to Closing
05:25:55.770: 198.51.100.1 Active open failed - no topologies available
05:25:55.770: 198.51.100.18 Active open failed - no topologies available
05:25:55.770: 198.51.100.34 Active open failed - no topologies available
05:25:55.843: Session close and reset neighbor 198.51.100.1 topostate
05:25:55.843: 198.51.100.1 went from Closing to Idle
05:25:55.843: 198.51.100.1 Open active delayed 8192ms (35000ms max, 60%
jitter)
05:25:55.843: Session close and reset neighbor 198.51.100.18 topostate
05:25:55.843: 198.51.100.18 went from Closing to Idle
05:25:55.844: 198.51.100.18 Open active delayed 12288ms (35000ms max,
60% jitter)
05:25:55.844: Session close and reset neighbor 198.51.100.34 topostate
出力は、neighbor address や時刻で絞り込んで出力することも可能です。 Peer 数が多い場合や、確認したいイベントの発生時刻がわかる場合等にご活用ください。以下の例では、neighbor 198.51.100.1 に対する 05:26 以降のイベントを指定して出力しています。
R2#show monitor event-trace bgp neighbors ?
A.B.C.D Neighbor to display information about
X:X:X:X::X IPv6 neighbor to display information about
R2#show monitor event-trace bgp neighbors 198.51.100.1 ?
all Show all the traces in current buffer
back Show trace from this far back in the past
clock Show trace from a specific clock time/date
from-boot Show trace from this many seconds after booting
latest Show latest trace events since last display
R2#show monitor event-trace bgp neighbors 198.51.100.1 clock 05:26
05:26:03.583: 198.51.100.1 went from Idle to Active
05:26:03.594: 198.51.100.1 went from Active to OpenSent
05:26:03.594: 198.51.100.1 sending OPEN, version 4, my as: 64502,
holdtime 180 seconds, ID C0000202
05:26:03.597: 198.51.100.1 rcv OPEN w/ OPTION parameter len: 28
設定変更
記録するイベント数の変更は configuration mode から行います。1-1000000 の範囲で設定することができます。
R2(config)#monitor event-trace bgp neighbor size ?
<1-1000000> Number of entries in trace
R2(config)#monitor event-trace bgp neighbor size 50000
R2(config)#
参考資料
Maintenance Function: BGP Routing Protocol