Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

close
keyboard_arrow_left
BGP User Guide
Table of Contents Expand all
list Table of Contents

BGP Monitoring Protocol

date_range 20-Dec-24

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.
    content_copy zoom_out_map
    memory limit 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.
    content_copy zoom_out_map
    station-address (ip-address | station-name);
    
  3. Specify the port number for the BMP monitoring station by configuring the station-port statement.
    content_copy zoom_out_map
    station-port port-number;
    
  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.
    content_copy zoom_out_map
    statistics-timeout seconds;
    

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.
    content_copy zoom_out_map
    user@host# set routing-instances routing-instance-name description description
    
  2. Configure the routing instance for the BMP routing instance.
    content_copy zoom_out_map
    user@host# set routing-options bmp station station-name routing-instance routing-instance-name
    
  3. Configure the connection mode.
    content_copy zoom_out_map
    user@host# set routing-options bmp station station-name connection-mode (active | passive) 
    
    • If you configure passive mode, configure the following additional statements:

      content_copy zoom_out_map
      set routing-options bmp station station-name local-address ip-address
      set routing-options bmp station station-name local-port port-number
      set routing-options bmp station station-name station-address ip-address
      
    • If you configure active mode, configure at least the following additional statements:

      content_copy zoom_out_map
      set routing-options bmp station station-name station-address ip-address 
      set routing-options bmp station station-name station-port port-number
      

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.
    content_copy zoom_out_map
    user@host# set system management-instance
    
  2. Configure the routing instance under the edit routing-instances hierarchy level.
    content_copy zoom_out_map
    user@host# set routing-instances mgmt_junos description description
    
  3. Configure the routing instance for the BMP routing instance.
    content_copy zoom_out_map
    user@host# set routing-options bmp station station-name routing-instance mgmt_junos
    
  4. Configure the connection mode.
    • If you configure passive mode, configure the following additional statements:

      content_copy zoom_out_map
      set routing-options bmp station station-name connection-mode passive 
      set routing-options bmp station station-name local-address ip-address
      set routing-options bmp station station-name local-port port-number
      set routing-options bmp station station-name station-address ip-address
      
    • If you configure active mode, configure the following additional statements:

      content_copy zoom_out_map
      set routing-options bmp station station-name connection-mode active 
      set routing-options bmp station station-name station-address ip-address 
      set routing-options bmp station station-name station-port port-number
      

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.

content_copy zoom_out_map
set routing-options bmp station-address 192.168.64.180 
set routing-options bmp station-port 11019

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.

    content_copy zoom_out_map
    [edit routing-options]
    user@PE1# set bmp station-address 192.168.64.180
    
  2. Configure the receiving station port.

    content_copy zoom_out_map
    [edit routing-options]
    user@PE1# set bmp station-port 11019
    

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.

content_copy zoom_out_map
user@PE1# show routing-options
bmp {
    station-address 192.168.64.180;
    station-port 11019;
}

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
content_copy zoom_out_map
user@PE1> show bgp bmp
  BMP station address/port: 192.168.64.180+11019
  BMP session state: DOWN
   Statistics timeout: 15
   

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.

content_copy zoom_out_map
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:

  • 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.

