Tracing BGP Protocol Traffic

You can trace various BGP protocol traffic to help you debug the BGP protocol issues. To trace BGP protocol traffic include the traceoptions statement at the [edit protocols bgp] hierarchy level. For routing instances, include the traceoptions statement at the [edit routing-instances routing-instance-name protocols bgp] hierarchy level.

traceoptions {file filename <files number> <size size> <world-readable | no-world-readable>;flag flag <flag-modifier> <disable>;}

You can specify the following BGP protocol-specific trace options using the flag statement:

Global tracing options are inherited from the configuration set by the traceoptions statement at the [edit routing-options] hierarchy level. You can override the following global trace options for the BGP protocol using the traceoptions flag statement included at the [edit protocols bgp] hierarchy level:

You can optionally specify one or more of the following flag modifiers:

Note: Use the all trace flag and the detail flag modifier with caution as these may cause the CPU to become very busy.

Note: If you only enable the update flag, received keepalive messages do not generate a trace message.

You can filter trace statements and output only the statement information that passes through the filter by specifying the filter flag modifier. The filter modifier is only supported for the route and damping tracing flags.

The match-on statement specifies filter matches based on prefixes. It is used to match on route filters.

Note: Per-neighbor trace filtering is not supported on a BGP per-neighbor level for route and damping flags. Trace option filtering support is on a peer group level.

Examples: Tracing BGP Protocol Traffic

Trace only unusual or abnormal operations to routing-log, and trace detailed information about all BGP messages to bgp-log:

[edit]routing-options {traceoptions {file routing-log;}autonomous-system 23;}protocols {bgp {group 23 {type external;peer-as 56;traceoptions {file bgp-log size 10k files 5;flag packets detail;}0.0.0.0/0;}}}

Trace only update messages received from the configured peer:

[edit]routing-options {autonomous-system 23;router-id 10.0.0.1;}protocols {bgp {group 23 {type external;peer-as 56;neighbor boojum.snark.net {traceoptions {file bgp-log size 10k files 2;flag update detail;}}}}}

Trace only messages that pass the policy based on prefix match:

[edit]protocols {bgp {traceoptions {file bgp-tr size 5m files 10;flag route filter policy couple-route match-on prefix;}}}

Related Topics