Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

BGP Monitoring Protocol

Monitoring BGP Routing Information

Purpose

Use the monitoring functionality to monitor BGP routing information on the routing device.

Action

To view BGP routing information in the CLI, enter the following commands:

  • show bgp summary

  • show bgp neighbor

Understanding the BGP Monitoring Protocol

The BGP Monitoring Protocol (BMP) is a protocol to allow a monitoring station to receive routes from a BGP-enabled device. The monitoring station receives all routes, not just the active routes. BMP uses route monitoring messages (which are essentially encapsulated BGP update messages) and a few other message types for statistics and state changes. All messages flow from the router to the monitoring station.

Note:

When an interface is disabled, the BMP that monitors the TCP session, is shut down for 240 seconds (4 minutes). This is an expected behavior.

The data is collected from the Adjacency-RIB-In routing tables. The Adjacency-RIB-In tables are the pre-policy tables, meaning that the routes in these tables have not been filtered or modified by routing policies.

Note:

The Local-RIB tables are the post-policy tables.

Starting in Junos OS Release 22.4R1, you can configure a policy to monitor routing information bases (RIBs) of type virtual router and virtual routing and forwarding (VRF). You can specify two separate sets of RIBs in the BGP Monitoring Protocol (BMP), one for monitoring and the other for reporting. With this feature, BMP can filter traffic based on the routes and routing instances.

Configuring BGP Monitoring Protocol Version 3

BGP Monitoring Protocol (BMP) allows the Junos OS to send the BGP route information from the router to a monitoring application on a separate device. The monitoring application is called the BMP monitoring station or BMP station. To deploy BMP in your network, you need to configure BMP on each router and you also need to configure at least one BMP station. This procedure describes how to configure BMP on a router.

You can specify these settings for all BMP stations by configuring the statements described here at the [edit routing-options bmp] hierarchy level. You can also configure settings for specific BMP stations by configuring these statements at the [edit routing-options bmp station station-name] hierarchy level.

The following procedure describes how to configure BMP version 3 on the router:

  1. Specify the memory limit for the BMP monitoring station by configuring the memory limit statement. The value must be in bytes.

  2. Specify the name or address for the BMP monitoring station by configuring the station-address statement. You can specify one or the other but not both. The address must be a valid IPv4 or IPv6 address.
  3. Specify the port number for the BMP monitoring station by configuring the station-port statement.
  4. Configure how often statistics messages are sent to the BMP monitoring station by specifying the number of seconds between message transmissions using statistics-timeout statement. If you configure a value of 0, no statistics messages are sent.

Configuring BGP Monitoring Protocol to Run Over a Different Routing Instance

Starting in Junos OS Release 18.3R1, you can specify which routing instance you want the BGP Monitoring Protocol (BMP) to use. Prior to Junos OS Release 18.3R1, you had to use the default routing instance. By default, in Junos OS, the management Ethernet interface (usually named fxp0 or em0) provides the out-of-band management network for the device. There is no clear separation between either out-of-band management traffic and in-band protocol control traffic, or user traffic at the routing-instance or routing-table level. Instead, all traffic is handled through the default routing instance, giving rise to concerns over security, performance, and how to troubleshoot.

Starting with Junos OS Release 17.3R1, you can configure the management interface in a non-default virtual routing and forwarding (VRF) instance, the mgmt_junos routing instance. Once you configure this management routing instance as described in Configuring the mgmt_junos Routing Instance, management traffic no longer has to share a routing table (that is, the default.inet.0 table) with other control or protocol traffic in the system. But it is only as of Junos OS Release 18.3R1 that you can use this non-default management instance for BMP. You can also use any configured routing instance for BMP. It no longer has to be the default routing instance.

Configuring a Nondefault Routing Instance for BMP

To modify the routing instance that BMP uses, you must configure the BMP station and the connection mode, which is either passive or active. In active mode, the router attempts to start the TCP connection with the BMP station. In passive mode the router waits for the BMP station to initiate the TCP session. You also must configure a port and the station address.

Note:

To use a non-default routing instance, you must configure it under the [edit routing-instances] hierarchy level.

To configure a non-default routing instance for BMP:

  1. Configure the routing instance under the edit routing-instances hierarchy level.
  2. Configure the routing instance for the BMP routing instance.
  3. Configure the connection mode.
    • If you configure passive mode, configure the following additional statements:

    • If you configure active mode, configure at least the following additional statements:

Configuring mgmt_junos for BMP

To modify the routing instance that BMP uses, you must configure the BMP station and the connection mode, which is either passive or active. In active mode, the router attempts to start the TCP connection with the BMP station. In passive mode the router waits for the BMP station to initiate the TCP session. You also must configure a port and the station address.

Note:

To use the management routing instance, you must configure it under the [edit routing-instances] hierarchy level, and you must enable it using the management-instance configuration statement.

To configure mgmt_junos as the routing-instance for BMP:

  1. Configure the non-default management routing instance.
  2. Configure the routing instance under the edit routing-instances hierarchy level.
  3. Configure the routing instance for the BMP routing instance.
  4. Configure the connection mode.
    • If you configure passive mode, configure the following additional statements:

    • If you configure active mode, configure the following additional statements:

Example: Configuring the BGP Monitoring Protocol

This example shows how to enable the BGP Monitoring Protocol (BMP). The Junos OS implementation of BMP is based on RFC 8671.

Requirements

  • Configure the router interfaces.

    Note:

    When an interface is disabled, the BMP that monitors the TCP session, is shut down for 240 seconds (4 minutes). This is an expected behaviour.

  • Configure an interior gateway protocol (IGP).

  • Configure BGP and routing policies.

  • Configure a monitoring station to listen on a particular TCP port.

Overview

To configure the monitoring station to which BMP data is sent, you must configure both the station-address and station-port statements. For the station address, you can specify either the IP address or the name of the monitoring station. For name, specify the station name. For the station port, specify a TCP port. BMP operates over TCP. The monitoring station is configured to listen on a particular TCP port, and the router is configured to establish an active connection to that port and to send messages on that TCP connection. You configure BMP in the default routing instance only. However, BMP applies to routes in the default routing instance and to routes in other routing instances.

You can optionally specify how often to send data to the monitoring station. The default is 1 minute. To modify this interval, include the statistics-timeout seconds statement. For seconds, you can specify a value from 15 through 65,535.

Topology

Figure 1 shows a sample topology. In this example, BMP is configured on Router PE1. The server address is 192.168.64.180. The listening TCP port on the server is port 11019.

Figure 1: BMP TopologyBMP Topology

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Procedure

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.

To configure BMP:

  1. Configure the receiving station address.

  2. Configure the receiving station port.

Results

From configuration mode, confirm your configuration by entering the show routing-options command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

Verification

Verifying That BMP is Operating

Purpose

Run the show bgp bmp command to display a set of statistics and the current BMP session state on the router.

Action

Understanding Trace Operations for BGP Protocol Traffic

You can trace various BGP protocol traffic to help you debug 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.

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

  • 4byte-as—4-byte AS events.

  • bfd—BFD protocol events.

  • damping—Damping operations.

  • graceful-restart—Graceful restart events.

  • keepalive—BGP keepalive messages.

  • nsr-synchronization—Nonstop active routing synchronization events.

  • open—BGP open packets. These packets are sent between peers when they are establishing a connection.

  • packets—All BGP protocol packets.

  • refresh—BGP refresh packets.

  • update—BGP update packets. These packets provide routing updates to BGP systems.

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:

  • all—All tracing operations

  • general—All normal operations and routing table changes (a combination of the normal and route trace operations)

  • normal—Normal events

  • policy—Policy processing

  • route—Routing information

  • state—State transitions

  • task—Routing protocol task processing

  • timer—Routing protocol timer processing

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

  • detail—Detailed trace information.

  • filter—Filter trace information. Applies only to route and damping tracing flags.

  • receive—Packets being received.

  • send—Packets being transmitted.

Note:

Use the all trace flag and the detail flag modifier with caution because these might 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 display 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.

Example: Viewing BGP Trace Files on Logical Systems

This example shows how to list and view files that are stored on a logical system.

Requirements

Overview

Logical systems have their individual directory structure created in the /var/logical-systems/logical-system-name directory. It contains the following subdirectories:

  • /config—Contains the active configuration specific to the logical system.

  • /log—Contains system log and tracing files specific to the logical system.

    To maintain backward compatibility for the log files with previous versions of Junos OS, a symbolic link (symlink) from the /var/logs/logical-system-name directory to the /var/logical-systems/logical-system-name directory is created when a logical system is configured.

  • /tmp—Contains temporary files specific to the logical system.

The file system for each logical system enables logical system users to view trace logs and modify logical system files. Logical system administrators have full access to view and modify all files specific to the logical system.

Logical system users and administrators can save and load configuration files at the logical-system level using the save and load configuration mode commands. In addition, they can also issue the show log, monitor, and file operational mode commands at the logical-system level.

This example shows how to configure and view a BGP trace file on a logical system. The steps can be adapted to apply to trace operations for any Junos OS hierarchy level that supports trace operations.

Tip:

To view a list of hierarchy levels that support tracing operations, enter the help apropos traceoptions command in configuration mode.

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Configuring Trace Operations

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure the trace operations:

  1. Configure trace operations on the logical system.

  2. If you are done configuring the device, commit the configuration.

Viewing the Trace File

Step-by-Step Procedure

To view the trace file:

  1. In operational mode on the main router, list the directories on the logical system.

  2. In operational mode on the main router, list the log files on the logical system.

  3. View the contents of the bgp-log file.

  4. Filter the output of the log file.

  5. View the tracing operations in real time.

    CAUTION:

    Clearing the BGP neighbor table is disruptive in a production environment.

  6. Run the monitor start command with an optional match condition.

  7. Pause the monitor command by pressing Esc-Q. To unpause the output, press Esc-Q again.

  8. Halt the monitor command by pressing Enter and typing monitor stop.

  9. When you are finished troubleshooting, consider deactivating trace logging to avoid any unnecessary impact to system resources.

    When configuration is deactivated, it appears in the configuration with the inactive tag.To reactivate trace operations, use the activate configuration-mode statement.

  10. To reactivate trace operations, use the activate configuration-mode statement.