content_copy zoom_out_map
set logical-systems A protocols bgp group internal-peers traceoptions file bgp-log 
set logical-systems A protocols bgp group internal-peers traceoptions file size 10k 
set logical-systems A protocols bgp group internal-peers traceoptions file files 2 
set logical-systems A protocols bgp group internal-peers traceoptions flag update detail

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.

    content_copy zoom_out_map
    [edit logical-systems A protocols bgp group internal-peers]
    user@host# set traceoptions file bgp-log
    user@host# set traceoptions file size 10k 
    user@host# set traceoptions file files 2 
    user@host# set traceoptions flag update detail
    
  2. If you are done configuring the device, commit the configuration.

    content_copy zoom_out_map
    [edit]
    user@host# commit
    

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.

    content_copy zoom_out_map
    user@host> file list /var/logical-systems/A
    /var/logical-systems/A:
    config/
    log/
    tmp/
  2. In operational mode on the main router, list the log files on the logical system.

    content_copy zoom_out_map
    user@host> file list /var/logical-systems/A/log/
    /var/logical-systems/A/log:
    bgp-log
  3. View the contents of the bgp-log file.

    content_copy zoom_out_map
    user@host> file show /var/logical-systems/A/log/bgp-log
    Aug 10 17:12:01 trace_on: Tracing to "/var/log/A/bgp-log" started
    Aug 10 17:14:22.826182 bgp_peer_mgmt_clear:5829: NOTIFICATION sent to 192.163.6.4 (Internal AS 17): code 6 (Cease) subcode 4 (Administratively Reset), Reason: Management session cleared BGP neighbor
    Aug 10 17:14:22.826445 bgp_send: sending 21 bytes to 192.163.6.4 (Internal AS 17)
    Aug 10 17:14:22.826499
    Aug 10 17:14:22.826499 BGP SEND 192.168.6.5+64965 -> 192.163.6.4+179
    Aug 10 17:14:22.826559 BGP SEND message type 3 (Notification) length 21
    Aug 10 17:14:22.826598 BGP SEND Notification code 6 (Cease) subcode 4 (Administratively Reset)
    Aug 10 17:14:22.831756 bgp_peer_mgmt_clear:5829: NOTIFICATION sent to 192.168.40.4 (Internal AS 17): code 6 (Cease) subcode 4 (Administratively Reset), Reason: Management session cleared BGP neighbor
    Aug 10 17:14:22.831851 bgp_send: sending 21 bytes to 192.168.40.4 (Internal AS 17)
    Aug 10 17:14:22.831901
    Aug 10 17:14:22.831901 BGP SEND 192.168.6.5+53889 -> 192.168.40.4+179
    Aug 10 17:14:22.831959 BGP SEND message type 3 (Notification) length 21
    Aug 10 17:14:22.831999 BGP SEND Notification code 6 (Cease) subcode 4 (Administratively Reset)
    ...
  4. Filter the output of the log file.

    content_copy zoom_out_map
    user@host> file show /var/logical-systems/A/log/bgp-log | match "flags 0x40"
    Aug 10 17:14:54.867460 BGP SEND flags 0x40 code Origin(1): IGP
    Aug 10 17:14:54.867595 BGP SEND flags 0x40 code ASPath(2) length 0: <null>
    Aug 10 17:14:54.867650 BGP SEND flags 0x40 code NextHop(3): 192.168.6.5
    Aug 10 17:14:54.867692 BGP SEND flags 0x40 code LocalPref(5): 100
    Aug 10 17:14:54.884529 BGP RECV flags 0x40 code Origin(1): IGP
    Aug 10 17:14:54.884581 BGP RECV flags 0x40 code ASPath(2) length 0: <null>
    Aug 10 17:14:54.884628 BGP RECV flags 0x40 code NextHop(3): 192.163.6.4
    Aug 10 17:14:54.884667 BGP RECV flags 0x40 code LocalPref(5): 100
    Aug 10 17:14:54.911377 BGP RECV flags 0x40 code Origin(1): IGP
    Aug 10 17:14:54.911422 BGP RECV flags 0x40 code ASPath(2) length 0: <null>
    Aug 10 17:14:54.911466 BGP RECV flags 0x40 code NextHop(3): 192.168.40.4
    Aug 10 17:14:54.911507 BGP RECV flags 0x40 code LocalPref(5): 100
    Aug 10 17:14:54.916008 BGP SEND flags 0x40 code Origin(1): IGP
    Aug 10 17:14:54.916054 BGP SEND flags 0x40 code ASPath(2) length 0: <null>
    Aug 10 17:14:54.916100 BGP SEND flags 0x40 code NextHop(3): 192.168.6.5
    Aug 10 17:14:54.916143 BGP SEND flags 0x40 code LocalPref(5): 100
    Aug 10 17:14:54.920304 BGP RECV flags 0x40 code Origin(1): IGP
    Aug 10 17:14:54.920348 BGP RECV flags 0x40 code ASPath(2) length 0: <null>
    Aug 10 17:14:54.920393 BGP RECV flags 0x40 code NextHop(3): 10.0.0.10
    Aug 10 17:14:54.920434 BGP RECV flags 0x40 code LocalPref(5): 100
  5. View the tracing operations in real time.

    content_copy zoom_out_map
    user@host> clear bgp neighbor logical-system A
    Cleared 2 connections
    CAUTION:

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

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

    content_copy zoom_out_map
    user@host> monitor start A/bgp-log | match 0.0.0.0/0
    Aug 10 19:21:40.773467 BGP RECV         0.0.0.0/0
    Aug 10 19:21:40.773685 bgp_rcv_nlri: 0.0.0.0/0
    Aug 10 19:21:40.773778 bgp_rcv_nlri: 0.0.0.0/0 belongs to meshgroup 
    Aug 10 19:21:40.773832 bgp_rcv_nlri: 0.0.0.0/0 qualified bnp->ribact 0x0 l2afcb 0x0
  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.

    content_copy zoom_out_map
    [Enter]
    user@host> monitor stop
  9. When you are finished troubleshooting, consider deactivating trace logging to avoid any unnecessary impact to system resources.

    content_copy zoom_out_map
    [edit protocols bgp group internal-peers]
    user@host:A# deactivate traceoptions
    user@host:A# commit
    

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

    content_copy zoom_out_map
    [edit protocols bgp group internal-peers]
    user@host:A# show
    
    type internal;
    inactive: traceoptions {
        file bgp-log size 10k files 2;
        flag update detail;
        flag all;
    }
    local-address 192.168.6.5;
    export send-direct;
    neighbor 192.163.6.4;
    neighbor 192.168.40.4;
  10. To reactivate trace operations, use the activate configuration-mode statement.

    content_copy zoom_out_map
    [edit protocols bgp group internal-peers]
    user@host:A# activate traceoptions
    user@host:A# commit
    

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.

    content_copy zoom_out_map
    [edit protocols bgp group internal-peers]
    user@host:A# deactivate traceoptions
    user@host:A# commit
    

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

    content_copy zoom_out_map
    [edit protocols bgp group internal-peers]
    user@host:A# show
    
    type internal;
    inactive: traceoptions {
        file bgp-log size 10k files 2;
        flag update detail;
        flag all;
    }
    local-address 192.168.6.5;
    export send-direct;
    neighbor 192.163.6.4;
    neighbor 192.168.40.4;
  2. To reactivate logging, use the activate configuration-mode statement.

    content_copy zoom_out_map
    [edit protocols bgp group internal-peers]
    user@host:A# activate traceoptions
    user@host:A# commit
    

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.

