[Contents] [Prev] [Next] [Index] [Report an Error]

Tracing BGP Protocol Traffic

To trace BGP protocol traffic, you can specify options in the global traceoptions statement at the [edit routing-options] hierarchy level, and you can specify BGP-specific options by including the traceoptions statement at the [edit protocols bgp] hierarchy level. For routing instances, include the statement.

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

For a list of hierarchy levels at which you can configure this statement, see the statement summary section for this statement.

You can specify the following BGP-specific options in the BGP traceoptions statement:

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.

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.

Note: Use the trace flags detail and all with caution. These flags may cause the CPU to become very busy.

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

For general information about tracing, see the tracing and logging information in the JUNOS System Basics Configuration Guide.

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;
}
}
}

[Contents] [Prev] [Next] [Index] [Report an Error]