Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[M/MX/T-series] How to SNMP traps to generate the BGP state changes on an NMS server



Article ID: KB24947 KB Last Updated: 06 Feb 2013Version: 1.0
This article provides information on how to generate BGP state SNMP traps to an NMS server by using event-options.
Whenever a change in the BGP state occurs, SNMP traps should be generated to the NMS server.  There are various methods to generate SNMP traps. But this article will focus on generating SNMP traps by using event-options:

R1----------------------R2--------------NMS server

  • R1 and R2 are IBGP peers.

  • BGP connectivity is established by using IGP via Loopback interfaces.

event-options {

    policy BGP_STATE_CHANGE {

        events rpd_bgp_neighbor_state_changed; < this will match the BGP state change in the RPD process

        then {





snmp {

    trap-options {

        source-address; < source address of the router


trap-group SNMP_BGPCHANGE {

    targets {; NMS server IP address



traceoptions {

    file snmp size 2m world-readable;

    flag all;

    flag pdu;



Use deactivate protocols bgp or interface flap and check if the SNMP trap is generated in the NMS server.
Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search