content_copy zoom_out_map
user@host# show logical-systems A protocols bgp group internal-peers
traceoptions {
    file bgp-log size 10k files 2;
    flag update detail;
}

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
content_copy zoom_out_map
user@host:A> show log bgp-log
Aug 12 11:20:57 trace_on: Tracing to "/var/log/A/bgp-log" started

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:

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

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.

content_copy zoom_out_map
[edit routing-options traceoptions]
user@host# show
flag task;
user@host# set traceoptions flag timer
user@host# show
flag task;
flag timer;
user@host# delete traceoptions flag task
user@host# show
flag timer;

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.

content_copy zoom_out_map
set routing-options traceoptions file routing-table-changes
set routing-options traceoptions file size 10m
set routing-options traceoptions file files 10
set routing-options traceoptions flag route
set routing-options static route 1.1.1.2/32 next-hop 10.0.45.6

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.

    content_copy zoom_out_map
    [edit routing-options traceoptions]
    user@host# set file routing-table-changes
    user@host# set file size 10m
    user@host# set file files 10
    user@host# set flag route
    
  2. Configure a static route to cause a change in the routing table.

    content_copy zoom_out_map
    [edit routing-options static]
    user@host# set route 1.1.1.2/32 next-hop 10.0.45.6
    
  3. If you are done configuring the device, commit the configuration.

    content_copy zoom_out_map
    [edit]
    user@host# commit
    

Viewing the Trace File

Step-by-Step Procedure