Deactivating and Reactivating Trace Logging

Step-by-Step Procedure

To deactivate and reactivate the trace file:

  1. When you are finished troubleshooting, consider deactivating trace logging to avoid an unnecessary impact to system resources.

    When configuration is deactivated, the statement appears in the configuration with the inactive tag.

  2. To reactivate logging, use the activate configuration-mode statement.

Results

From configuration mode, confirm your configuration by entering the show logical-systems A protocols bgp group internal-peers command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

Verification

Confirm that the configuration is working properly.

Verifying That the Trace Log File Is Operating

Purpose

Make sure that events are being written to the log file.

Action

Example: Tracing Global Routing Protocol Operations

This example shows how to list and view files that are created when you enable global routing trace operations.

Requirements

You must have the view privilege.

Overview

To configure global routing protocol tracing, include the traceoptions statement at the [edit routing-options] hierarchy level:

The flags in a traceoptions flag statement are identifiers. When you use the set command to configure a flag, any flags that might already be set are not modified. In the following example, setting the timer tracing flag has no effect on the already configured task flag. Use the delete command to delete a particular flag.

This example shows how to configure and view a trace file that tracks changes in the routing table. The steps can be adapted to apply to trace operations for any Junos OS hierarchy level that supports trace operations.

Tip:

To view a list of hierarchy levels that support tracing operations, enter the help apropos traceoptions command in configuration mode.

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Configuring Trace Operations

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.

To configure the trace operations:

  1. Configure trace operations.

  2. Configure a static route to cause a change in the routing table.

  3. If you are done configuring the device, commit the configuration.

Viewing the Trace File

Step-by-Step Procedure

To view the trace file:

  1. In operational mode, list the log files on the system.

  2. View the contents of the routing-table-changes file.

  3. Filter the output of the log file.

  4. View the tracing operations in real time by running the monitor start command with an optional match condition.

  5. Deactivate the static route.

  6. Halt the monitor command by pressing Enter and typing monitor stop.

  7. When you are finished troubleshooting, consider deactivating trace logging to avoid any unnecessary impact to system resources.

    When configuration is deactivated, it appears in the configuration with the inactive tag.

  8. To reactivate trace operations, use the activate configuration-mode statement.

Results

From configuration mode, confirm your configuration by entering the show routing-options command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

Verification

Confirm that the configuration is working properly.

Verifying That the Trace Log File Is Operating

Purpose

Make sure that events are being written to the log file.

Action

Tracing BMP Operations

You can trace BMP operations for all BMP stations by configuring the traceoptions statement at the [edit routing-options bmp] hierarchy level or for specific BMP stations at the [edit routing-options bmp station station-name] hierarchy level.

To trace BMP operations, complete the following steps:

  1. Configure the traceoptions statement:
  2. Specify the name of the file to receive the output of the tracing operation using the file option. Enclose the name within quotation marks. All files are placed in the directory /var/log. We recommend that you place BMP tracing output in the file bmp-log.
  3. (Optional) Specify the maximum number of trace files using the files option. When a trace file named trace-file.0 reaches its maximum size, it is renamed trace-file.0, then trace-file.1, and so on, until the maximum number of trace files is reached. Then, the oldest trace file is overwritten. If you specify a maximum number of files, you must also specify a maximum file size with the size option.
  4. (Optional) Specify the maximum size of each trace file using the size option in kilobytes (KB), megabytes (MB), or gigabytes (GB). When a trace file named trace-file reaches this size, it is renamed trace-file.0. When the trace-file again reaches its maximum size, trace-file.0 is renamed trace-file.1 and trace-file is renamed trace-file.0. This renaming scheme continues until the maximum number of trace files is reached. Then, the oldest trace file is overwritten. If you specify a maximum file size, you also must specify a maximum number of trace files with the files option.
  5. (Optional) You can specify that the log files are either world-readable (accessible to all users on the device) or no-world-readable (not accessible to all users on the device).
  6. You can specify the following BMP-specific trace options using the flag statement:
    • all—Trace all BMP monitoring operations.

    • down—Down messages.

    • error—Error conditions.

    • event—Major events, station establishment, errors, and events.

    • general—General events.

    • normal—Normal events.

    • packets—All messages.

    • policy—Policy processing.

    • route—Routing information.

    • route-monitoring—Route monitoring messages.

    • state—State transitions.

    • statistics—Statistics messages.

    • task—Routing protocol task processing.

    • timer—Routing protocol timer processing.

    • up—Up messages.

    • write—Writing of messages.

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

    • detail—Provide detailed trace information.

    • disable—Disable the tracing flag.

    • receive—Trace the packets being received.

    • send—Trace the packets being transmitted.

    Note:

    Use the all trace flag and the detail flag modifier with caution due to the increased computer processing power required.

Change History Table

Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.

Release
Description
18.3R1
Starting in Junos OS Release 18.3R1, you can specify which routing instance you want the BGP Monitoring Protocol (BMP) to use.