To view the trace file:

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

    content_copy zoom_out_map
    user@host> file list /var/log
    /var/log:
    ...
    routing-table-changes
    ...
  2. View the contents of the routing-table-changes file.

    content_copy zoom_out_map
    user@host> file show /var/log/routing-table-changes
    Dec 15 11:09:29 trace_on: Tracing to "/var/log/routing-table-changes" started
    Dec 15 11:09:29.496507
    Dec 15 11:09:29.496507 Tracing flags enabled: route
    Dec 15 11:09:29.496507
    Dec 15 11:09:29.533203 inet_routerid_notify: Router ID: 192.168.4.1
    Dec 15 11:09:29.533334 inet_routerid_notify: No Router ID assigned
    Dec 15 11:09:29.533381 inet_routerid_notify: No Router ID assigned
    Dec 15 11:09:29.533420 inet_routerid_notify: No Router ID assigned
    Dec 15 11:09:29.534915 inet_routerid_notify: Router ID: 192.168.4.1
    Dec 15 11:09:29.542934 inet_routerid_notify: No Router ID assigned
    Dec 15 11:09:29.549253 inet_routerid_notify: No Router ID assigned
    Dec 15 11:09:29.556878 inet_routerid_notify: No Router ID assigned
    Dec 15 11:09:29.582990 rt_static_reinit: examined 3 static nexthops, 0 unreferenced
    Dec 15 11:09:29.589920
    Dec 15 11:09:29.589920 task_reconfigure reinitializing done
    ...
  3. Filter the output of the log file.

    content_copy zoom_out_map
    user@host> file show /var/log/routing-table-changes | match 1.1.1.2
    Dec 15 11:15:30.780314 ADD      1.1.1.2/32          nhid 0 gw 10.0.45.6       Static   pref 5/0 metric  at-0/2/0.0 <ctive Int Ext>
    Dec 15 11:15:30.782276 KRT Request: send len 216 v104 seq 0 ADD route/user af 2 table 0 infot 0 addr 1.1.1.2 nhop-type unicast nhindex 663
  4. View the tracing operations in real time by running the monitor start command with an optional match condition.

    content_copy zoom_out_map
    user@host> monitor start routing-table-changes | match 1.1.1.2
    Aug 10 19:21:40.773467 BGP RECV         0.0.0.0/0
    Aug 10 19:21:40.773685 bgp_rcv_nlri: 0.0.0.0/0
    Aug 10 19:21:40.773778 bgp_rcv_nlri: 0.0.0.0/0 belongs to meshgroup 
    Aug 10 19:21:40.773832 bgp_rcv_nlri: 0.0.0.0/0 qualified bnp->ribact 0x0 l2afcb 0x0
  5. Deactivate the static route.

    content_copy zoom_out_map
    user@host# deactivate routing-options static route 1.1.1.2/32
    user@host# commit
    
    content_copy zoom_out_map
    *** routing-table-changes ***
    Dec 15 11:42:59.355557 CHANGE   1.1.1.2/32          nhid 663 gw 10.0.45.6       Static   pref 5/0 metric  at-0/2/0.0 <Delete Int Ext>
    Dec 15 11:42:59.426887 KRT Request: send len 216 v104 seq 0 DELETE route/user af 2 table 0 infot 0 addr 1.1.1.2 nhop-type discard filtidx 0
    Dec 15 11:42:59.427366 RELEASE  1.1.1.2/32          nhid 663 gw 10.0.45.6       Static   pref 5/0 metric  at-0/2/0.0 <Release Delete Int Ext>
  6. Halt the monitor command by pressing Enter and typing monitor stop.

    content_copy zoom_out_map
    [Enter]
    user@host> 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.

    content_copy zoom_out_map
    [edit routing-options]
    user@host# deactivate traceoptions
    user@host# commit
    
    content_copy zoom_out_map
    [edit routing-options]
    user@host# show
    
    inactive: traceoptions {
        file routing-table-changes size 10m files 10;
        flag route;
    }
    static {
        inactive: route 1.1.1.2/32 next-hop 10.0.45.6;
    }
  8. To reactivate trace operations, use the activate configuration-mode statement.

    content_copy zoom_out_map
    [edit routing-options]
    user@host# activate traceoptions
    user@host# commit
    

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.

content_copy zoom_out_map
user@host# show routing-options
traceoptions {
    file routing-table-changes size 10m files 10;
    flag route;
}
static {
    route 1.1.1.2/32 next-hop 10.0.45.6;
}

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
content_copy zoom_out_map
user@host> show log routing-table-changes
Dec 15 11:09:29 trace_on: Tracing to "/var/log/routing-table-changes" started

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:
    content_copy zoom_out_map
    traceoptions {
        file filename <files number> <size size> <world-readable | no-world-readable>;
        flag flag <flag-modifier> <disable>;
    }
    
  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.
external-footer-nav