BGP - Routing Policy Guidepdf PDF
BGP - Routing Policy Guidepdf PDF
Release
13.2
Published: 2013-07-22
This product includes memory allocation software developed by Mark Moraes, copyright © 1988, 1989, 1993, University of Toronto.
This product includes FreeBSD software developed by the University of California, Berkeley, and its contributors. All of the documentation
and software included in the 4.4BSD and 4.4BSD-Lite Releases is copyrighted by the Regents of the University of California. Copyright ©
1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994. The Regents of the University of California. All rights reserved.
GateD software copyright © 1995, the Regents of the University. All rights reserved. Gate Daemon was originated and developed through
release 3.0 by Cornell University and its collaborators. Gated is based on Kirton’s EGP, UC Berkeley’s routing daemon (routed), and DCN’s
HELLO routing protocol. Development of Gated has been supported in part by the National Science Foundation. Portions of the GateD
software copyright © 1988, Regents of the University of California. All rights reserved. Portions of the GateD software copyright © 1991, D.
L. S. Associates.
This product includes software developed by Maker Communications, Inc., copyright © 1996, 1997, Maker Communications, Inc.
Juniper Networks, Junos, Steel-Belted Radius, NetScreen, and ScreenOS are registered trademarks of Juniper Networks, Inc. in the United
States and other countries. The Juniper Networks Logo, the Junos logo, and JunosE are trademarks of Juniper Networks, Inc. All other
trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Juniper Networks assumes no responsibility for any inaccuracies in this document. Juniper Networks reserves the right to change, modify,
transfer, or otherwise revise this publication without notice.
Products made or sold by Juniper Networks or components thereof might be covered by one or more of the following patents that are
owned by or licensed to Juniper Networks: U.S. Patent Nos. 5,473,599, 5,905,725, 5,909,440, 6,192,051, 6,333,650, 6,359,479, 6,406,312,
6,429,706, 6,459,579, 6,493,347, 6,538,518, 6,538,899, 6,552,918, 6,567,902, 6,578,186, and 6,590,785.
®
Junos OS BGP Feature Guide for Routing Devices
13.2
Copyright © 2013, Juniper Networks, Inc.
All rights reserved.
The information in this document is current as of the date on the title page.
Juniper Networks hardware and software products are Year 2000 compliant. Junos OS has no known time-related limitations through the
year 2038. However, the NTP application is known to have some difficulty in the year 2036.
The Juniper Networks product that is the subject of this technical documentation consists of (or is intended for use with) Juniper Networks
software. Use of such software is subject to the terms and conditions of the End User License Agreement (“EULA”) posted at
http://www.juniper.net/support/eula.html. By downloading, installing or using such software, you agree to the terms and conditions of
that EULA.
Part 1 Overview
Chapter 1 Introduction to BGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Understanding BGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Autonomous Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
AS Paths and Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
External and Internal BGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Multiple Instances of BGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
BGP Routes Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
BGP Messages Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Open Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Update Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Keepalive Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Notification Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Understanding BGP Path Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Routing Table Path Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Effects of Advertising Multiple Paths to a Destination . . . . . . . . . . . . . . . . . . . 11
Chapter 2 BGP Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Supported BGP Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Part 2 Configuration
Chapter 3 Basic BGP Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Examples: Configuring External BGP Peering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Understanding External BGP Peering Sessions . . . . . . . . . . . . . . . . . . . . . . . . 19
Example: Configuring External BGP Point-to-Point Peer Sessions . . . . . . . . 20
Example: Configuring External BGP on Logical Systems with IPv6
Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Examples: Configuring Internal BGP Peering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Understanding Internal BGP Peering Sessions . . . . . . . . . . . . . . . . . . . . . . . . 42
Example: Configuring Internal BGP Peer Sessions . . . . . . . . . . . . . . . . . . . . . 43
Example: Configuring Internal BGP Peering Sessions on Logical Systems . . 54
Chapter 4 BGP Path Attribute Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Example: Configuring BGP Local Preference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Understanding the BGP Local Preference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Example: Configuring the Local Preference Value for BGP Routes . . . . . . . . 66
Examples: Configuring BGP MED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Understanding the MED Attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Example: Configuring the MED Attribute Directly . . . . . . . . . . . . . . . . . . . . . . . 81
Example: Configuring the MED Using Route Filters . . . . . . . . . . . . . . . . . . . . . 93
Example: Configuring the MED Using Communities . . . . . . . . . . . . . . . . . . . 106
Example: Associating the MED Path Attribute with the IGP Metric and
Delaying MED Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Examples: Configuring BGP Local AS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Understanding the BGP Local AS Attribute . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Example: Configuring a Local AS for EBGP Sessions . . . . . . . . . . . . . . . . . . . 121
Example: Configuring a Private Local AS for EBGP Sessions . . . . . . . . . . . . . 131
Example: Configuring the Accumulated IGP Attribute for BGP . . . . . . . . . . . . . . 136
Understanding the Accumulated IGP Attribute for BGP . . . . . . . . . . . . . . . . 137
Example: Configuring the Accumulated IGP Attribute for BGP . . . . . . . . . . . 137
Example: Configuring AS Override . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Understanding AS Override . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Example: Configuring a Layer 3 VPN with Route Reflection and AS
Override . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Example: Disabling Suppression of Route Advertisements . . . . . . . . . . . . . . . . . 185
Chapter 5 BGP Policy Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Example: Applying Routing Policies at Different Levels of the BGP Hierarchy . . . 193
Example: Configuring BGP Interactions with IGPs . . . . . . . . . . . . . . . . . . . . . . . . 202
Understanding Routing Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Example: Injecting OSPF Routes into the BGP Routing Table . . . . . . . . . . . 202
Example: Redistributing BGP Routes with a Specific Community Tag into
IS-IS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Understanding BGP Communities and Extended Communities as Routing
Policy Match Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Example: Redistributing BGP Routes with a Specific Community Tag into
IS-IS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Part 3 Administration
Chapter 15 BGP Operational Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
clear bgp damping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
clear bgp neighbor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743
Part 4 Troubleshooting
Chapter 16 BGP Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 969
Understanding Hidden Routes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 970
Checklist for Verifying the BGP Protocol and Peers . . . . . . . . . . . . . . . . . . . . . . . . 971
Checklist for Checking the BGP Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 972
Checking the BGP Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 972
Check That BGP Traffic Is Using the LSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 974
Check BGP Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 975
Verify the BGP Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 977
Examine BGP Routes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 983
Verify Received BGP Routes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 984
Take Appropriate Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 985
Check That BGP Traffic Is Using the LSP Again . . . . . . . . . . . . . . . . . . . . . . 986
Check BGP Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 987
Verify BGP Peers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 989
Verify the BGP Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 990
Verify the BGP Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 992
Display Sent or Received BGP Packets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 998
Diagnose BGP Session Establishment Problems . . . . . . . . . . . . . . . . . . . . . . . . 999
Examine BGP Routes and Route Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1000
Examine the Local Preference Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . 1002
Examine the Multiple Exit Discriminator Route Selection . . . . . . . . . . . . . . 1003
Examine the EBGP over IBGP Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1003
Examine the IGP Cost Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1005
Examine Routes in the Forwarding Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1006
Log BGP State Transition Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1007
Display Detailed BGP Protocol Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1009
Verify Received BGP Routes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1011
Verify That a Particular BGP Route Is Received on Your Router . . . . . . . . . . . . . . 1011
Check That BGP Traffic Is Using the LSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1012
Check That BGP Traffic Is Using the LSP Again . . . . . . . . . . . . . . . . . . . . . . . . . . 1013
Examine the EBGP over IBGP Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1014
Verify BGP on an Internal Router . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1015
Verify BGP on a Border Router . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1018
Chapter 17 Routing Protocol Process Memory FAQs . . . . . . . . . . . . . . . . . . . . . . . . . . . 1023
Routing Protocol Process Memory FAQs Overview . . . . . . . . . . . . . . . . . . . . . . . 1023
Routing Protocol Process Memory FAQs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1024
Frequently Asked Questions: Routing Protocol Process Memory . . . . . . . . 1024
Frequently Asked Questions: Interpreting Routing Protocol Process-Related
Command Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1025
Frequently Asked Questions: Routing Protocol Process Memory
Swapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1028
Frequently Asked Questions: Troubleshooting the Routing Protocol
Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1029
Part 5 Index
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1033
Part 2 Configuration
Chapter 3 Basic BGP Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 2: BGP Peering Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 3: Typical Network with BGP Peer Sessions . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 4: Typical Network with BGP Peer Sessions . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 5: Internal and External BGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 6: Typical Network with IBGP Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Figure 7: Typical Network with IBGP Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Chapter 4 BGP Path Attribute Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Figure 8: Typical Network with IBGP Sessions and Multiple Exit Points . . . . . . . . 66
Figure 9: Default MED Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Figure 10: Typical Network with IBGP Sessions and Multiple Exit Points . . . . . . . . 82
Figure 11: Typical Network with IBGP Sessions and Multiple Exit Points . . . . . . . . 94
Figure 12: Topology for Delaying the MED Update . . . . . . . . . . . . . . . . . . . . . . . . . 108
Figure 13: Local AS Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Figure 14: Topology for Configuring the Local AS . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Figure 15: Topology for Configuring a Private Local AS . . . . . . . . . . . . . . . . . . . . . 132
Figure 16: Advertisement of Multiple Paths in BGP . . . . . . . . . . . . . . . . . . . . . . . . 139
Figure 17: AS Override Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Figure 18: BGP Topology for advertise-peer-as . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Chapter 5 BGP Policy Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Figure 19: Applying Routing Policies to BGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Figure 20: Redistributing BGP Routes with a Specific Community Tag into
IS-IS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Figure 21: BGP Prefix-Based Outbound Route Filtering . . . . . . . . . . . . . . . . . . . . 220
Figure 22: Typical Network with EBGP Multihop Sessions . . . . . . . . . . . . . . . . . . 224
Figure 23: BGP Preference Value Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Figure 24: Topology for Ignoring the AS-Path Lengh . . . . . . . . . . . . . . . . . . . . . . 244
Figure 25: Topology for Removing a Private AS from the Advertised AS Path . . . 251
Figure 26: BGP Import and Export Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Figure 27: Conditional Installation of Prefixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Figure 28: BGP Topology for advertise-inactive . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Figure 29: BGP Topology for advertise-external . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Figure 30: BGP Topology for advertise-peer-as . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Part 4 Troubleshooting
Chapter 16 BGP Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 969
Figure 62: Checking the BGP Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973
Figure 63: MPLS Network Broken at the BGP Layer . . . . . . . . . . . . . . . . . . . . . . . 974
Figure 64: BGP Network Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 989
Part 2 Configuration
Chapter 4 BGP Path Attribute Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Table 3: MED Options for Routing Table Path Selection . . . . . . . . . . . . . . . . . . . . 80
Chapter 5 BGP Policy Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Table 4: Default Route Preference Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Chapter 8 IBGP Scaling Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Table 5: Rules for Route Reflectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Chapter 10 BGP Flap Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
Table 6: Damping Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
Chapter 11 Multiprotocol BGP Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
Table 7: Flow Route Match Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Table 8: Flow Route Action Modifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Part 3 Administration
Chapter 15 BGP Operational Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
Table 9: show bgp bmp Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
Table 10: show bgp group Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
Table 11: show bgp group traffic-statistics Output Fields . . . . . . . . . . . . . . . . . . . 769
Table 12: show bgp neighbor Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
Table 13: show bgp replication Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
Table 14: show bgp summary Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
Table 15: show policy damping Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
Table 16: show policy Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
Table 17: show policy conditions Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . 796
Table 18: show policy damping Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
Table 19: show route Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
Table 20: show route advertising-protocol Output Fields . . . . . . . . . . . . . . . . . . . 812
Table 21: show route damping Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829
Table 22: show route detail Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
Table 23: Next-hop Types Output Field Values . . . . . . . . . . . . . . . . . . . . . . . . . . 839
Table 24: State Output Field Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
Table 25: Communities Output Field Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
Part 4 Troubleshooting
Chapter 16 BGP Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 969
Table 38: Checklist for Verifying the BGP Protocol and Peers . . . . . . . . . . . . . . . . 971
Table 39: Checklist for Checking the BGP Layer . . . . . . . . . . . . . . . . . . . . . . . . . . 972
Table 40: Six States of a BGP Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1007
Table 41: BGP Protocol Tracing Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1010
Chapter 17 Routing Protocol Process Memory FAQs . . . . . . . . . . . . . . . . . . . . . . . . . . . 1023
Table 42: show system processes extensive Output Fields . . . . . . . . . . . . . . . . 1026
Table 43: show task memory Output Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1027
If the information in the latest release notes differs from the information in the
documentation, follow the product Release Notes.
Juniper Networks Books publishes books by Juniper Networks engineers and subject
matter experts. These books go beyond the technical documentation to explore the
nuances of network architecture, deployment, and administration. The current list can
be viewed at http://www.juniper.net/books.
Supported Platforms
For the features described in this document, the following platforms are supported:
• ACX Series
• J Series
• SRX Series
• T Series
• MX Series
• M Series
If you want to use the examples in this manual, you can use the load merge or the load
merge relative command. These commands cause the software to merge the incoming
configuration into the current candidate configuration. The example does not become
active until you commit the candidate configuration.
If the example configuration contains the top level of the hierarchy (or multiple
hierarchies), the example is a full example. In this case, use the load merge command.
If the example configuration does not start at the top level of the hierarchy, the example
is a snippet. In this case, use the load merge relative command. These procedures are
described in the following sections.
1. From the HTML or PDF version of the manual, copy a configuration example into a
text file, save the file with a name, and copy the file to a directory on your routing
platform.
For example, copy the following configuration to a file and name the file ex-script.conf.
Copy the ex-script.conf file to the /var/tmp directory on your routing platform.
system {
scripts {
commit {
file ex-script.xsl;
}
}
}
interfaces {
fxp0 {
disable;
unit 0 {
family inet {
address 10.0.0.1/24;
}
}
}
}
2. Merge the contents of the file into your routing platform configuration by issuing the
load merge configuration mode command:
[edit]
user@host# load merge /var/tmp/ex-script.conf
load complete
Merging a Snippet
To merge a snippet, follow these steps:
1. From the HTML or PDF version of the manual, copy a configuration snippet into a text
file, save the file with a name, and copy the file to a directory on your routing platform.
For example, copy the following snippet to a file and name the file
ex-script-snippet.conf. Copy the ex-script-snippet.conf file to the /var/tmp directory
on your routing platform.
commit {
file ex-script-snippet.xsl; }
2. Move to the hierarchy level that is relevant for this snippet by issuing the following
configuration mode command:
[edit]
user@host# edit system scripts
[edit system scripts]
3. Merge the contents of the file into your routing platform configuration by issuing the
load merge relative configuration mode command:
For more information about the load command, see the CLI User Guide.
Documentation Conventions
Caution Indicates a situation that might result in loss of data or hardware damage.
Laser warning Alerts you to the risk of personal injury from a laser.
Table 2 on page xxii defines the text and syntax conventions used in this guide.
Bold text like this Represents text that you type. To enter configuration mode, type
theconfigure command:
user@host> configure
Fixed-width text like this Represents output that appears on the user@host> show chassis alarms
terminal screen.
No alarms currently active
Italic text like this • Introduces or emphasizes important • A policy term is a named structure
new terms. that defines match conditions and
• Identifies book names. actions.
• Junos OS System Basics Configuration
• Identifies RFC and Internet draft titles.
Guide
• RFC 1997, BGP Communities Attribute
Italic text like this Represents variables (options for which Configure the machine’s domain name:
you substitute a value) in commands or
configuration statements. [edit]
root@# set system domain-name
domain-name
Text like this Represents names of configuration • To configure a stub area, include the
statements, commands, files, and stub statement at the[edit protocols
directories; configuration hierarchy levels; ospf area area-id] hierarchy level.
or labels on routing platform • The console port is labeled CONSOLE.
components.
< > (angle brackets) Enclose optional keywords or variables. stub <default-metric metric>;
# (pound sign) Indicates a comment specified on the rsvp { # Required for dynamic MPLS only
same line as the configuration statement
to which it applies.
[ ] (square brackets) Enclose a variable for which you can community name members [
substitute one or more values. community-ids ]
GUI Conventions
Bold text like this Represents graphical user interface (GUI) • In the Logical Interfaces box, select
items you click or select. All Interfaces.
• To cancel the configuration, click
Cancel.
> (bold right angle bracket) Separates levels in a hierarchy of menu In the configuration editor hierarchy,
selections. select Protocols>Ospf.
Documentation Feedback
Technical product support is available through the Juniper Networks Technical Assistance
Center (JTAC). If you are a customer with an active J-Care or JNASC support contract,
or are covered under warranty, and need post-sales technical support, you can access
our tools and resources online or open a case with JTAC.
• JTAC hours of operation—The JTAC centers have resources available 24 hours a day,
7 days a week, 365 days a year.
• Find solutions and answer questions using our Knowledge Base: http://kb.juniper.net/
To verify service entitlement by product serial number, use our Serial Number Entitlement
(SNE) Tool: https://tools.juniper.net/SerialNumberEntitlementSearch/
Overview
• Introduction to BGP on page 3
• BGP Standards on page 13
Introduction to BGP
Understanding BGP
BGP is an exterior gateway protocol (EGP) that is used to exchange routing information
among routers in different autonomous systems (ASs). BGP routing information includes
the complete route to each destination. BGP uses the routing information to maintain a
database of network reachability information, which it exchanges with other BGP systems.
BGP uses the network reachability information to construct a graph of AS connectivity,
which enables BGP to remove routing loops and enforce policy decisions at the AS level.
Multiprotocol BGP (MBGP) extensions enable BGP to support IP version 6 (IPv6). MBGP
defines the attributes MP_REACH_NLRI and MP_UNREACH_NLRI, which are used to carry
IPv6 reachability information. Network layer reachability information (NLRI) update
messages carry IPv6 address prefixes of feasible routes.
BGP allows for policy-based routing. You can use routing policies to choose among
multiple paths to a destination and to control the redistribution of routing information.
BGP uses TCP as its transport protocol, using port 179 for establishing connections.
Running over a reliable transport protocol eliminates the need for BGP to implement
update fragmentation, retransmission, acknowledgment, and sequencing.
The Junos OS routing protocol software supports BGP version 4. This version of BGP
adds support for Classless Interdomain Routing (CIDR), which eliminates the concept
of network classes. Instead of assuming which bits of an address represent the network
by looking at the first octet, CIDR allows you to explicitly specify the number of bits in
the network address, thus providing a means to decrease the size of the routing tables.
BGP version 4 also supports aggregation of routes, including the aggregation of AS paths.
Autonomous Systems
An autonomous system (AS) is a set of routers that are under a single technical
administration and normally use a single interior gateway protocol and a common set
of metrics to propagate routing information within the set of routers. To other ASs, an
AS appears to have a single, coherent interior routing plan and presents a consistent
picture of what destinations are reachable through it.
A BGP system shares network reachability information with adjacent BGP systems, which
are referred to as neighbors or peers.
BGP systems are arranged into groups. In an IBGP group, all peers in the group—called
internal peers—are in the same AS. Internal peers can be anywhere in the local AS and
do not have to be directly connected to one another. Internal groups use routes from an
IGP to resolve forwarding addresses. They also propagate external routes among all
other internal routers running IBGP, computing the next hop by taking the BGP next hop
received with the route and resolving it using information from one of the interior gateway
protocols.
In an EBGP group, the peers in the group—called external peers—are in different ASs and
normally share a subnet. In an external group, the next hop is computed with respect to
the interface that is shared between the external peer and the local router.
Multiple instances of BGP are primarily used for Layer 3 VPN support.
IGP peers and external BGP (EBGP) peers (both nonmultihop and multihop) are all
supported for routing instances. BGP peering is established over one of the interfaces
configured under the routing-instances hierarchy.
NOTE: When a BGP neighbor sends BGP messages to the local routing device,
the incoming interface on which these messages are received must be
configured in the same routing instance that the BGP neighbor configuration
exists in. This is true for neighbors that are a single hop away or multiple hops
away.
Routes learned from the BGP peer are added to the instance-name.inet.0 table by default.
You can configure import and export policies to control the flow of information into and
out of the instance routing table.
For Layer 3 VPN support, configure BGP on the provider edge (PE) router to receive routes
from the customer edge (CE) router and to send the instances’ routes to the CE router
if necessary. You can use multiple instances of BGP to maintain separate per-site
forwarding tables for keeping VPN traffic separate on the PE router.
You can configure import and export policies that allow the service provider to control
and rate-limit traffic to and from the customer.
You can configure an EBGP multihop session for a VRF routing instance. Also, you can
set up the EBGP peer between the PE and CE routers by using the loopback address of
the CE router instead of the interface addresses.
• AS path, which is a list of numbers of the ASs that a route passes through to reach the
local router. The first number in the path is that of the last AS in the path—the AS
closest to the local router. The last number in the path is the AS farthest from the local
router, which is generally the origin of the path.
• Path attributes, which contain additional information about the AS path that is used
in routing policy.
BGP stores its routes in the Junos OS routing table (inet.0). The routing table stores the
following information about BGP routes:
• Local routing information that BGP applies to routes because of local policies
For each prefix in the routing table, the routing protocol process selects a single best
path, called the active path. Unless you configure BGP to advertise multiple paths to the
same destination, BGP advertises only the active path.
The BGP router that first advertises a route assigns it one of the following values to
identify its origin. During route selection, the lowest origin value is preferred.
• 0—The router originally learned the route through an IGP (OSPF, IS-IS, or a static route).
• 1—The router originally learned the route through an EGP (most likely BGP).
All BGP messages have the same fixed-size header, which contains a marker field that
is used for both synchronization and authentication, a length field that indicates the
length of the packet, and a type field that indicates the message type (for example, open,
update, notification, keepalive, and so on).
Open Messages
After a TCP connection is established between two BGP systems, they exchange BGP
open messages to create a BGP connection between them. Once the connection is
established, the two systems can exchange BGP messages and data traffic.
Open messages consist of the BGP header plus the following fields:
• Hold time—Proposed hold-time value. You configure the local hold time with the BGP
hold-time statement.
• BGP identifier—IP address of the BGP system. This address is determined when the
system starts and is the same for every local interface and every BGP peer. You can
configure the BGP identifier by including the router-id statement at the [edit
routing-options] or [edit logical-systems logical-system-name routing-options] hierarchy
level. By default, BGP uses the IP address of the first interface it finds in the router.
• Parameter field length and the parameter itself—These are optional fields.
Update Messages
BGP systems send update messages to exchange network reachability information. BGP
systems use this information to construct a graph that describes the relationships among
all known ASs.
Update messages consist of the BGP header plus the following optional fields:
• Withdrawn routes—IP address prefixes for the routes being withdrawn from service
because they are no longer deemed reachable
• Total path attribute length—Length of the path attributes field; it lists the path attributes
for a feasible route to a destination
• Path attributes—Properties of the routes, including the path origin, the multiple exit
discriminator (MED), the originating system’s preference for the route, and information
about aggregation, communities, confederations, and route reflection
Keepalive Messages
BGP systems exchange keepalive messages to determine whether a link or host has
failed or is no longer available. Keepalive messages are exchanged often enough so that
the hold timer does not expire. These messages consist only of the BGP header.
Notification Messages
BGP systems send notification messages when an error condition is detected. After the
message is sent, the BGP session and the TCP connection between the BGP systems
are closed. Notification messages consist of the BGP header plus the error code and
subcode, and data that describes the error.
For each prefix in the routing table, the routing protocol process selects a single best
path. After the best path is selected, the route is installed in the routing table. The best
path becomes the active route if the same prefix is not learned by a protocol with a lower
(more preferred) global preference value, also known as the administrative distance.
The algorithm for determining the active route is as follows:
2. Choose the path with the lowest preference value (routing protocol process
preference).
Routes that are not eligible to be used for forwarding (for example, because they were
rejected by routing policy or because a next hop is inaccessible) have a preference of
–1 and are never chosen.
For non-BGP paths, choose the path with the lowest preference2 value.
4. If the accumulated interior gateway protocol (AIGP) attribute is enabled, prefer the
path with the lower AIGP attribute.
5. Prefer the path with the shortest autonomous system (AS) path value (skipped if the
as-path-ignore statement is configured).
Routes learned from an IGP have a lower origin code than those learned from an
exterior gateway protocol (EGP), and both have lower origin codes than incomplete
routes (routes whose origin is unknown).
7. Prefer the path with the lowest multiple exit discriminator (MED) metric.
• If nondeterministic routing table path selection behavior is not configured (that is,
if the path-selection cisco-nondeterministic statement is not included in the BGP
configuration), for paths with the same neighboring AS numbers at the front of the
AS path, prefer the path with the lowest MED metric. To always compare MEDs
whether or not the peer ASs of the compared routes are the same, include the
path-selection always-compare-med statement.
• If nondeterministic routing table path selection behavior is configured (that is, the
path-selection cisco-nondeterministic statement is included in the BGP
configuration), prefer the path with the lowest MED metric.
Confederations are not considered when determining neighboring ASs. A missing MED
metric is treated as if a MED were present but zero.
By default, only the MEDs of routes that have the same peer autonomous systems
(ASs) are compared. You can configure routing table path selection options to obtain
different behaviors.
8. Prefer strictly internal paths, which include IGP routes and locally generated routes
(static, direct, local, and so forth).
9. Prefer strictly external BGP (EBGP) paths over external paths learned through internal
BGP (IBGP) sessions.
10. Prefer the path whose next hop is resolved through the IGP route with the lowest
metric.
NOTE: A path is considered a BGP equal-cost path (and will be used for
forwarding) if a tie-break is performed after the previous step. All paths
with the same neighboring AS, learned by a multipath-enabled BGP
neighbor, are considered.
BGP multipath does not apply to paths that share the same MED-plus-IGP
cost yet differ in IGP cost. Multipath path selection is based on the IGP
cost metric, even if two paths have the same MED-plus-IGP cost.
11. If both paths are external, prefer the currently active path to minimize route-flapping.
This rule is not used if any one of the following conditions is true:
12. Prefer a primary route over a secondary route. A primary route is one that belongs to
the routing table. A secondary route is one that is added to the routing table through
an export policy.
13. Prefer the path from the peer with the lowest router ID. For any path with an originator
ID attribute, substitute the originator ID for the router ID during router ID comparison.
14. Prefer the path with the shortest cluster list length. The length is 0 for no list.
15. Prefer the path from the peer with the lowest peer IP address.
To configure routing table path selection behavior, include the path-selection statement:
path-selection {
(always-compare-med | cisco-non-deterministic | external-router-id);
as-path-ignore;
med-plus-igp {
igp-multiplier number;
med-multiplier number;
}
}
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
Routing table path selection can be configured in one of the following ways:
• Emulate the Cisco IOS default behavior (cisco-non-deterministic). This mode evaluates
routes in the order that they are received and does not group them according to their
neighboring AS. With cisco-non-deterministic mode, the active path is always first. All
inactive, but eligible, paths follow the active path and are maintained in the order in
which they were received, with the most recent path first. Ineligible paths remain at
the end of the list.
As an example, suppose you have three path advertisements for the 192.168.1.0 /24
route:
• Path 2—learned through IBGP; AS Path of 65020; MED of 150; IGP cost of 5
• Path 3—learned through IBGP; AS Path of 65010; MED of 100; IGP cost of 10
These advertisements are received in quick succession, within a second, in the order
listed. Path 3 is received most recently, so the routing device compares it against path
2, the next most recent advertisement. The cost to the IBGP peer is better for path 2,
so the routing device eliminates path 3 from contention. When comparing paths 1 and
2, the routing device prefers path 1 because it is received from an EBGP peer. This allows
the routing device to install path 1 as the active path for the route.
• Always comparing MEDs whether or not the peer ASs of the compared routes are the
same (always-compare-med).
• Override the rule that If both paths are external, the currently active path is preferred
(external-router-id). Continue with the next step (Step 12) in the path-selection process.
• Adding the IGP cost to the next-hop destination to the MED value before comparing
MED values for path selection (med-plus-igp).
BGP multipath does not apply to paths that share the same MED-plus-IGP cost, yet
differ in IGP cost. Multipath path selection is based on the IGP cost metric, even if two
paths have the same MED-plus-IGP cost.
Suppose a routing device has in its routing table four paths to a destination and is
configured to advertise up to three paths (add-path send path-count 3). The three paths
are chosen based on path selection criteria. That is, the three best paths are chosen in
path-selection order. The best path is the active path. This path is removed from
consideration and a new best path is chosen. This process is repeated until the specified
number of paths is reached.
Related • Example: Ignoring the AS Path Attribute When Selecting the Best Path on page 242
Documentation
• Examples: Configuring BGP MED on page 78
BGP Standards
Junos OS substantially supports the following RFCs and Internet drafts, which define
standards for IP version 4 (IPv4) BGP.
For a list of supported IP version 6 (IPv6) BGP standards, see Supported IPv6 Standards.
• RFC 2385, Protection of BGP Sessions via the TCP MD5 Signature Option
• RFC 2545, Use of BGP-4 Multiprotocol Extensions for IPv6 Inter-Domain Routing
• RFC 4456, BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP)
• RFC 4659, BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN
• RFC 4632, Classless Inter-domain Routing (CIDR): The Internet Address Assignment and
Aggregation Plan
• RFC 4798, Connecting IPv6 Islands over IPv4 MPLS Using IPv6 Provider Edge Routers
(6PE)
• RFC 5004, Avoid BGP Best Path Transitions from One External to Another
• RFC 5291, Outbound Route Filtering Capability for BGP-4 (partial support)
• RFC 5292, Address-Prefix-Based Outbound Route Filter for BGP-4 (partial support)
• RFC 6368, Internal BGP as the Provider/Customer Edge Protocol for BGP/MPLS IP Virtual
Private Networks (VPNs)
• RFC 6810, The Resource Public Key Infrastructure (RPKI) to Router Protocol
• Internet draft draft-ietf-idr-aigp-06, The Accumulated IGP Metric Attribute for BGP
(expires December 2011)
The following RFCs and Internet draft do not define standards, but provide information
about BGP and related technologies. The IETF classifies them variously as “Experimental”
or “Informational.”
Configuration
• Basic BGP Configuration on page 19
• BGP Path Attribute Configuration on page 65
• BGP Policy Configuration on page 193
• BGP BFD Configuration on page 329
• BGP Load Balancing Configuration on page 345
• IBGP Scaling Configuration on page 399
• BGP Security Configuration on page 429
• BGP Flap Configuration on page 477
• Multiprotocol BGP Configuration on page 517
• BGP CLNS Configuration on page 549
• BGP Monitoring Configuration on page 557
• BGP Configuration Statements on page 567
AS 10
OSPF RIP
AS 3
A B
BGP
g015013
In Figure 2 on page 19, Router A is a gateway router for AS 3, and Router B is a gateway
router for AS 10. For traffic internal to either AS, an interior gateway protocol (IGP) is
used (OSPF, for instance). To route traffic between peer ASs, a BGP session is used.
You arrange BGP routing devices into groups of peers. Different peer groups can have
different group types, AS numbers, and route reflector cluster identifiers.
To define a BGP group that recognizes only the specified BGP systems as peers, statically
configure all the system’s peers by including one or more neighbor statements. The peer
neighbor’s address can be either an IPv6 or IPv4 address.
As the number of external BGP (EBGP) groups increases, the ability to support a large
number of BGP sessions might become a scaling issue. The preferred way to configure
a large number of BGP neighbors is to configure a few groups consisting of multiple
neighbors per group. Supporting fewer EBGP groups generally scales better than
supporting a large number of EBGP groups. This becomes more evident in the case of
hundreds of EBGP groups when compared with a few EBGP groups with multiple peers
in each group.
After the BGP peers are established, BGP routes are not automatically advertised by the
BGP peers. At each BGP-enabled device, policy configuration is required to export the
local, static, or IGP-learned routes into the BGP RIB and then advertise them as BGP
routes to the other peers. BGP's advertisement policy, by default, does not advertise any
non-BGP routes (such as local routes) to peers.
• Requirements on page 20
• Overview on page 20
• Configuration on page 21
• Verification on page 23
Requirements
Before you begin, if the default BGP policy is not adequate for your network, configure
routing policies to filter incoming BGP routes and to advertise BGP routes.
Overview
Figure 3 on page 21 shows a network with BGP peer sessions. In the sample network,
Device E in AS 17 has BGP peer sessions to a group of peers called external-peers. Peers
A, B, and C reside in AS 22 and have IP addresses 10.10.10.2, 10.10.10.6, and 10.10.10.10.
Peer D resides in AS 79, at IP address 10.21.7.2. This example shows the configuration on
Device E.
10.2 A
AS 22
10.1
AS 17 E 10.5 10.6 B
10.9
7.1
10.10
C
7.2
D
AS 79
g040727
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
[edit routing-options]
user@E# set autonomous-system 17
3. Create the BGP group, and add the external neighbor addresses.
5. Add Peer D, and set the AS number at the individual neighbor level.
The neighbor configuration overrides the group configuration. So, while peer-as 22
is set for all the other neighbors in the group, peer-as 79 is set for neighbor 10.21.7.2.
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, and show routing-options commands. If the output does not display the
intended configuration, repeat the instructions in this example to correct the configuration.
[edit]
user@E# show interfaces
ge-1/2/0 {
unit 0 {
description to-A;
family inet {
address 10.10.10.1/30;
}
}
}
ge-0/0/1 {
unit 5 {
description to-B;
family inet {
address 10.10.10.5/30;
}
}
}
ge-0/1/0 {
unit 9 {
description to-C;
family inet {
address 10.10.10.9/30;
}
}
}
ge-1/2/1 {
unit 21 {
description to-D;
family inet {
address 10.21.7.1/30;
}
}
}
[edit]
user@E# show protocols
bgp {
group external-peers {
type external;
peer-as 22;
neighbor 10.10.10.2;
neighbor 10.10.10.6;
neighbor 10.10.10.10;
neighbor 10.21.7.2 {
peer-as 79;
}
}
}
[edit]
user@E# show routing-options
autonomous-system 17;
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Verify that BGP is running on configured interfaces and that the BGP session is active for
each neighbor address.
Action From operational mode, run the show bgp neighbor command.
Action From operational mode, run the show bgp group command.
Action From operational mode, run the show bgp summary command.
0/0/0/0 0/0/0/0
10.10.10.6 22 8566 8468 0 0 2d 16:12:12
0/0/0/0 0/0/0/0
10.10.10.10 22 8565 8466 0 0 2d 16:11:31
0/0/0/0 0/0/0/0
10.21.7.2 79 8560 8465 0 0 2d 16:10:58
0/0/0/0 0/0/0/0
• Requirements on page 27
• Overview on page 27
• Configuration on page 28
• Verification on page 37
Requirements
Overview
Junos OS supports EBGP peer sessions by means of IPv6 addresses. An IPv6 peer session
can be configured when an IPv6 address is specified in the neighbor statement. This
example uses EUI-64 to generate IPv6 addresses that are automatically applied to the
interfaces. An EUI-64 address is an IPv6 address that uses the IEEE EUI-64 format for
the interface identifier portion of the address (the last 64 bits).
If you use 128-bit link-local addresses for the interfaces, you must include
the local-interface statement. This statement is valid only for 128-bit IPv6
link-local addresses and is mandatory for configuring an IPv6 EBGP link-local
peer session.
After your interfaces are up, you can use the show interfaces terse command to view the
EUI-64-generated IPv6 addresses on the interfaces. You must use these generated
addresses in the BGP neighbor statements. This example demonstrates the full
end-to-end procedure.
In this example, Frame Relay interface encapsulation is applied to the logical tunnel (lt)
interfaces. This is a requirement because only Frame Relay encapsulation is supported
when IPv6 addresses are configured on the lt interfaces.
Figure 4 on page 28 shows a network with BGP peer sessions. In the sample network,
Router R1 has five logical systems configured. Device E in autonomous system (AS) 17
has BGP peer sessions to a group of peers called external-peers. Peers A, B, and C reside
in AS 22. This example shows the step-by-step configuration on Logical System A and
Logical System E.
R1
2001:db8:0:1::/64 AS 22
AS 17 2001:db8:0:2::/64
E B
2001:db8:0:3::/64
C
2001:db8:0:4::/64
AS 79
g040726
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
1. Run the show interfaces terse command to verify that the physical router has a
logical tunnel (lt) interface.
3. On Logical System A, configure the network address for the link to Peer E, and
configure a loopback interface.
[edit interfaces]
user@R1:A# set lt-0/1/0 unit 1 description to-E
user@R1:A# set lt-0/1/0 unit 1 family inet6 address 2001:db8:0:1::/64 eui-64
user@R1:A# set lo0 unit 1 family inet6 address 2001:db8::1/128
5. On Logical System E, configure the network address for the link to Peer A, and
configure a loopback interface.
[edit interfaces]
user@R1:E# set lt-0/1/0 unit 25 description to-A
user@R1:E# set lt-0/1/0 unit 25 family inet6 address 2001:db8:0:1::/64 eui-64
user@R1:E# set lo0 unit 5 family inet6 address 2001:db8::5/128
6. Run the show interfaces terse command to see the IPv6 addresses that are generated
by EUI-64.
The 2001 addresses are used in this example in the BGP neighbor statements.
NOTE: The fe80 addresses are link-local addresses and are not used
in this example.
fe80::2a0:a502:0:19da/64
lo0
lo0.5 up up inet6 2001:db8::5
fe80::2a0:a50f:fc56:1da
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
1. On Logical System A, create the BGP group, and add the external neighbor address.
2. On Logical System E, create the BGP group, and add the external neighbor address.
3. On Logical System A, specify the autonomous system (AS) number of the external
AS.
4. On Logical System E, specify the autonomous system (AS) number of the external
AS.
7. On Logical System A, set the autonomous system (AS) number and router ID.
[edit routing-options]
user@R1:A# set router-id 1.1.1.1
user@R1:A# set autonomous-system 22
[edit routing-options]
user@R1:E# set router-id 5.5.5.5
Results From configuration mode, confirm your configuration by entering the show logical-systems
command. If the output does not display the intended configuration, repeat the
instructions in this example to correct the configuration.
[edit]
user@R1# show logical-systems
A{
interfaces {
lt-0/1/0 {
unit 1 {
description to-E;
encapsulation frame-relay;
dlci 1;
peer-unit 25;
family inet6 {
address 2001:db8:0:1::/64 {
eui-64;
}
}
}
}
lo0 {
unit 1 {
family inet6 {
address 2001:db8::1/128;
}
}
}
}
protocols {
bgp {
group external-peers {
type external;
peer-as 17;
neighbor 2001:db8:0:1:2a0:a502:0:19da;
}
}
routing-options {
router-id 1.1.1.1;
autonomous-system 22;
}
}
B{
interfaces {
lt-0/1/0 {
unit 6 {
description to-E;
encapsulation frame-relay;
dlci 6;
peer-unit 5;
family inet6 {
address 2001:db8:0:2::/64 {
eui-64;
}
}
}
}
lo0 {
unit 2 {
family inet6 {
address 2001:db8::2/128;
}
}
}
}
protocols {
bgp {
group external-peers {
type external;
peer-as 17;
neighbor 2001:db8:0:2:2a0:a502:0:5da;
}
}
routing-options {
router-id 2.2.2.2;
autonomous-system 22;
}
}
C{
interfaces {
lt-0/1/0 {
unit 10 {
description to-E;
encapsulation frame-relay;
dlci 10;
peer-unit 9;
family inet6 {
address 2001:db8:0:3::/64 {
eui-64;
}
}
}
}
lo0 {
unit 3 {
family inet6 {
address 2001:db8::3/128;
}
}
}
}
protocols {
bgp {
group external-peers {
type external;
peer-as 17;
neighbor 2001:db8:0:3:2a0:a502:0:9da;
}
}
}
routing-options {
router-id 3.3.3.3;
autonomous-system 22;
}
}
D{
interfaces {
lt-0/1/0 {
unit 7 {
description to-E;
encapsulation frame-relay;
dlci 7;
peer-unit 21;
family inet6 {
address 2001:db8:0:4::/64 {
eui-64;
}
}
}
}
lo0 {
unit 4 {
family inet6 {
address 2001:db8::4/128;
}
}
}
}
protocols {
bgp {
group external-peers {
type external;
peer-as 17;
neighbor 2001:db8:0:4:2a0:a502:0:15da;
}
}
routing-options {
router-id 4.4.4.4;
autonomous-system 79;
}
}
E{
interfaces {
lt-0/1/0 {
unit 5 {
description to-B;
encapsulation frame-relay;
dlci 6;
peer-unit 6;
family inet6 {
address 2001:db8:0:2::/64 {
eui-64;
}
}
}
unit 9 {
description to-C;
encapsulation frame-relay;
dlci 10;
peer-unit 10;
family inet6 {
address 2001:db8:0:3::/64 {
eui-64;
}
}
}
unit 21 {
description to-D;
encapsulation frame-relay;
dlci 7;
peer-unit 7;
family inet6 {
address 2001:db8:0:4::/64 {
eui-64;
}
}
}
unit 25 {
description to-A;
encapsulation frame-relay;
dlci 1;
peer-unit 1;
family inet6 {
address 2001:db8:0:1::/64 {
eui-64;
}
}
}
}
lo0 {
unit 5 {
family inet6 {
address 2001:db8::5/128;
}
}
}
}
protocols {
bgp {
group external-peers {
type external;
peer-as 22;
neighbor 2001:db8:0:1:2a0:a502:0:1da;
neighbor 2001:db8:0:2:2a0:a502:0:6da;
neighbor 2001:db8:0:3:2a0:a502:0:ada;
neighbor 2001:db8:0:4:2a0:a502:0:7da {
peer-as 79;
}
}
}
}
routing-options {
router-id 5.5.5.5;
autonomous-system 17;
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Verify that BGP is running on configured interfaces and that the BGP session is active for
each neighbor address.
Action From operational mode, run the show bgp neighbor command.
Meaning IPv6 unicast network layer reachability information (NLRI) is being exchanged between
the neighbors.
Action From operational mode, run the show bgp group command.
Meaning The group type is external, and the group has four peers.
Purpose Verify that the BGP that the peer relationships are established.
Action From operational mode, run the show bgp summary command.
Meaning The Down peers: 0 output shows that the BGP peers are in the established state.
Purpose Verify that the inet6.0 routing table is populated with local and direct routes.
Meaning The inet6.0 routing table contains local and direct routes. To populate the routing table
with other types of routes, you must configure routing policies.
In Figure 5 on page 42, Device Jackson, Device Memphis, and Device Biloxi have IBGP
peer sessions with each other. Likewise, Device Miami and Device Atlanta have IBGP peer
sessions between each other.
The purpose of IBGP is to provide a means by which EBGP route advertisements can be
forwarded throughout the network. In theory, to accomplish this task you could redistribute
all of your EBGP routes into an interior gateway protocol (IGP), such as OSPF or IS-IS.
This, however, is not recommended in a production environment because of the large
number of EBGP routes in the Internet and because of the way that IGPs operate. In short,
with that many routes the IGP churns or crashes.
Generally, the loopback interface (lo0) is used to establish connections between IBGP
peers. The loopback interface is always up as long as the device is operating. If there is
a route to the loopback address, the IBGP peering session stays up. If a physical interface
address is used instead and that interface goes up and down, the IBGP peering session
also goes up and down. Thus the loopback interface provides fault tolerance in case the
physical interface or the link goes down, if the device has link redundancy.
While IBGP neighbors do not need to be directly connected, they do need to be fully
meshed. In this case, fully meshed means that each device is logically connected to every
other device through neighbor peer relationships. The neighbor statement creates the
mesh. Because of the full mesh requirement of IBGP, you must configure individual peering
sessions between all IBGP devices in the AS. The full mesh need not be physical links.
Rather, the configuration on each routing device must create a full mesh of peer sessions
(using multiple neighbor statements).
IBGP supports multihop connections, so IBGP neighbors can be located anywhere within
the AS and often do not share a link. A recursive route lookup resolves the loopback
peering address to an IP forwarding next hop. The lookup service is provided by static
routes or an IGP, such as OSPF.
• Requirements on page 43
• Overview on page 43
• Configuration on page 45
• Verification on page 52
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
In this example, you configure internal BGP (IBGP) peer sessions. The loopback interface
(lo0) is used to establish connections between IBGP peers. The loopback interface is
always up as long as the device is operating. If there is a route to the loopback address,
the IBGP peer session stays up. If a physical interface address is used instead and that
interface goes up and down, the IBGP peer session also goes up and down. Thus, if the
device has link redundancy, the loopback interface provides fault tolerance in case the
physical interface or one of the links goes down.
When a device peers with a remote device’s loopback interface address, the local device
expects BGP update messages to come from (be sourced by) the remote device’s
loopback interface address. The local-address statement enables you to specify the
source information in BGP update messages. If you omit the local-address statement,
the expected source of BGP update messages is based on the device’s source address
selection rules, which normally results in the egress interface address being the expected
source of update messages. When this happens, the peer session is not established
because a mismatch exists between the expected source address (the egress interface
of the peer) and the actual source (the loopback interface of the peer). To make sure
that the expected source address matches the actual source address, specify the loopback
interface address in the local-address statement.
Because IBGP supports multihop connections, IBGP neighbors can be located anywhere
within the autonomous system (AS) and often do not share a link. A recursive route
lookup resolves the loopback peer address to an IP forwarding next hop. In this example,
this service is provided by OSPF. Although interior gateway protocol (IGP) neighbors do
not need to be directly connected, they do need to be fully meshed. In this case, fully
meshed means that each device is logically connected to every other device through
neighbor peer relationships. The neighbor statement creates the mesh.
After the BGP peers are established, BGP routes are not automatically advertised by the
BGP peers. At each BGP-enabled device, policy configuration is required to export the
local, static, or IGP-learned routes into the BGP routing information base (RIB) and then
advertise them as BGP routes to the other peers. BGP's advertisement policy, by default,
does not advertise any non-BGP routes (such as local routes) to peers.
In the sample network, the devices in AS 17 are fully meshed in the group internal-peers.
The devices have loopback addresses 192.168.6.5, 192.163.6.4, and 192.168.40.4.
192.168.6.5
AS 17 A
192.163.6.4
C B
192.168.40.4
g040732
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device A
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@A# set lo0 unit 1 family inet address 192.168.6.5/32
2. Configure BGP.
The neighbor statements are included for both Device B and Device C, even though
Device A is not directly connected to Device C.
3. Configure OSPF.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
[edit routing-options]
user@A# set router-id 192.168.6.5
user@A# set autonomous-system 17
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
ospf {
area 0.0.0.0 {
interface lo0.1 {
passive;
}
interface ge-0/1/0.1;
}
}
If you are done configuring the device, enter commit from configuration mode.
Configuring Device B
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode.
[edit interfaces]
user@B# set lo0 unit 2 family inet address 192.163.6.4/32
2. Configure BGP.
The neighbor statements are included for both Device B and Device C, even though
Device A is not directly connected to Device C.
3. Configure OSPF.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
[edit routing-options]
user@B# set router-id 192.163.6.4
user@B# set autonomous-system 17
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
If you are done configuring the device, enter commit from configuration mode.
Configuring Device C
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@C# set lo0 unit 3 family inet address 192.168.40.4/32
2. Configure BGP.
The neighbor statements are included for both Device B and Device C, even though
Device A is not directly connected to Device C.
3. Configure OSPF.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
[edit routing-options]
user@C# set router-id 192.168.40.4
user@C# set autonomous-system 17
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
area 0.0.0.0 {
interface lo0.3 {
passive;
}
interface ge-0/1/0.6;
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Verify that BGP is running on configured interfaces and that the BGP session is active for
each neighbor address.
Action From operational mode, enter the show bgp neighbor command.
Action From operational mode, enter the show bgp group command.
192.168.40.4+179
inet.0: 0/5/5/0
Action From operational mode, enter the show bgp summary command.
Purpose Verify that the export policy configuration is causing the BGP routes to be installed in the
routing tables of the peers.
Action From operational mode, enter the show route protocol bgp command.
• Requirements on page 55
• Overview on page 55
• Configuration on page 55
• Verification on page 62
Requirements
Overview
In the sample network, the devices in AS 17 are fully meshed in the group internal-peers.
The devices have loopback addresses 192.168.6.5, 192.163.6.4, and 192.168.40.4.
192.168.6.5
AS 17 A
192.163.6.4
C B
192.168.40.4
g040731
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Device A
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure BGP.
On Logical System A, the neighbor statements are included for both Device B and
Device C, even though Logical System A is not directly connected to Device C.
3. Configure OSPF.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
Results From configuration mode, confirm your configuration by entering the show logical-systems
command. If the output does not display the intended configuration, repeat the
configuration instructions in this example to correct it.
A{
interfaces {
lt-0/1/0 {
unit 1 {
description to-B;
encapsulation ethernet;
peer-unit 2;
family inet {
address 10.10.10.1/30;
}
}
}
lo0 {
unit 1 {
family inet {
address 192.168.6.5/32;
}
}
}
}
protocols {
bgp {
group internal-peers {
type internal;
local-address 192.168.6.5;
export send-direct;
neighbor 192.163.6.4;
neighbor 192.168.40.4;
}
}
ospf {
area 0.0.0.0 {
interface lo0.1 {
passive;
}
interface lt-0/1/0.1;
}
}
}
policy-options {
policy-statement send-direct {
term 2 {
from protocol direct;
then accept;
}
}
}
routing-options {
router-id 192.168.6.5;
autonomous-system 17;
}
}
B{
interfaces {
lt-0/1/0 {
unit 2 {
description to-A;
encapsulation ethernet;
peer-unit 1;
family inet {
address 10.10.10.2/30;
}
}
unit 5 {
description to-C;
encapsulation ethernet;
peer-unit 6;
family inet {
address 10.10.10.5/30;
}
}
}
lo0 {
unit 2 {
family inet {
address 192.163.6.4/32;
}
}
}
}
protocols {
bgp {
group internal-peers {
type internal;
local-address 192.163.6.4;
export send-direct;
neighbor 192.168.40.4;
neighbor 192.168.6.5;
}
}
ospf {
area 0.0.0.0 {
interface lo0.2 {
passive;
}
interface lt-0/1/0.2;
interface lt-0/1/0.5;
}
}
}
policy-options {
policy-statement send-direct {
term 2 {
from protocol direct;
then accept;
}
}
}
routing-options {
router-id 192.163.6.4;
autonomous-system 17;
}
}
C{
interfaces {
lt-0/1/0 {
unit 6 {
description to-B;
encapsulation ethernet;
peer-unit 5;
family inet {
address 10.10.10.6/30;
}
}
}
lo0 {
unit 3 {
family inet {
address 192.168.40.4/32;
}
}
}
}
protocols {
bgp {
group internal-peers {
type internal;
local-address 192.168.40.4;
export send-direct;
neighbor 192.163.6.4;
neighbor 192.168.6.5;
}
}
ospf {
area 0.0.0.0 {
interface lo0.3 {
passive;
}
interface lt-0/1/0.6;
}
}
}
policy-options {
policy-statement send-direct {
term 2 {
from protocol direct;
then accept;
}
}
}
routing-options {
router-id 192.168.40.4;
autonomous-system 17;
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Verify that BGP is running on configured interfaces and that the BGP session is active for
each neighbor address.
Action From the operational mode, enter the show bgp neighbor command.
Export: [ send-direct ]
Options: <Preference LocalAddress Refresh>
Local Address: 192.168.6.5 Holdtime: 90 Preference: 170
Number of flaps: 0
Peer ID: 192.168.40.4 Local ID: 192.168.6.5 Active Holdtime: 90
Keepalive Interval: 30 Peer index: 1
BFD: disabled, down
NLRI for restart configured on peer: inet-unicast
NLRI advertised by peer: inet-unicast
NLRI for this session: inet-unicast
Peer supports Refresh capability (2)
Restart time configured on the peer: 120
Stale routes from peer are kept for: 300
Restart time requested by this peer: 120
NLRI that peer supports restart for: inet-unicast
NLRI that restart is negotiated for: inet-unicast
NLRI of received end-of-rib markers: inet-unicast
NLRI of all end-of-rib markers sent: inet-unicast
Peer supports 4 byte AS extension (peer-as 17)
Peer does not support Addpath
Table inet.0 Bit: 10000
RIB State: BGP restart is complete
Send state: in sync
Active prefixes: 0
Received prefixes: 2
Accepted prefixes: 2
Suppressed due to damping: 0
Advertised prefixes: 2
Last traffic (seconds): Received 15 Sent 22 Checked 68
Input messages: Total 15688 Updates 2 Refreshes 0 Octets 298111
Output messages: Total 15688 Updates 2 Refreshes 0 Octets 298184
Output Queue[0]: 0
Action From the operational mode, enter the show bgp group command.
Action From the operational mode, enter the show bgp summary command.
Action From the operational mode, enter the show route protocol bgp command.
The LOCAL_PREF path attribute is always advertised to IBGP peers and to neighboring
confederations. It is never advertised to external BGP (EBGP) peers. The default behavior
is to not modify the LOCAL_PREF path attribute if it is present.
The LOCAL_PREF path attribute applies at export time only, when the routes are exported
from the routing table into BGP.
If a BGP route is received without a LOCAL_PREF attribute, the route is stored in the
routing table and advertised by BGP as if it were received with a LOCAL_PREF value
of 100. A non-BGP route that is advertised by BGP is advertised with a LOCAL_PREF
value of 100 by default.
• Requirements on page 66
• Overview on page 66
• Configuration on page 67
• Verification on page 76
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
To change the local preference metric advertised in the path attribute, you must include
32
the local-preference statement, specifying a value from 0 through 4,294,967,295 (2 – 1).
There are several reasons you might want to prefer one path over another. For example,
compared to other paths, one path might be less expensive to use, might have higher
bandwidth, or might be more stable.
Figure 8 on page 66 shows a typical network with internal peer sessions and multiple exit
points to a neighboring AS.
Figure 8: Typical Network with IBGP Sessions and Multiple Exit Points
To reach Device R4, Device R1 can take a path through either Device R2 or Device R3. By
default, the local preference is 100 for either route. When the local preferences are equal,
Junos OS has rules for breaking the tie and choosing a path. (See “Understanding BGP
Path Selection” on page 8.) In this example, the active route is through Device R2 because
the router ID of Device R2 is lower than the router ID of Device R3. The following example
shows how to override the default behavior with an explicit setting for the local preference.
The example configures a local preference of 300 on Device R3, thereby making Device
R3 the preferred path to reach Device R4.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device R1
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure BGP.
3. Configure OSPF.
NOTE: Other useful options for this scenario might be to accept routes
learned through OSPF or local routes.
[edit routing-options]
user@R1# set autonomous-system 123
user@R1# set router-id 192.168.1.1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
term 1 {
from protocol direct;
then accept;
}
}
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R2
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure BGP.
3. Configure OSPF.
NOTE: Other useful options for this scenario might be to accept routes
learned through OSPF or local routes.
[edit routing-options]
user@R2# set autonomous-system 123
user@R2# set router-id 192.168.2.1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
address 192.168.2.1/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R3
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure BGP.
3. Configure OSPF.
NOTE: Other useful options for this scenario might be to accept routes
learned through OSPF or local routes.
[edit routing-options]
user@R3# set autonomous-system 123
user@R3# set router-id 192.168.3.1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
fe-1/2/1 {
unit 6 {
family inet {
address 34.34.34.3/24;
}
}
}
lo0 {
unit 3 {
family inet {
address 192.168.3.1/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R4
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure BGP.
NOTE: Other useful options for this scenario might be to accept routes
learned through OSPF or local routes.
[edit routing-options]
user@R4# set autonomous-system 4
user@R4# set router-id 192.168.4.1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
}
fe-1/2/1 {
unit 8 {
family inet {
address 34.34.34.4/24;
}
}
}
lo0 {
unit 4 {
family inet {
address 192.168.4.1/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Verify that the active path from Device R1 to Device R4 goes through Device R2.
Action From operational mode, enter the show route protocol bgp command.
Meaning The asterisk (*) shows that the preferred path is through Device R2. In the default
configuration, Device R2 has a lower router ID than Device R3. The router ID is controlling
the path selection.
Action From configuration mode, enter the set local-preference 300 command.
Purpose Verify that the active path from Device R1 to Device R4 goes through Device R3.
Action From operational mode, enter the show route protocol bgp command.
AS path: I
> to 13.13.13.3 via fe-1/2/1.2
24.24.24.0/24 [BGP/170] 00:16:48, localpref 100, from 192.168.2.1
AS path: I
> to 12.12.12.2 via fe-1/2/0.1
34.34.34.0/24 [BGP/170] 00:00:22, localpref 300, from 192.168.3.1
AS path: I
> to 13.13.13.3 via fe-1/2/1.2
192.168.2.1/32 [BGP/170] 00:16:48, localpref 100, from 192.168.2.1
AS path: I
> to 12.12.12.2 via fe-1/2/0.1
192.168.3.1/32 [BGP/170] 00:00:22, localpref 300, from 192.168.3.1
AS path: I
> to 13.13.13.3 via fe-1/2/1.2
192.168.4.1/32 *[BGP/170] 00:00:21, localpref 300, from 192.168.3.1
AS path: 4 I
> to 13.13.13.3 via fe-1/2/1.2
Meaning The asterisk (*) shows that the preferred path is through Device R3. In the altered
configuration, Device R3 has a higher local preference than Device R2. The local preference
is controlling the path selection.
The MED attribute has a value that is referred to as a metric. If all other factors in
determining an exit point are equal, the exit point with the lowest metric is preferred.
If a MED is received over an external BGP link, it is propagated over internal links to other
BGP-enabled devices within the AS.
BGP update messages include a MED metric if the route was learned from BGP and
already had a MED metric associated with it, or if you configure the MED metric in the
configuration file.
A MED metric is advertised with a route according to the following general rules:
• A more specific metric overrides a less specific metric. That is, a group-specific metric
overrides a global BGP metric, and a peer-specific metric overrides a global BGP or
group-specific metric.
• A metric defined with a routing policy overrides a metric defined with the metric-out
statement.
• If the received route does not have an associated MED metric, and if you do not explicitly
configure a metric value, no metric is advertised. When you do not explicitly configure
a metric value, the MED value is equivalent to zero (0) when advertising an active route.
Because the AS path rather than the number of hops between hosts is the primary criterion
for BGP route selection, an AS with multiple connections to a peer AS can have multiple
equivalent AS paths. When the routing table contains two routes to the same host in a
neighboring AS, an MED metric assigned to each route can determine which to include
in the forwarding table. The MED metric you assign can force traffic through a particular
exit point in an AS.
Figure 9 on page 79 illustrates how MED metrics are used to determine route selection.
By default, only the MEDs of routes that have the same peer ASs are compared. However,
you can configure the routing table path selection options listed in Table 3 on page 80
to compare MEDs in different ways. The MED options are not mutually exclusive and can
be configured in combination or independently. For the MED options to take effect, you
must configure them uniformly all through your network. The MED option or options you
configure determine the route selected. Thus we recommend that you carefully evaluate
your network for preferred routes before configuring the MED options.
Always comparing MEDs Ensures that the MEDs for paths from Useful when all enterprises participating
(always-compare-med) peers in different ASs are always in a network agree on a uniform policy
compared in the route selection process. for setting MEDs. For example, in a
network shared by two ISPs, both must
agree that a certain path is the better
path to configure the MED values
correctly.
Adding IGP cost to MED (med-plus-igp) Before comparing MED values for path Useful when the downstream AS requires
selection, adds to the MED the cost of the the complete cost of a certain route that
IGP route to the BGP next-hop is received across multiple ASs.
destination.
Applying Cisco IOS nondeterministic Specifies the nondeterministic behavior We recommend that you do not
behavior (cisco-non-deterministic) of the Cisco IOS software: configure this option, because the
nondeterministic behavior sometimes
• The active path is always first. All prevents the system from properly
nonactive but eligible paths follow the comparing the MEDs between paths.
active path and are maintained in the
order in which they were received.
Ineligible paths remain at the end of
the list.
• When a new path is added to the
routing table, path comparisons are
made among all routes, including those
paths that must never be selected
because they lose the MED
tie-breaking rule.
• Requirements on page 81
• Overview on page 81
• Configuration on page 82
• Verification on page 92
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
To directly configure a MED metric to advertise in BGP update messages, include the
metric-out statement:
metric is the primary metric on all routes sent to peers. It can be a value in the range
32
from 0 through 4,294,967,295 (2 – 1).
• minimum-igp—Sets the metric to the minimum metric value calculated in the interior
gateway protocol (IGP) to get to the BGP next hop. If a newly calculated metric is
greater than the minimum metric value, the metric value remains unchanged. If a newly
calculated metric is lower, the metric value is lowered to that value.
• igp—Sets the metric to the most recent metric value calculated in the IGP to get to the
BGP next hop.
• offset—Specifies a value for offset to increase or decrease the metric that is used from
the metric value calculated in the IGP. The metric value is offset by the value specified.
The metric calculated in the IGP (by specifying either igp or igp-minimum) is increased
if the offset value is positive. The metric calculated in the IGP (by specifying either igp
or igp-minimum) is decreased if the offset value is negative.
31 31
offset can be a value in the range from –2 through 2 – 1. Note that the adjusted metric
32
can never go below 0 or above 2 – 1.
Figure 10 on page 82 shows a typical network with internal peer sessions and multiple
exit points to a neighboring autonomous system (AS).
Figure 10: Typical Network with IBGP Sessions and Multiple Exit Points
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device R1
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure BGP.
3. Configure OSPF.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
[edit routing-options]
user@R1# set autonomous-system 123
user@R1# set router-id 192.168.1.1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
unit 1 {
family inet {
address 12.12.12.1/24;
}
}
}
fe-1/2/1 {
unit 2 {
family inet {
address 13.13.13.1/24;
}
}
}
lo0 {
unit 1 {
family inet {
address 192.168.1.1/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R2
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure BGP.
3. Configure OSPF.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
[edit routing-options]
user@R2# set autonomous-system 123
user@R2# set router-id 192.168.2.1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
interface fe-1/2/0.3;
interface fe-1/2/1.4;
}
}
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R3
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure BGP.
3. Configure OSPF.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
[edit routing-options]
user@R3# set autonomous-system 123
user@R3# set router-id 192.168.3.1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
type external;
export send-direct;
peer-as 4;
neighbor 34.34.34.4;
}
}
ospf {
area 0.0.0.0 {
interface lo0.3 {
passive;
}
interface fe-1/2/0.5;
interface fe-1/2/1.6;
}
}
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R4
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
3. Configure BGP.
4. Configure a MED value of 30 for neighbor Device R3, and a MED value of 20 for
neighbor Device R2.
This configuration causes autonomous system (AS) 123 (of which Device R1, Device
R2, and Device R3 are members) to prefer the path through Device R2 to reach AS
4.
[edit routing-options]
user@R4# set autonomous-system 4
user@R4# set router-id 192.168.4.1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Verify that the active path goes through Device R2.
Action From operational mode, enter the show route protocol bgp command.
Meaning The asterisk (*) shows that the preferred path is through Device R2. The reason for the
path selection is listed as MED 20.
Purpose Make sure that Device R4 is sending update messages with a value of 20 to Device R2
and a value of 30 to Device R3.
Action From operational mode, enter the show route advertising-protocol bgp 24.24.24.2
command.
Meaning The MED column shows that Device R4 is sending the correct MED values to its two
external BGP (EBGP) neighbors.
• Requirements on page 93
• Overview on page 94
• Configuration on page 94
• Verification on page 104
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
To configure a route-filter policy that modifies the advertised MED metric in BGP update
messages, include the metric statement in the policy action.
Figure 11 on page 94 shows a typical network with internal peer sessions and multiple
exit points to a neighboring autonomous system (AS).
Figure 11: Typical Network with IBGP Sessions and Multiple Exit Points
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device R1
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure BGP.
3. Configure OSPF.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
[edit routing-options]
user@R1# set autonomous-system 123
user@R1# set router-id 192.168.1.1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
autonomous-system 123;
router-id 192.168.1.1;
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R2
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure BGP.
3. Configure OSPF.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
[edit routing-options]
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R3
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure BGP.
3. Configure OSPF.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
[edit routing-options]
user@R3# set autonomous-system 123
user@R3# set router-id 192.168.3.1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
ospf {
area 0.0.0.0 {
interface lo0.3 {
passive;
}
interface fe-1/2/0.5;
interface fe-1/2/1.6;
}
}
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R4
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
3. Configure BGP.
[edit policy-options]
set policy-statement med-10 from route-filter 144.144.144.144/32 exact
set policy-statement med-10 then metric 10
set policy-statement med-10 then accept
5. Configure the two EBGP neighbors, applying the two MED policies to Device R3,
and a MED value of 20 to Device R2.
[edit routing-options]
user@R4# set autonomous-system 4
user@R4# set router-id 192.168.4.1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Verify that the active path goes through Device R2.
Action From operational mode, enter the show route protocol bgp command.
Meaning The output shows that the preferred path to the routes advertised by Device R4 is through
Device R2 for all routes except 144.144.144.144/32. For 144.144.144.144/32, the preferred
path is through Device R3.
Purpose Make sure that Device R4 is sending update messages with a value of 20 to Device R2
and a value of 30 to Device R3.
Action From operational mode, enter the show route advertising-protocol bgp command.
Meaning The MED column shows that Device R4 is sending the correct MED values to its two EBGP
neighbors.
[edit]
routing-options {
router-id 10.0.0.1;
autonomous-system 23;
}
policy-options {
policy-statement from-otago {
from community otago;
then metric 20;
}
community otago members [56:2379 23:46944];
}
protocols {
bgp {
import from-otago;
group 23 {
type external;
peer-as 56;
neighbor 192.168.0.1 {
traceoptions {
file bgp-log-peer;
flag packets;
}
log-updown;
}
}
}
}
Example: Associating the MED Path Attribute with the IGP Metric and Delaying MED Updates
This example shows how to associate the multiple exit discriminator (MED) path attribute
with the interior gateway protocol (IGP) metric, and configure a timer to delay update
of the MED attribute.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
BGP can be configured to advertise the MED attribute for a route based on the IGP
distance of its internal BGP (IBGP) route next-hop. The IGP metric enables internal routing
to follow the shortest path according to the administrative setup. In some deployments,
it might be ideal to communicate IGP shortest-path knowledge to external BGP (EBGP)
peers in a neighboring autonomous system (AS). This allows those EBGP peers to forward
traffic into your AS using the shortest paths possible.
Routes learned from an EBGP peer usually have a next hop on a directly connected
interface, and thus the IGP value is equal to zero. Zero is the value advertised. The IGP
metric is a nonzero value when a BGP peer sends third-party next hops that require the
local system to perform next-hop resolution—IBGP configurations, configurations within
confederation peers, or EBGP configurations that include the multihop command. In
these scenarios, it might make sense to associate the MED value with the IGP metric by
including the metric-out minimum-igp or metric-out igp option.
The drawback of associating the MED with the IGP metric is the risk of excessive route
advertisements when there are IGP instabilities in the network. Configuring a delay for
the MED update provides a mechanism to reduce route advertisements in such scenarios.
The delay works by slowing down MED updates when the IGP metric for the next hop
changes. The approach uses a timer to periodically advertise MED updates. When the
timer expires, the MED attribute for routes with metric-out igp delay-updates configured
is updated to the current IGP metric of the next hop. The BGP-enabled device sends out
advertisements for routes for which the MED attribute has changed.
The delay-updates option identifies the BGP groups (or peers) for which the MED updates
must be suppressed. The time for advertising MED updates is set to 10 minutes by default.
You can increase the interval up to 600 minutes by including the med-igp-update-interval
statement in the routing-options configuration.
NOTE: If you have nonstop active routing (NSR) enabled and a switchover
occurs, the delayed MED updates might be advertised as soon as the
switchover occurs.
When you configure the metric-out igp option, the IGP metric directly tracks the IGP cost
to the IBGP peer. When the IGP cost goes down, so does the advertised MED value.
Conversely, when the IGP cost goes up, the MED value goes up as well.
When you configure the metric-out minimum-igp option, the advertised MED value changes
only when the IGP cost to the IBGP peer goes down. An increase in the IGP cost does not
affect the MED value. The router monitors and remembers the lowest IGP cost until the
routing process (rpd) is restarted. The BGP peer sends an update only if the MED is lower
than the previously advertised value or another attribute associated with the route has
changed, or if the BGP peer is responding to a refresh route request.
This example uses the metric statement in the OSPF configuration to demonstrate that
when the IGP metric changes, the MED also changes after the configured delay interval.
The OSPF metric can range from 1 through 65,535.
AS 1
R2
R1 R3
AS 2
R4 R5
R6 R8
R7
g041155
AS 3
In this example, the MED value advertised by Device R1 is associated with the IGP running
in AS 1. The MED value advertised by Device R1 impacts the decisions of the neighboring
AS (AS 2) when AS 2 is forwarding traffic into AS 1.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device R1
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure IBGP.
3. Configure EBGP.
The default for the MED update is 10 minutes when you include the
delay-med-update option. When you exclude the delay-med-update option, the
MED update occurs immediately after the IGP metric changes.
[edit routing-options]
user@R1# set med-igp-update-interval 12
You can configure the interval from 10 minutes through 600 minutes.
6. Configure OSPF.
The metric statement is used here to demonstrate what happens when the IGP
metric changes.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
[edit routing-options]
user@R1# set router-id 192.168.0.1
user@R1# set autonomous-system 1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
If you are done configuring the device, enter commit from configuration mode. Repeat
the configuration steps on the other devices in the topology, as needed for your network.
Verification
Purpose Verify that Device R1 is advertising to Device R4 a BGP MED value that reflects the IGP
metric.
Action From operational mode, enter the show route advertising-protocol bgp command.
Meaning The 601 value in the MED column shows that the MED value has been updated to reflect
the configured OSPF metric.
Verifying That the MED Value Changes When the OSPF Metric Changes
Purpose Make sure that when you raise the OSPF metric to 700, the MED value is updated to
reflect this change.
Action From configuration mode, enter the set protocols ospf area 0 interface fe-1/2/0.2 metric
700 command.
Meaning The 701 value in the MED column shows that the MED value has been updated to reflect
the configured OSPF metric.
Purpose Change the configuration to use the minimum-igp statement instead of the igp statement.
When you increase the OSPF metric, the MED value remains unchanged, but when you
decrease the OSPF metric, the MED value reflects the new OSPF metric.
Action From configuration mode, delete the igp statement, add the minimum-igp statement,
and increase the OSPF metric.
* 10.0.0.0/30 Self 0 I
* 172.16.0.0/30 Self 0 I
* 172.16.0.4/30 Self 701 I
* 192.168.0.1/32 Self 0 I
Meaning When the minimum-igp statement is configured, the MED value changes only when a
shorter path is available.
Using a local AS number permits the routing devices in an acquired network to appear
to belong to the former AS.
For example, ISP A, with an AS of 200, acquires ISP B, with an AS of 250. ISP B has a
customer, ISP C, that does not want to change its configuration. After ISP B becomes
part of ISP A, a local AS number of 250 is configured for use in EBGP peer sessions with
ISP C. Consequently, the local AS number of 250 is either prepended before or used
instead of the global AS number of 200 in the AS path used to export routes to direct
external peers in ISP C.
If the route is received from an internal BGP (IBGP) peer, the AS path includes the local
AS number prepended before the global AS number.
The local AS number is used instead of the global AS number if the route is an external
route, such as a static route or an interior gateway protocol (IGP) route that is imported
into BGP. If the route is external and you want the global AS number to be included in
the AS path, you can apply a routing policy that uses as-path-expand or as-path-prepend.
Use the as-path-expand policy action to place the global AS number behind the local AS
number. Use the as-path-prepend policy action to place the global AS number in front
of the local AS number.
For example:
In a Layer 3 VPN scenario, in which a provider edge (PE) device uses external BGP (EBGP)
to peer with a customer edge (CE) device, the local-as statement behaves differently
than in the non-VPN scenario. In the VPN scenario, the global AS number defined in the
master instance is prepended to the AS path by default. To override this behavior, you
can configure the no-prepend-global-as in the routing-instance BGP configuration on the
PE device, as shown here:
The Junos operating system (Junos OS) implementation of the local AS attribute supports
the following options:
• Local AS with private option—When you use the private option, the local AS is used
during the establishment of the BGP session with an EBGP neighbor but is hidden in
the AS path sent to other EBGP peers. Only the global AS is included in the AS path
sent to external peers.
The private option is useful for establishing local peering with routing devices that
remain configured with their former AS or with a specific customer that has not yet
modified its peer arrangements. The local AS is used to establish the BGP session with
the EBGP neighbor but is hidden in the AS path sent to external peers in another AS.
Include the private option so that the local AS is not prepended before the global AS
in the AS path sent to external peers. When you specify the private option, the local
AS is prepended only in the AS path sent to the EBGP neighbor.
For example, in Figure 13 on page 119, Router 1 and Router 2 are in AS 64496, Router 4
is in AS 64511, and Router 3 is in AS 64510. Router 2 formerly belonged to AS 64497,
which has merged with another network and now belongs to AS 64496. Because
Router 3 still peers with Router 2 using its former AS (64497), Router 2 needs to be
configured with a local AS of 64497 in order to maintain peering with Router 3.
Configuring a local AS of 64497 permits Router 2 to add AS 64497 when advertising
routes to Router 3. Router 3 sees an AS path of 64497 64496 for the prefix 10/8.
192.168.1
1 2 4
IBGP EBGP
.1 .2
AS 64497
192.168.10 10.0.0.0/8
EBGP 10.222.0.0/16
.2
3
g017007
AS 64510
To prevent Router 2 from adding the local AS number in its announcements to other
peers, use the local-as 64497 private statement. This statement configures Router 2
to not include local AS 64497 when announcing routes to Router 1 and to Router 4. In
this case, Router 4 sees an AS path of 64496 64510 for the prefix 10.222/16.
• Local AS with alias option—In Junos OS Release 9.5 and later, you can configure a
local AS as an alias. During the establishment of the BGP open session, the AS used
in the open message alternates between the local AS and the global AS. If the local
AS is used to connect with the EBGP neighbor, then only the local AS is prepended to
the AS path when the BGP peer session is established. If the global AS is used to
connect with the EBGP neighbor, then only the global AS is prepended to the AS path
when the BGP peer session is established. The use of the alias option also means that
the local AS is not prepended to the AS path for any routes learned from that EBGP
neighbor. Therefore, the local AS remains hidden from other external peers.
Configuring a local AS with the alias option is especially useful when you are migrating
the routing devices in an acquired network to the new AS. During the migration process,
some routing devices might be configured with the new AS while others remain
configured with the former AS. For example, it is good practice to start by first migrating
to the new AS any routing devices that function as route reflectors. However, as you
migrate the route reflector clients incrementally, each route reflector has to peer with
routing devices configured with the former AS, as well as peer with routing devices
configured with the new AS. To establish local peer sessions, it can be useful for the
BGP peers in the network to use both the local AS and the global AS. At the same time,
you want to hide this local AS from external peers and use only the global AS in the
AS path when exporting routes to another AS. In this kind of situation, configure the
alias option.
Include the alias option to configure the local AS as an alias to the global AS configured
at the [edit routing-options] hierarchy level. When you configure a local AS as an alias,
during the establishment of the BGP open session, the AS used in the open message
alternates between the local AS and the global AS. The local AS is prepended to the
AS path only when the peer session with an EBGP neighbor is established using that
local AS. The local AS is hidden in the AS path sent to any other external peers. Only
the global AS is prepended to the AS path when the BGP session is established using
the global AS.
NOTE: The private and alias options are mutually exclusive. You cannot
configure both options with the same local-as statement.
• Local AS with option not to prepend the global AS—In Junos OS Release 9.6 and
later, you can configure a local AS with the option not to prepend the global AS. Only
the local AS is included in the AS path sent to external peers.
Use the no-prepend-global-as option when you want to strip the global AS number
from outbound BGP updates in a virtual private network (VPN) scenario. This option
is useful in aVPN scenario in which you want to hide the global AS from the VPN.
Include the no-prepend-global-as option to have the global AS configured at the [edit
routing-options] hierarchy level removed from the AS path sent to external peers. When
you use this option, only the local AS is included in the AS path for the routes sent to
a customer edge (CE) device.
• Number of loops option—The local AS feature also supports specifying the number
of times that detection of the AS number in the AS_PATH attribute causes the route
to be discarded or hidden. For example, if you configure loops 1, the route is hidden if
the AS number is detected in the path one or more times. This is the default behavior.
If you configure loops 2, the route is hidden if the AS number is detected in the path
two or more times.
For the loops number statement, you can configure 1 through 10.
NOTE: If you configure the local AS values for any BGP group, the detection
of routing loops is performed using both the AS and the local AS values for
all BGP groups.
If the local AS for the EBGP or IBGP peer is the same as the current AS, do
not use the local-as statement to specify the local AS number.
When you configure the local AS within a VRF, this impacts the AS path
loop-detection mechanism. All of the local-as statements configured on
the device are part of a single AS domain. The AS path loop-detection
mechanism is based on looking for a matching AS present in the domain.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
Use the local-as statement when ISPs merge and want to preserve a customer’s
configuration, particularly the AS with which the customer is configured to establish a
peer relationship. The local-as statement simulates the AS number already in place in
customer routers, even if the ISP’s router has moved to a different AS.
This example shows how to use the local-as statement to configure a local AS. The
local-as statement is supported for BGP at the global, group, and neighbor hierarchy
levels.
When you configure the local-as statement, you must specify an AS number. You can
specify a number from 1 through 4,294,967,295 in plain-number format. In Junos OS
Release 9.1 and later, the range for AS numbers is extended to provide BGP support for
4-byte AS numbers as defined in RFC 4893, BGP Support for Four-octet AS Number Space.
In Junos OS Release 9.3 and later, you can also configure a 4-byte AS number using the
AS-dot notation format of two integer values joined by a period: <16-bit high-order value
in decimal>.<16-bit low-order value in decimal>. For example, the 4-byte AS number
of 65,546 in plain-number format is represented as 1.10 in the AS-dot notation format.
You can specify a value from 0.0 through 65535.65535 in AS-dot notation format. Junos
R1 R2 R3
g041158
AS 100 AS 200 AS 300
In this example, Device R2 formerly belonged to AS 250 and now is in AS 200. Device R1
and Device R3 are configured to peer with AS 250 instead of with the new AS number
(AS 200). Device R2 has the new AS number configured with the autonomous-system
200 statement. To enable the peering sessions to work, the local-as 250 statement is
added in the BGP configuration. Because local-as 250 is configured, Device R2 includes
both the global AS (200) and the local AS (250) in its BGP inbound and outbound
updates.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device R1
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R1# set fe-1/2/0 unit 1 family inet address 10.0.0.1/30
[edit policy-options]
user@R1# set policy-statement send-direct term 1 from protocol direct
user@R1# set policy-statement send-direct term 1 then accept
user@R1# set policy-statement send-static term 1 from protocol static
user@R1# set policy-statement send-static term 1 then accept
4. Configure a static route to the remote network between Device R2 and Device R3.
[edit routing-options]
user@R1# set static route 10.1.0.0/30 next-hop 10.0.0.2
[edit routing-options]
user@R1# set autonomous-system 100
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
When you are done configuring the device, enter commit from configuration mode.
Configuring Device R2
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R2# set fe-1/2/0 unit 2 family inet address 10.0.0.2/30
2. Configure EBGP.
[edit routing-options]
user@R2# set autonomous-system 200
[edit policy-options]
user@R2# set policy-statement send-direct term 1 from protocol direct
user@R2# set policy-statement send-direct term 1 then accept
user@R2# set policy-statement send-static term 1 from protocol static
user@R2# set policy-statement send-static term 1 then accept
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
family inet {
address 10.0.0.2/30;
}
}
}
fe-1/2/1 {
unit 3 {
family inet {
address 10.1.0.1/30;
}
}
}
lo0 {
unit 2 {
family inet {
address 192.168.0.2/32;
}
}
}
When you are done configuring the device, enter commit from configuration mode.
Configuring Device R3
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R3# set fe-1/2/0 unit 4 family inet address 10.1.0.2/30
2. Configure EBGP.
[edit routing-options]
user@R3# set autonomous-system 300
4. Configure a static route to the remote network between Device R1 and Device R2.
[edit routing-options]
user@R3# set static route 10.0.0.0/30 next-hop 10.1.0.1
[edit policy-options]
user@R3# set policy-statement send-direct term 1 from protocol direct
user@R3# set policy-statement send-direct term 1 then accept
user@R3# set policy-statement send-static term 1 from protocol static
user@R3# set policy-statement send-static term 1 then accept
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
family inet {
address 192.168.0.3/32;
}
}
}
When you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Make sure that Device R2 has the local and global AS settings configured.
Action From operational mode, enter the show bgp neighbors command.
Meaning The Local AS: 250 and Local System AS: 200 output shows that Device R2 has the
expected settings. Additionally, the output shows that the options list includes LocalAS.
Purpose Ensure that the sessions are established and that the local AS number 250 is displayed.
Action From operational mode, enter the show bgp summary command.
Meaning Device R1 and Device R3 appear to be peering with a device in AS 250, even though Device
R2 is actually in AS 200.
Purpose Make sure that the routes are in the routing tables and that the AS paths show the local
AS number 250.
Action From configuration mode, enter the set route protocol bgp command.
Meaning The output shows that Device R1 and Device R3 appear to have routes with AS paths
that include AS 250, even though Device R2 is actually in AS 200.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
Use the local-as statement when ISPs merge and want to preserve a customer’s
configuration, particularly the AS with which the customer is configured to establish a
peer relationship. The local-as statement simulates the AS number already in place in
customer routers, even if the ISP’s router has moved to a different AS.
When you use the private option, the local AS is used during the establishment of the
BGP session with an external BGP (EBGP) neighbor, but is hidden in the AS path sent to
other EBGP peers. Only the global AS is included in the AS path sent to external peers.
The private option is useful for establishing local peering with routing devices that remain
configured with their former AS or with a specific customer that has not yet modified its
peer arrangements. The local AS is used to establish the BGP session with the EBGP
neighbor, but is hidden in the AS path sent to external peers in another AS.
Include the private option so that the local AS is not prepended before the global AS in
the AS path sent to external peers. When you specify the private option, the local AS is
prepended only in the AS path sent to the EBGP neighbor.
AS 64496
Local AS
R1 R3 R4
64497
g041160
R2
Device R2 is hiding the private local AS from all the routers, except Device R3. The private
option applies to the routes that Device R1 receives (learns) from Device R3 and that
Device R1, in turn, readvertises to other routers. When these routes learned from Device
R3 are readavertised by Device R1 to Device R2, the private local AS is missing from the
AS path advertised to Device R2.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device R1
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit routing-options]
user@R1# set autonomous-system 64496
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
fe-1/2/1 {
unit 5 {
family inet {
address 192.168.10.1/24;
}
}
}
lo0 {
unit 2 {
family inet {
address 10.1.1.1/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Repeat the configuration as needed for the other devices in the topology.
Verification
Purpose Make sure that Device R2 does not have AS 64497 in its AS paths to Device R3 and Device
R4.
Action From operational mode, enter the show route protocol bgp command.
Purpose Make sure that Device R3 does not have AS 64497 in its AS path to Device R4.
Action From operational mode, enter the show route protocol bgp command.
Meaning Device R3’s route to Device R2 (prefix 10.1.1.2) includes both the local and the global AS
configured on Device R1 (64497 and 64496, respectively).
BGP is designed to provide routing over a large number of independent ASs with limited
or no coordination among respective administrations. BGP does not use metrics in the
path selection decisions.
The accumulated IGP (AIGP) metric attribute for BGP enables deployment in which a
single administration can run several contiguous BGP ASs. Such deployments allow BGP
to make routing decisions based on the IGP metric. In such networks, it is possible for
BGP to select paths based on metrics as is done by IGPs. In this case, BGP chooses the
shortest path between two nodes, even though the nodes might be in two different ASs.
The AIGP attribute is particularly useful in networks that use tunneling to deliver a packet
® ®
to its BGP next hop. The Juniper Networks Junos operating system (Junos OS) currently
supports the AIGP attribute for two BGP address families, family inet labeled-unicast and
family inet6 labeled-unicast.
AIGP impacts the BGP best-route decision process. The AIGP attribute preference rule
is applied after the local-preference rule. The AIGP distance is compared to break a tie.
The BGP best-route decision process also impacts the way the interior cost rule is applied
if the resolving next hop has an AIGP attribute. Without AIGP enabled, the interior cost
of a route is based on the calculation of the metric to the next hop for the route. With
AIGP enabled, the resolving AIGP distance is added to the interior cost.
The AIGP attribute is an optional non-transitive BGP path attribute and is specified in
Internet draft draft-ietf-idr-aigp-06, The Accumulated IGP Metric Attribute for BGP.
Requirements
Overview
The AIGP attribute enables deployments in which a single administration can run several
contiguous BGP autonomous systems (ASs). Such deployments allow BGP to make
routing decisions based on the IGP metric. With AIGP enabled, BGP can select paths
based on IGP metrics. This enables BGP to choose the shortest path between two nodes,
even though the nodes might be in different ASs. The AIGP attribute is particularly useful
in networks that use tunneling to deliver a packet to its BGP next hop. This example
shows AIGP configured with MPLS label-switched paths.
To enable AIGP, you include the aigp statement in the BGP configuration on a protocol
family basis. Configuring AIGP on a particular family enables sending and receiving of
the AIGP attribute on that family. By default, AIGP is disabled. An AIGP-disabled neighbor
does not send an AIGP attribute and silently discards a received AIGP attribute.
Junos OS supports AIGP for family inet labeled-unicast and family inet6 labeled-unicast.
The aigp statement can be configured for a given family at the global BGP, group, or
neighbor level.
By default, the value of the AIGP attribute for a local prefix is zero. An AIGP-enabled
neighbor can originate an AIGP attribute for a given prefix by export policy, using the
aigp-originate policy action. The value of the AIGP attribute reflects the IGP distance to
the prefix. Alternatively, you can specify a value, by using the aigp-originate distance
distance policy action. The configurable range is 0 through 4,294,967,295. Only one node
needs to originate an AIGP attribute. The AIGP attribute is retained and readvertised if
the neighbors are AIGP enabled with the aigp statement in the BGP configuration.
The policy action to originate the AIGP attribute has the following requirements:
• Prefix must reside within the AIGP domain. Typically, a loopback IP address is the prefix
to originate.
Topology Diagram
Figure 16 on page 139 shows the topology used in this example. OSPF is used as the interior
gateway protocol (IGP). Internal BGP (IBGP) is configured between Device PE1 and
Device PE4. External BGP (EBGP) is configured between Device PE7 and Device PE1,
between Device PE4 and Device PE3, and between Device PE4 and Device PE2. Devices
PE4, PE2, and PE3 are configured for multihop. Device PE4 selects a path based on the
AIGP value and then readvertises the AIGP value based on the AIGP and policy
configuration. Device PE1 readvertises the AIGP value to Device PE7, which is in another
administrative domain. Every device has two loopback interface addresses: 10.9.9.x is
used for BGP peering and the router ID, and 10.100.1.x is used for the BGP next hop.
The network between Device PE1 and PE3 has IBGP peering and multiple OSPF areas.
The external link to Device PE7 is configured to show that the AIGP attribute is readvertised
to a neighbor outside of the administrative domain, if that neighbor is AIGP enabled.
PE7 P1 PE2
PE4
10.9.9.4
PE1 P2 PE3
g041167
For origination of an AIGP attribute, the BGP next hop is required to be itself. If the BGP
next hop remains unchanged, the received AIGP attribute is readvertised, as is, to another
AIGP neighbor. If the next hop changes, the received AIGP attribute is readvertised with
an increased value to another AIGP neighbor. The increase in value reflects the IGP
distance to the previous BGP next hop. To demonstrate, this example uses loopback
interface addresses for Device PE4’s EBGP peering sessions with Device PE2 and Device
PE3. Multihop is enabled on these sessions so that a recursive lookup is performed to
determine the point-to-point interface. Because the next hop changes, the IGP distance
is added to the AIGP distance.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device P1
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@P1# set fe-1/2/0 unit 1 description P1-to-PE1
user@P1# set fe-1/2/0 unit 1 family inet address 10.0.0.2/30
user@P1# set fe-1/2/0 unit 1 family mpls
user@P1# set fe-1/2/1 unit 4 description P1-to-P2
user@P1# set fe-1/2/1 unit 4 family inet address 10.0.0.29/30
user@P1# set fe-1/2/1 unit 4 family mpls
user@P1# set fe-1/2/2 unit 8 description P1-to-PE4
user@P1# set fe-1/2/2 unit 8 family inet address 10.0.0.17/30
user@P1# set fe-1/2/2 unit 8 family mpls
user@P1# set lo0 unit 3 family inet address 10.9.9.2/32
user@P1# set lo0 unit 3 family inet address 10.100.1.2/32
[edit protocols]
user@P1# set rsvp interface fe-1/2/0.1
user@P1# set rsvp interface fe-1/2/2.8
user@P1# set rsvp interface fe-1/2/1.4
user@P1# set mpls label-switched-path P1-to-P2 to 10.9.9.3
user@P1# set mpls label-switched-path P1-to-PE1 to 10.9.9.1
user@P1# set mpls label-switched-path P1-to-PE4 to 10.9.9.4
user@P1# set mpls interface fe-1/2/0.1
user@P1# set mpls interface fe-1/2/2.8
user@P1# set mpls interface fe-1/2/1.4
3. Configure BGP.
4. Enable AIGP.
[edit routing-options]
user@P1# set router-id 10.9.9.2
user@P1# set autonomous-system 13979
user@P1# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, and show routing-options commands. If the output does not display the
intended configuration, repeat the instructions in this example to correct the configuration.
address 10.9.9.2/32;
address 10.100.1.2/32;
}
}
}
}
interface 10.100.1.2 {
passive;
metric 1;
}
}
}
Configuring Device P2
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@P2# set fe-1/2/0 unit 3 description P2-to-PE1
user@P2# set fe-1/2/0 unit 3 family inet address 10.0.0.6/30
user@P2# set fe-1/2/0 unit 3 family mpls
user@P2# set fe-1/2/1 unit 5 description P2-to-P1
user@P2# set fe-1/2/1 unit 5 family inet address 10.0.0.30/30
user@P2# set fe-1/2/1 unit 5 family mpls
user@P2# set fe-1/2/2 unit 6 description P2-to-PE4
user@P2# set fe-1/2/2 unit 6 family inet address 10.0.0.13/30
user@P2# set fe-1/2/2 unit 6 family mpls
user@P2# set lo0 unit 5 family inet address 10.9.9.3/32
user@P2# set lo0 unit 5 family inet address 10.100.1.3/32
[edit protocols]
user@P2# set rsvp interface fe-1/2/1.5
user@P2# set rsvp interface fe-1/2/2.6
user@P2# set rsvp interface fe-1/2/0.3
user@P2# set mpls label-switched-path P2-to-PE1 to 10.9.9.1
user@P2# set mpls label-switched-path P2-to-P1 to 10.9.9.2
user@P2# set mpls label-switched-path P2-to-PE4 to 10.9.9.4
user@P2# set mpls interface fe-1/2/1.5
user@P2# set mpls interface fe-1/2/2.6
user@P2# set mpls interface fe-1/2/0.3
3. Configure BGP.
4. Enable AIGP.
[edit routing-options]
user@P2# set router-id 10.9.9.3
user@P2# set autonomous-system 13979
user@P2# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, and show routing-options commands. If the output does not display the
intended configuration, repeat the instructions in this example to correct the configuration.
unit 5 {
family inet {
address 10.9.9.3/32;
address 10.100.1.3/32;
}
}
}
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@PE4# set fe-1/2/0 unit 7 description PE4-to-P2
user@PE4# set fe-1/2/0 unit 7 family inet address 10.0.0.14/30
user@PE4# set fe-1/2/0 unit 7 family mpls
user@PE4# set fe-1/2/1 unit 9 description PE4-to-P1
user@PE4# set fe-1/2/1 unit 9 family inet address 10.0.0.18/30
user@PE4# set fe-1/2/1 unit 9 family mpls
user@PE4# set fe-1/2/2 unit 10 description PE4-to-PE2
user@PE4# set fe-1/2/2 unit 10 family inet address 10.0.0.21/30
user@PE4# set fe-1/2/2 unit 10 family mpls
user@PE4# set fe-1/0/2 unit 12 description PE4-to-PE3
user@PE4# set fe-1/0/2 unit 12 family inet address 10.0.0.25/30
user@PE4# set fe-1/0/2 unit 12 family mpls
user@PE4# set lo0 unit 7 family inet address 10.9.9.4/32
user@PE4# set lo0 unit 7 family inet address 10.100.1.4/32
[edit protocols]
user@PE4# set rsvp interface fe-1/2/0.7
user@PE4# set rsvp interface fe-1/2/1.9
user@PE4# set rsvp interface fe-1/2/2.10
user@PE4# set rsvp interface fe-1/0/2.12
user@PE4# set mpls label-switched-path PE4-to-PE2 to 10.9.9.5
user@PE4# set mpls label-switched-path PE4-to-PE3 to 10.9.9.6
user@PE4# set mpls label-switched-path PE4-to-P1 to 10.9.9.2
user@PE4# set mpls label-switched-path PE4-to-P2 to 10.9.9.3
user@PE4# set mpls interface fe-1/2/0.7
user@PE4# set mpls interface fe-1/2/1.9
user@PE4# set mpls interface fe-1/2/2.10
user@PE4# set mpls interface fe-1/0/2.12
3. Configure BGP.
4. Enable AIGP.
By default, a prefix is originated using the current IGP distance. Optionally, you can
configure a distance for the AIGP attribute, using the distance option, as shown
here.
[edit routing-options]
user@PE4# set static route 44.0.0.0/24 discard
[edit routing-options]
10. If you are done configuring the device, commit the configuration.
user@PE4# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
}
interface fe-1/2/0.7;
interface fe-1/2/1.9;
interface fe-1/2/2.10;
interface fe-1/0/2.12;
}
bgp {
export [ next-hop aigp ];
group internal {
type internal;
local-address 10.9.9.4;
family inet {
labeled-unicast {
aigp;
}
}
neighbor 10.9.9.1;
neighbor 10.9.9.3;
neighbor 10.9.9.2;
}
group external {
type external;
multihop {
ttl 2;
}
local-address 10.9.9.4;
family inet {
labeled-unicast {
aigp;
}
}
peer-as 7018;
neighbor 10.9.9.5;
neighbor 10.9.9.6;
}
}
ospf {
area 0.0.0.0 {
interface fe-1/2/1.9 {
metric 1;
}
interface fe-1/2/0.7 {
metric 1;
}
interface 10.9.9.4 {
passive;
metric 1;
}
interface 10.100.1.4 {
passive;
metric 1;
}
}
area 0.0.0.2 {
interface fe-1/2/2.10 {
metric 1;
}
}
area 0.0.0.3 {
interface fe-1/0/2.12 {
metric 1;
}
}
}
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@PE1# set fe-1/2/0 unit 0 description PE1-to-P1
user@PE1# set fe-1/2/0 unit 0 family inet address 10.0.0.1/30
user@PE1# set fe-1/2/0 unit 0 family mpls
user@PE1# set fe-1/2/1 unit 2 description PE1-to-P2
user@PE1# set fe-1/2/1 unit 2 family inet address 10.0.0.5/30
user@PE1# set fe-1/2/1 unit 2 family mpls
user@PE1# set fe-1/2/2 unit 14 description PE1-to-PE7
user@PE1# set fe-1/2/2 unit 14 family inet address 10.0.0.9/30
user@PE1# set lo0 unit 1 family inet address 10.9.9.1/32
user@PE1# set lo0 unit 1 family inet address 10.100.1.1/32
[edit protocols]
user@PE1# set rsvp interface fe-1/2/0.0
user@PE1# set rsvp interface fe-1/2/1.2
user@PE1# set rsvp interface fe-1/2/2.14
user@PE1# set mpls label-switched-path PE1-to-P1 to 10.9.9.2
user@PE1# set mpls label-switched-path PE1-to-P2 to 10.9.9.3
user@PE1# set mpls interface fe-1/2/0.0
user@PE1# set mpls interface fe-1/2/1.2
user@PE1# set mpls interface fe-1/2/2.14
3. Configure BGP.
4. Enable AIGP.
[edit routing-options]
user@PE1# set router-id 10.9.9.1
user@PE1# set autonomous-system 13979
user@PE1# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
unit 2 {
description PE1-to-P2;
family inet {
address 10.0.0.5/30;
}
family mpls;
}
}
fe-1/2/2 {
unit 14 {
description PE1-to-PE7;
family inet {
address 10.0.0.9/30;
}
}
}
lo0 {
unit 1 {
family inet {
address 10.9.9.1/32;
address 10.100.1.1/32;
}
}
}
family inet {
labeled-unicast {
aigp;
}
}
export SET_EXPORT_ROUTES;
vpn-apply-export;
neighbor 10.9.9.4;
neighbor 10.9.9.2;
neighbor 10.9.9.3;
}
group external {
type external;
family inet {
labeled-unicast {
aigp;
}
}
export SET_EXPORT_ROUTES;
peer-as 7019;
neighbor 10.0.0.10;
}
}
ospf {
area 0.0.0.1 {
interface fe-1/2/0.0 {
metric 1;
}
interface fe-1/2/1.2 {
metric 1;
}
interface 10.9.9.1 {
passive;
metric 1;
}
interface 10.100.1.1 {
passive;
metric 1;
}
}
}
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@PE2# set fe-1/2/0 unit 11 description PE2-to-PE4
user@PE2# set fe-1/2/0 unit 11 family inet address 10.0.0.22/30
user@PE2# set fe-1/2/0 unit 11 family mpls
user@PE2# set lo0 unit 9 family inet address 10.9.9.5/32 primary
user@PE2# set lo0 unit 9 family inet address 10.100.1.5/32
[edit protocols]
user@PE2# set rsvp interface fe-1/2/0.11
user@PE2# set mpls label-switched-path PE2-to-PE4 to 10.9.9.4
user@PE2# set mpls interface fe-1/2/0.11
3. Configure BGP.
4. Enable AIGP.
By default, a prefix is originated using the current IGP distance. Optionally, you can
configure a distance for the AIGP attribute, using the distance option, as shown
here.
[edit policy-options]
user@PE2# set policy-statement SET_EXPORT_ROUTES term 10 from protocol
direct
user@PE2# set policy-statement SET_EXPORT_ROUTES term 10 from protocol
static
user@PE2# set policy-statement SET_EXPORT_ROUTES term 10 from protocol
bgp
user@PE2# set policy-statement SET_EXPORT_ROUTES term 10 then next-hop
10.100.1.5
user@PE2# set policy-statement SET_EXPORT_ROUTES term 10 then accept
user@PE2# set policy-statement next-hop term 10 from protocol bgp
user@PE2# set policy-statement next-hop term 10 then next-hop 10.100.1.5
user@PE2# set policy-statement next-hop term 10 then accept
user@PE2# set policy-statement next-hop term 20 from protocol direct
user@PE2# set policy-statement next-hop term 20 from route-filter 10.9.9.5/32
exact
user@PE2# set policy-statement next-hop term 20 from route-filter 10.100.1.5/32
exact
user@PE2# set policy-statement next-hop term 20 then next-hop 10.100.1.5
user@PE2# set policy-statement next-hop term 20 then accept
[edit routing-options]
user@PE2# set static route 99.0.0.0/24 discard
user@PE2# set static route 55.0.0.0/24 discard
[edit routing-options]
user@PE2# set router-id 10.9.9.5
user@PE2# set autonomous-system 7018
10. If you are done configuring the device, commit the configuration.
user@PE2# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
family inet {
address 10.0.0.22/30;
}
family mpls;
}
}
lo0 {
unit 9 {
family inet {
address 10.9.9.5/32 {
primary;
}
address 10.100.1.5/32;
}
}
}
}
term 20 {
from {
protocol direct;
route-filter 10.9.9.5/32 exact;
route-filter 10.100.1.5/32 exact;
}
then {
next-hop 10.100.1.5;
accept;
}
}
}
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@PE3# set fe-1/2/0 unit 13 description PE3-to-PE4
user@PE3# set fe-1/2/0 unit 13 family inet address 10.0.0.26/30
user@PE3# set fe-1/2/0 unit 13 family mpls
user@PE3# set lo0 unit 11 family inet address 10.9.9.6/32
user@PE3# set lo0 unit 11 family inet address 10.100.1.6/32
[edit protocols]
user@PE3# set rsvp interface fe-1/2/0.13
user@PE3# set mpls label-switched-path PE3-to-PE4 to 10.9.9.4
user@PE3# set mpls interface fe-1/2/0.13
3. Configure BGP.
4. Enable AIGP.
[edit policy-options]
user@PE3# set policy-statement SET_EXPORT_ROUTES term 10 from protocol
direct
user@PE3# set policy-statement SET_EXPORT_ROUTES term 10 from protocol
static
[edit routing-options]
user@PE3# set router-id 10.9.9.6
user@PE3# set autonomous-system 7018
user@PE3# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
vpn-apply-export;
peer-as 13979;
neighbor 10.9.9.4;
}
}
ospf {
area 0.0.0.3 {
interface 10.9.9.6 {
passive;
metric 1;
}
interface 10.100.1.6 {
passive;
metric 1;
}
interface fe-1/2/0.13 {
metric 1;
}
}
}
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@PE7# set fe-1/2/0 unit 15 description PE7-to-PE1
user@PE7# set fe-1/2/0 unit 15 family inet address 10.0.0.10/30
user@PE7# set lo0 unit 13 family inet address 10.9.9.7/32
user@PE7# set lo0 unit 13 family inet address 10.100.1.7/32
2. Configure BGP.
3. Enable AIGP.
[edit routing-options]
user@PE7# set router-id 10.9.9.7
user@PE7# set autonomous-system 7019
user@PE7# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
export SET_EXPORT_ROUTES;
peer-as 13979;
neighbor 10.0.0.9;
}
}
Verification
• Verifying That Device PE4 Is Receiving the AIGP Attribute from Its EBGP Neighbor
PE2 on page 169
• Checking the IGP Metric on page 169
• Verifying That Device PE4 Adds the IGP Metric to the AIGP Attribute on page 170
• Verifying That Device PE7 Is Receiving the AIGP Attribute from Its EBGP Neighbor
PE1 on page 170
• Verifying the Resolving AIGP Metric on page 171
• Verifying the Presence of AIGP Attributes in BGP Updates on page 174
Verifying That Device PE4 Is Receiving the AIGP Attribute from Its EBGP Neighbor PE2
Purpose Make sure that the AIGP policy on Device PE2 is working.
Purpose From Device PE4, check the IGP metric to the BGP next hop 10.100.1.5.
Verifying That Device PE4 Adds the IGP Metric to the AIGP Attribute
Purpose Make sure that Device PE4 adds the IGP metric to the AIGP attribute when it readvertises
routes to its IBGP neighbor, Device PE1.
Meaning The IGP metric is added to the AIGP metric (20 + 2 = 22 and 30 + 2 = 32), because the
next hop is changed for these routes.
Verifying That Device PE7 Is Receiving the AIGP Attribute from Its EBGP Neighbor PE1
Purpose Make sure that the AIGP policy on Device PE1 is working.
Meaning The 44.0.0.0/24 route is originated at Device PE4. The 55.0.0.0/24 and 99.0.0.0/24
routes are originated at Device PE2. The IGP distances are added to the configured AIGP
distances.
Purpose Confirm that if the prefix is resolved through recursion and the recursive next hops have
AIGP metrics, the prefix has the sum of the AIGP values that are on the recursive BGP
next hops.
[edit routing-options]
user@PE2# set static route 66.0.0.0/24 discard
2. Delete the existing terms in the aigp policy statement on Device PE2.
The policy shows the AIGP metric for prefix 66.0.0.0/24 (none) and its recursive next
hop. Prefix 66.0.0.0/24 is resolved by 55.0.0.1. Prefix 66.0.0.0/24 does not have its
own AIGP metric being originated, but its recursive next hop, 55.0.0.1, has an AIGP
value.
The value of Metric2 is the IGP metric to the BGP next hop. When Device PE4
readvertises these routes to its IBGP peer, Device PE1, the AIGP metric is the sum of
AIGP + its Resolving AIGP metric + Metric2.
Prefix 55.0.0.0 shows its own IGP metric 20, as defined and advertised by Device PE2.
It does not show a resolving AIGP value because it does not have a recursive BGP next
hop. The value of Metric2 is 2.
Prefix 66.0.0.0/24 shows the Resolving AIGP, which is the sum of its own AIGP metric
and its recursive BGP next hop:
Purpose If the AIGP attribute is not enabled under BGP (or the group or neighbor hierarchies), the
AIGP attribute is silently discarded. Enable traceoptions and include the packets flag in
the detail option in the configuration to confirm the presence of the AIGP attribute in
transmitted or received BGP updates. This is useful when debugging AIGP issues.
The following sample shows Device PE2 advertising prefix 99.0.0.0/24 to Device PE4
(10.9.9.4) with an AIGP metric of 20:
3. Verify that the route was received on Device PE4 using the show route receive-protocol
command.
AIGP is not enabled on Device PE4, so the AIGP attribute is silently discarded for prefix
99.0.0.0/24 and does not appear in the following output:
The following output from the traceoptions log shows that the 99.0.0.0/24 prefix
was received with the AIGP attribute attached:
Meaning Performing this verification helps with AIGP troubleshooting and debugging issues. It
enables you to verify which devices in your network send and receive AIGP attributes.
Understanding AS Override
The AS override feature allows a provider edge (PE) router to change the private
autonomous system (AS) number used by a customer edge (CE) device on an external
BGP (EBGP) session running on a VPN routing and forwarding (VRF) access link. The
private AS number is changed to the PE AS number. Another CE device connected to
another PE device sees the EBGP route coming from the first site with an AS path of
provider-ASN provider-ASN, instead of provider-ASN site1-ASN. This allows enterprise
networks to use the same private ASN on all sites.
The AS override feature offers a clear management advantage to the service provider
because BGP by default does not accept BGP routes with an AS path attribute that
contains the local AS number.
In an enterprise network with multiple sites, you might wish to use a single AS number
across sites. Suppose, for example that two CE devices are in AS 64512 and that the
provider network is in AS 65534.
When the service provider configures a Layer 3 VPN with this setup, even if the MPLS
network has routes towards Device CE1 and Device CE2, Device CE1 and Device CE2 do
not have routes to each other because the AS path attribute would appear as 64512
65534 64512. BGP uses the AS path attribute as its loop avoidance mechanism. If a site
sees its own AS number more than once in the AS path, the route is considered invalid.
One way to overcome this difficulty is with the as-override statement, which is applied
to the PE devices. The as-override statement replaces the CE device's AS number with
that of the PE device, thus preventing the customer AS number from appearing more
than once in the AS path attribute.
If a customer uses AS path prepending to make certain paths less desirable and the
service provider uses AS override, each CE AS number occurrence in the AS-path is
changed to the service provider AS number. For example, suppose that all customer sites
use the same AS number, say 64512. If the ISP uses AS number 65534, one customer
site sees the path to another site as 65534 65534. If the customer prepends 64512 on a
particular path to make it less desirable, another customer site sees that path as 65534
65534 65534.
Requirements
Overview
This example has two CE devices, two provider edge (PE) devices, and several provider
core devices. The provider network is also using IS-IS to support LDP and BGP loopback
reachability Device P2 is acting as a route reflector (RR). Both CE devices are in
autonomous system (AS) 64512. The provider network is in AS 65534.
The as-override statement is applied to the PE devices, thus replacing the CE device's
AS number with that of the PE device. This prevents the customer AS number from
appearing more than once in the AS path attribute.
“CLI Quick Configuration” on page 177 shows the configuration for all of the devices in
Figure 17 on page 176. The section “Step-by-Step Procedure” on page 180 describes the
steps on Device PE1.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Device CE1 set interfaces ge-1/2/0 unit 0 family inet address 10.0.0.1/30
set interfaces ge-1/2/0 unit 0 family iso
set interfaces lo0 unit 0 family inet address 10.255.1.1/32
set interfaces lo0 unit 0 family iso address 49.0001.0010.0000.0101.00
set protocols bgp group PE type external
set protocols bgp group PE family inet unicast
set protocols bgp group PE export ToBGP
set protocols bgp group PE peer-as 65534
set protocols bgp group PE neighbor 10.0.0.2
set policy-options policy-statement ToBGP term Direct from protocol direct
set policy-options policy-statement ToBGP term Direct then accept
set routing-options router-id 10.255.1.1
set routing-options autonomous-system 64512
Device PE1 set interfaces ge-1/2/0 unit 0 family inet address 10.0.0.2/30
set interfaces ge-1/2/0 unit 0 family iso
set interfaces ge-1/2/0 unit 0 family mpls
set interfaces ge-1/2/1 unit 0 family inet address 10.0.0.5/30
set interfaces ge-1/2/1 unit 0 family iso
set interfaces ge-1/2/1 unit 0 family mpls
set interfaces ge-1/2/2 unit 0 family inet address 10.0.0.21/30
set interfaces ge-1/2/2 unit 0 family iso
set interfaces ge-1/2/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 10.255.2.2/32
set interfaces lo0 unit 0 family iso address 49.0001.0010.0000.0202.00
set protocols mpls interface ge-1/2/2.0
set protocols mpls interface ge-1/2/1.0
set protocols mpls interface lo0.0
set protocols mpls interface fxp0.0 disable
set protocols bgp group l3vpn type internal
set protocols bgp group l3vpn local-address 10.255.2.2
set protocols bgp group l3vpn family inet-vpn unicast
set protocols bgp group l3vpn peer-as 65534
set protocols bgp group l3vpn local-as 65534
set protocols bgp group l3vpn neighbor 10.255.4.4
set protocols isis interface ge-1/2/1.0 level 2 metric 10
set protocols isis interface ge-1/2/1.0 level 1 disable
set protocols isis interface ge-1/2/2.0 level 2 metric 10
set protocols isis interface ge-1/2/2.0 level 1 disable
set protocols isis interface fxp0.0 disable
set protocols isis interface lo0.0 level 2 metric 0
set protocols ldp deaggregate
set protocols ldp interface ge-1/2/1.0
set protocols ldp interface ge-1/2/2.0
set protocols ldp interface fxp0.0 disable
set protocols ldp interface lo0.0
set routing-instances VPN-A instance-type vrf
set routing-instances VPN-A interface ge-1/2/0.0
set routing-instances VPN-A route-distinguisher 65534:1234
set routing-instances VPN-A vrf-target target:65534:1234
set routing-instances VPN-A protocols bgp group CE type external
set routing-instances VPN-A protocols bgp group CE family inet unicast
set routing-instances VPN-A protocols bgp group CE neighbor 10.0.0.1 peer-as 64512
set routing-instances VPN-A protocols bgp group CE neighbor 10.0.0.1 as-override
set routing-options router-id 10.255.2.2
set routing-options autonomous-system 65534
Device PE2 set interfaces ge-1/2/0 unit 0 family inet address 10.0.0.14/30
set interfaces ge-1/2/0 unit 0 family iso
set interfaces ge-1/2/0 unit 0 family mpls
set interfaces ge-1/2/1 unit 0 family inet address 10.0.0.17/30
set interfaces ge-1/2/1 unit 0 family iso
set interfaces ge-1/2/2 unit 0 family inet address 10.0.0.29/30
set interfaces ge-1/2/2 unit 0 family iso
set interfaces ge-1/2/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 10.255.5.5/32
set interfaces lo0 unit 0 family iso address 49.0001.0010.0000.0505.00
set protocols mpls interface ge-1/2/0.0
set protocols mpls interface ge-1/2/2.0
Device CE2 set interfaces ge-1/2/0 unit 0 family inet address 10.0.0.18/30
set interfaces ge-1/2/0 unit 0 family iso
set interfaces lo0 unit 0 family inet address 10.255.6.6/32
set interfaces lo0 unit 0 family iso address 49.0001.0010.0000.0606.00
set protocols bgp group PE type external
set protocols bgp group PE family inet unicast
set protocols bgp group PE export ToBGP
set protocols bgp group PE peer-as 65534
set protocols bgp group PE neighbor 10.0.0.17
set policy-options policy-statement ToBGP term Direct from protocol direct
set policy-options policy-statement ToBGP term Direct then accept
set routing-options router-id 10.255.6.6
set routing-options autonomous-system 64512
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
To configure AS override:
To enable MPLS, include the protocol family on the interface so that the interface
does not discard incoming MPLS traffic.
[edit interfaces]
2. Add the interface to the MPLS protocol to establish the control plane level
connectivity.
Set up the IGP so that the provider devices can communicate with each other.
[edit protocols]
user@PE1# set mpls interface ge-1/2/2.0
user@PE1# set mpls interface ge-1/2/1.0
user@PE1# set mpls interface lo0.0
user@PE1# set mpls interface fxp0.0 disable
user@PE1# set isis interface ge-1/2/1.0 level 2 metric 10
user@PE1# set isis interface ge-1/2/1.0 level 1 disable
user@PE1# set isis interface ge-1/2/2.0 level 2 metric 10
user@PE1# set isis interface ge-1/2/2.0 level 1 disable
user@PE1# set isis interface fxp0.0 disable
user@PE1# set isis interface lo0.0 level 2 metric 0
user@PE1# set ldp deaggregate
user@PE1# set ldp interface ge-1/2/1.0
user@PE1# set ldp interface ge-1/2/2.0
user@PE1# set ldp interface fxp0.0 disable
user@PE1# set ldp interface lo0.0
3. Enable the internal BGP (IBGP) connection to peer with the RR only, using the IPv4
VPN unicast address family.
Create the routing-Instance (VRF) on the PE device, setting up the BGP configuration
to peer with Device CE1.
[edit routing-options]
user@PE1# set router-id 10.255.2.2
user@PE1# set autonomous-system 65534
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show routing-instances, and show routing-options commands. If the
output does not display the intended configuration, repeat the configuration instructions
in this example to correct it.
type external;
family inet {
unicast;
}
neighbor 10.0.0.1 {
peer-as 64512;
as-override;
}
}
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Display information on Device PE1 about the AS path attribute for the route to Device
CE2’s loopback interface.
Action On Device PE1, from operational mode, enter the show route table VPN-A.inet.0 10.255.6.6
command.
Meaning The output shows that Device PE1 has an AS path for 10.255.6.6/32 as coming from AS
64512.
Purpose Make sure the route to Device CE2 is advertised to Device CE1 as if it is coming from the
MPLS core.
Action On Device PE1, from operational mode, enter the show route advertising-protocol bgp
10.0.0.1 command.
Meaning The output indicates that Device PE1 is advertising only its own AS number in the AS
path.
Purpose Make sure that Device CE1 contains only the provider AS number in the AS path for the
route to Device CE2.
Action From operational mode, enter the show route table inet.0 terse 10.255.6.6 command.
Meaning The output indicates that Device CE1 has a route to Device CE2. The loop issue is resolved
with the use of the as-override statement.
One route is hidden on the CE device. This is because Junos OS does not perform a BGP
split horizon. Generally, split horizon in BGP is unnecessary, because any routes that might
be received back by the originator are less preferred due to AS path length (for EBGP),
AS path loop detection (IBGP), or other BGP metrics. Advertising routes back to the
neighbor from which they were learned has a negligible effect on the router's performance,
and is the correct thing to do.
Junos OS does not advertise the routes learned from one EBGP peer back to the same
external BGP (EBGP) peer. In addition, the software does not advertise those routes back
to any EBGP peers that are in the same autonomous system (AS) as the originating peer,
regardless of the routing instance. You can modify this behavior by including the
advertise-peer-as statement in the configuration.
If you include the advertise-peer-as statement in the configuration, BGP advertises the
route regardless of this check.
no-advertise-peer-as;
The route suppression default behavior is disabled if the as-override statement is included
in the configuration. If you include both the as-override and no-advertise-peer-as
statements in the configuration, the no-advertise-peer-as statement is ignored.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
This example shows three routing devices with external BGP (EBGP) connections. Device
R2 has an EBGP connection to Device R1 and another EBGP connection to Device R3.
Although separated by Device R2 which is in AS 64511, Device R1 and Device R3 are in the
same AS (AS 64512). Device R1 and Device R3 advertise into BGP direct routes to their
own loopback interface addresses.
Device R2 receives these loopback interface routes, and the advertise peer-as statement
allows Device R2 to advertise them. Specifically, Device R1 sends the 192.168.0.1 route
to Device R2, and because Device R2 has the advertise peer-as configured, Device R2 can
send the 192.168.0.1 route to Device R3. Likewise, Device R3 sends the 192.168.0.3 route
to Device R2, and advertise peer-as enables Device R2 to forward the route to Device R1.
To enable Device R1 and Device R3 to accept routes that contain their own AS number
in the AS path, the loops 2 statement is required on Device R1 and Device R3.
Topology
“CLI Quick Configuration” on page 187 shows the configuration for all of the devices in
Figure 18 on page 187.
The section “Step-by-Step Procedure” on page 188 describes the steps on Device R1 and
Device R2.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R1# set fe-1/2/0 unit 0 family inet address 10.0.0.1/30
2. Configure BGP.
3. Prevent routes from Device R3 from being hidden on Device R1 by including the
loops 2 statement.
The loops 2 statement means that the local device’s own AS number can appear
in the AS path up to one time without causing the route to be hidden. The route is
hidden if the local device’s AS number is detected in the path two or more times.
5. Apply the export policy to the BGP peering session with Device R2.
[edit routing-options ]
user@R1# set autonomous-system 300
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
2. Configure BGP.
3. Configure Device R2 to advertise routes learned from one EBGP peer to another
EBGP peer in the same AS.
In other words, advertise to Device R1 routes learned from Device R3 (and the
reverse), even though Device R1 and Device R3 are in the same AS.
[edit routing-options]
user@R2# set autonomous-system 200
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
neighbor 10.1.0.2 {
peer-as 300;
}
}
}
If you are done configuring the devices, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly.
Purpose Make sure that the routing tables on Device R1 and Device R3 contain the expected routes.
Action 1. On Device R2, deactivate the advertise-peer-as statement in the BGP configuration.
3. On Device R1, check to see what routes are advertised to Device R2.
4. On Device R2, check to see what routes are received from Device R1.
5. On Device R2, check to see what routes are advertised to Device R3.
* 10.0.0.0/30 Self I
* 10.1.0.0/30 Self I
* 192.168.0.2/32 Self I
7. On Device R2, recheck the routes that are advertised to Device R3.
8. On Device R3, check the routes that are received from Device R2.
10. On Device R3, recheck the routes that are received from Device R2.
Meaning First the advertise-peer-as statement and the loops statement are deactivated so that
the default behavior can be examined. Device R1 sends to Device R2 a route to Device
R1’s loopback interface address, 192.168.0.1/32. Device R2 does not advertise this route
to Device R3. After activating the advertise-peer-as statement, Device R2 does advertise
the 192.168.0.1/32 route to Device R3. Device R3 does not accept this route until after the
loops statement is activated.
Related • Example: Configuring a Layer 3 VPN with Route Reflection and AS Override on page 176
Documentation
• Example: Applying Routing Policies at Different Levels of the BGP Hierarchy on page 193
• Example: Configuring BGP Interactions with IGPs on page 202
• Example: Redistributing BGP Routes with a Specific Community Tag into
IS-IS on page 205
• Example: Configuring BGP Route Advertisement on page 215
• Example: Configuring EBGP Multihop on page 223
• Example: Configuring BGP Route Preference (Administrative Distance) on page 232
• Example: Configuring BGP Path Selection on page 239
• Example: Removing Private AS Numbers on page 249
• Example: Overriding the Default BGP Routing Policy on PTX Series Packet Transport
Routers on page 256
• Example: Configuring Conditional Installation of Prefixes in a Routing Table on page 260
• Example: Setting BGP to Advertise Inactive Routes on page 279
• Example: Configuring BGP to Advertise the Best External Route to Internal
Peers on page 285
• Example: Disabling Suppression of Route Advertisements on page 292
• Example: Defining a Routing Policy That Removes BGP Communities on page 300
• Example: Defining a Routing Policy Based on the Number of BGP
Communities on page 307
• Example: Using Routing Policy to Set a Preference Value for BGP Routes on page 314
• Example: Load Balancing BGP Traffic with Unequal Bandwidth Allocated to the
Paths on page 320
This example shows BGP configured in a simple network topology and explains how
routing polices take effect when they are applied at different levels of the BGP
configuration.
Requirements
No special configuration beyond device initialization is required before configuring this
example.
Overview
For BGP, you can apply policies as follows:
• BGP global import and export statements—Include these statements at the [edit
protocols bgp] hierarchy level (for routing instances, include these statements at the
[edit routing-instances routing-instance-name protocols bgp] hierarchy level).
• Group import and export statements—Include these statements at the [edit protocols
bgp group group-name] hierarchy level (for routing instances, include these statements
at the [edit routing-instances routing-instance-name protocols bgp group group-name]
hierarchy level).
• Peer import and export statements—Include these statements at the [edit protocols
bgp group group-name neighbor address] hierarchy level (for routing instances, include
these statements at the [edit routing-instances routing-instance-name protocols bgp
group group-name neighbor address] hierarchy level).
In this example, a policy named send-direct is applied at the global level, another policy
named send-192.168.0.1 is applied at the group level, and a third policy named
send-192.168.20.1 is applied at the neighbor level.
A key point, and one that is often misunderstood and that can lead to problems, is that
in such a configuration, only the most explicit policy is applied. A neighbor-level policy is
more explicit than a group-level policy, which in turn is more explicit than a global policy.
The neighbor 2.2.2.2 is subjected only to the send-192.168.20.1 policy. The neighbor 3.3.3.3,
lacking anything more specific, is subjected only to the send-192.168.0.1 policy. Meanwhile,
neighbor 4.4.4.4 in group other-group has no group or neighbor-level policy, so it uses
the send-direct policy.
If you need to have neighbor 2.2.2.2 perform the function of all three policies, you can
write and apply a new neighbor-level policy that encompasses the functions of the other
three, or you can apply all three existing policies, as a chain, to neighbor 2.2.2.2.
“CLI Quick Configuration” on page 195 shows the configuration for all of the devices in
Figure 19 on page 195.
The section “Step-by-Step Procedure” on page 197 describes the steps on Device R1.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R1# set fe-1/2/0 unit 0 description to-R2
user@R1# set fe-1/2/0 unit 0 family inet address 10.10.10.1/30
[edit routing-options]
user@R1# set static route 192.168.0.1/32 discard
user@R1# set static route 192.168.20.1/32 discard
[edit routing-options]
[edit]
user@R1# commit
Results
From configuration mode, confirm your configuration by issuing the show interfaces, show
protocols, show policy-options, and show routing-options commands. 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.
Purpose Make sure that the BGP export policies are working as expected by checking the routing
tables.
Meaning On Device R1, the show route protocol direct command displays two direct routes: 1.1.1.1/32
and 10.10.10.0/30. The show route protocol static command displays two static routes:
192.168.0.1/32 and 192.168.20.1/32.
On Device R2, the show route protocol bgp command shows that the only route that
Device R2 has learned through BGP is the 192.168.20.1/32 route.
On Device R3, the show route protocol bgp command shows that the only route that
Device R3 has learned through BGP is the 192.168.0.1/32 route.
On Device R4, the show route protocol bgp command shows that the only routes that
Device R4 has learned through BGP are the 1.1.1.1/32 and 10.10.10.0/30 routes.
Purpose Make sure that the BGP export policies are working as expected by checking the BGP
routes received from Device R1.
Meaning On Device R2, the route receive-protocol bgp 1.1.1.1 command shows that Device R2 received
only one BGP route, 192.168.20.1/32, from Device R1.
On Device R3, the route receive-protocol bgp 1.1.1.1 command shows that Device R3 received
only one BGP route, 192.168.0.1/32, from Device R1.
On Device R4, the route receive-protocol bgp 1.1.1.1 command shows that Device R4
received two BGP routes, 1.1.1.1/32 and 10.10.10.0/30, from Device R1.
In summary, when multiple policies are applied at different CLI hierarchies in BGP, only
the most specific application is evaluated, to the exclusion of other, less specific policy
applications. Although this point might seem to make sense, it is easily forgotten during
router configuration, when you mistakenly believe that a neighbor-level policy is combined
with a global or group-level policy, only to find that your policy behavior is not as
anticipated.
Once a policy is created and named, it must be applied before it is active. You apply
routing policies using the import and export statements at the protocols>protocol-name
level in the configuration hierarchy.
In the import statement, you list the name of the routing policy to be evaluated when
routes are imported into the routing table from the routing protocol.
In the export statement, you list the name of the routing policy to be evaluated when
routes are being exported from the routing table into a dynamic routing protocol. Only
active routes are exported from the routing table.
To specify more than one policy and create a policy chain, you list the policies using a
space as a separator. If multiple policies are specified, the policies are evaluated in the
order in which they are specified. As soon as an accept or reject action is executed, the
policy chain evaluation ends.
Requirements
Overview
In this example, you create a routing policy called injectpolicy1 and a routing term called
injectterm1. The policy injects OSPF routes into the BGP routing table.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
4. Specify that the route is to be accepted if the previous conditions are matched.
[edit]
user@host# set protocols bgp export injectpolicy1
Results Confirm your configuration by entering the show policy-options and show protocols bgp
commands from configuration mode. If the output does not display the intended
configuration, repeat the instructions in this example to correct the configuration.
If you are done configuring the device, enter commit from configuration mode.
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
Results Confirm your configuration by entering the show policy-options and show routing-options
commands from configuration mode. If the output does not display the intended
configuration, repeat the instructions in this example to correct the configuration.
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Troubleshooting
• Using the show log Command to Examine the Actions of the Routing Policy on page 205
Using the show log Command to Examine the Actions of the Routing Policy
Problem The routing table contains unexpected routes, or routes are missing from the routing
table.
Solution If you configure policy tracing as shown in this example, you can run the show log
ospf-bgp-policy-log command to diagnose problems with the routing policy. The show
log ospf-bgp-policy-log command displays information about the routes that the
injectpolicy1 policy term analyzes and acts upon.
Example: Redistributing BGP Routes with a Specific Community Tag into IS-IS
having to elaborate upon each member. You can use community and extended
communities attributes to trigger routing decisions, such as acceptance, rejection,
preference, or redistribution.
You can assign community tags to non-BGP routes through configuration (for static,
aggregate, or generated routes) or an import routing policy. These tags can then be
matched when BGP exports the routes.
A community value is a 32-bit field that is divided into two main sections. The first 16 bits
of the value encode the AS number of the network that originated the community, while
the last 16 bits carry a unique number assigned by the AS. This system attempts to
guarantee a globally unique set of community values for each AS in the Internet. Junos
OS uses a notation of as-number:community-value, where each value is a decimal number.
The AS values of 0 and 65,535 are reserved, as are all of the community values within
those AS numbers. Each community, or set of communities, is given a name within the
[edit policy-options] configuration hierarchy. The name of the community uniquely
identifies it to the routing device and serves as the method by which routes are categorized.
For example, a route with a community value of 64510:1111 might belong to the community
named AS64510-routes. The community name is also used within a routing policy as a
match criterion or as an action. The command syntax for creating a community is:
policy-options community name members [community-ids]. The community-ids are either
a single community value or multiple community values. When more than one value is
assigned to a community name, the routing device interprets this as a logical AND of the
community values. In other words, a route must have all of the configured values before
being assigned the community name.
The regular community attribute is four octets. Networking enhancements, such as VPNs,
have functionality requirements that can be satisfied by an attribute such as a community.
However, the 4-octet community value does not provide enough expansion and flexibility
to accommodate VPN requirements. This leads to the creation of extended communities.
An extended community is an 8-octet value that is also divided into two main sections.
The first 2 octets of the community encode a type field while the last 6 octets carry a
unique set of data in a format defined by the type field. Extended communities provide
a larger range for grouping or categorizing communities.
When specifying community IDs for standard and extended community attributes, you
can use UNIX-style regular expressions. The only exception is for VPN import policies
(vrf-import), which do not support regular expressions for the extended communities
attribute.
Example: Redistributing BGP Routes with a Specific Community Tag into IS-IS
This example defines a policy that takes BGP routes from the Edu community and places
them into IS-IS with a metric of 63.
Requirements
Overview
Figure 20: Redistributing BGP Routes with a Specific Community Tag into
IS-IS
AS 1
IS-IS
A D
.5 .14
10.0.0.4/30 IBGP 10.0.0.12/30 AS 2
fe-1/2/0 .6 .13 fe-1/2/1
.9 10.0.0.8/30 .10 .25 10.0.0.24/30 .26
B C E
fe-1/2/1 IBGP fe-1/2/0 fe-1/2/2 EBGP
10.2/16
10.3/16
g041311
In this example, Device A, Device B, Device C, and Device D are in autonomous system
(AS) 1 and are running IS-IS. All of the AS 1 devices, except Device D, are running internal
BGP (IBGP).
Device E is in AS 2 and has an external BGP (EBGP) peering session with Device C. Device
E has two static routes, 10.2.0.0/16 and 10.3.0.0/16. These routes are tagged with the
Edu 2:5 community attribute and are advertised by way of EBGP to Device C.
Device C accepts the BGP routes that are tagged with the Edu 2:5 community attribute,
redistributes the routes into IS-IS, and applies an IS-IS metric of 63 to these routes.
“CLI Quick Configuration” on page 208 shows the configuration for all of the devices in
Figure 20 on page 207. The section “Step-by-Step Procedure” on page 209 describes the
steps on Device C and Device E.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
To configure Device E:
[edit interfaces]
2. Configure the statics policy, which adds the Edu community attribute to the static
routes.
[edit policy-options]
user@E# set policy-statement statics from protocol static
user@E# set policy-statement statics then community add Edu
user@E# set policy-statement statics then accept
user@E# set community Edu members 2:5
[edit routing-options]
user@E# set router-id 192.168.0.5
user@E# set autonomous-system 2
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
To configure Device C:
[edit interfaces]
user@C# set fe-1/2/0 unit 0 family inet address 10.0.0.10/30
user@C# set fe-1/2/0 unit 0 family iso
user@C# set fe-1/2/1 unit 0 family inet address 10.0.0.13/30
user@C# set fe-1/2/1 unit 0 family iso
user@C# set fe-1/2/2 unit 0 family inet address 10.0.0.25/30
user@C# set fe-1/2/2 unit 0 family iso
user@C# set lo0 unit 0 family inet address 192.168.0.3/32
user@C# set lo0 unit 0 family iso address 49.0002.0192.0168.0003.00
2. Configure IBGP.
3. Configure the Edu-to-isis policy, which redistributes the Edu-tagged BGP routes
learned from Device E and applies a metric of 63.
[edit policy-options]
user@C# set policy-statement Edu-to-isis term 1 from protocol bgp
user@C# set policy-statement Edu-to-isis term 1 from community Edu
user@C# set policy-statement Edu-to-isis term 1 then metric 63
user@C# set policy-statement Edu-to-isis term 1 then accept
user@C# set community Edu members 2:5
Without this policy, Device E would not have connectivity to the networks in AS 1.
[edit routing-options]
user@C# set router-id 192.168.0.3
user@C# set autonomous-system 1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.5/32 {
primary;
}
address 10.2.0.1/32;
address 10.3.0.1/32;
}
}
}
}
fe-1/2/1 {
unit 0 {
family inet {
address 10.0.0.13/30;
}
family iso;
}
}
fe-1/2/2 {
unit 0 {
family inet {
address 10.0.0.25/30;
}
family iso;
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.3/32;
}
family iso {
address 49.0002.0192.0168.0003.00;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Verify that the BGP routes from Device E are communicated on the IS-IS network in AS
1.
Action From operational mode, enter the show route protocol isis command.
Meaning As expected, the 10.2.0.0/16 and 10.3.0.0/16 routes are in Device D’s routing table as
IS-IS external routes with a metric of 73. If Device C had not added 63 to the metric,
Device D would have a metric of 10 for these routes.
When configuring BGP routing policy, you can perform the following tasks:
You define routing policy at the [edit policy-options] hierarchy level. To apply policies
you have defined for BGP, include the import and export statements within the BGP
configuration.
• BGP global import and export statements—Include these statements at the [edit
protocols bgp] hierarchy level (for routing instances, include these statements at the
[edit routing-instances routing-instance-name protocols bgp] hierarchy level).
• Group import and export statements—Include these statements at the [edit protocols
bgp group group-name] hierarchy level (for routing instances, include these statements
• Peer import and export statements—Include these statements at the [edit protocols
bgp group group-name neighbor address] hierarchy level (for routing instances, include
these statements at the [edit routing-instances routing-instance-name protocols bgp
group group-name neighbor address] hierarchy level).
• Applying Policies to Routes Being Imported into the Routing Table from BGP on page 216
• Applying Policies to Routes Being Exported from the Routing Table into BGP on page 216
Applying Policies to Routes Being Imported into the Routing Table from BGP
To apply policy to routes being imported into the routing table from BGP, include the
import statement, listing the names of one or more policies to be evaluated:
import [ policy-names ];
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
If you specify more than one policy, they are evaluated in the order specified, from first
to last, and the first matching filter is applied to the route. If no match is found, BGP
places into the routing table only those routes that were learned from BGP routing devices.
Applying Policies to Routes Being Exported from the Routing Table into BGP
To apply policy to routes being exported from the routing table into BGP, include the
export statement, listing the names of one or more policies to be evaluated:
export [ policy-names ];
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
If you specify more than one policy, they are evaluated in the order specified, from first
to last, and the first matching filter is applied to the route. If no routes match the filters,
the routing table exports into BGP only the routes that it learned from BGP.
By default, BGP stores the route information it receives from update messages in the
Junos OS routing table, and the routing table exports only active routes into BGP, which
BGP then advertises to its peers. To have the routing table export to BGP the best route
learned by BGP even if Junos OS did not select it to be an active route, include the
advertise-inactive statement:
advertise-inactive;
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
In general, deployed BGP implementations do not advertise the external route with the
highest local preference value to internal peers unless it is the best route. Although this
behavior was required by an earlier version of the BGP version 4 specification, RFC 1771,
it was typically not followed in order to minimize the amount of advertised information
and to prevent routing loops. However, there are scenarios in which advertising the best
external route is beneficial, in particular, situations that can result in IBGP route oscillation.
In Junos OS Release 9.3 and later, you can configure BGP to advertise the best external
route into an internal BGP (IBGP) mesh group, a route reflector cluster, or an autonomous
system (AS) confederation, even when the best route is an internal route.
When a routing device is configured as a route reflector for a cluster, a route advertised
by the route reflector is considered internal if it is received from an internal peer with the
same cluster identifier or if both peers have no cluster identifier configured. A route
received from an internal peer that belongs to another cluster, that is, with a different
cluster identifier, is considered external.
You can also configure BGP to advertise the external route only if the route selection
process reaches the point where the multiple exit discriminator (MED) metric is evaluated.
As a result, an external route with an AS path worse (that is, longer) than that of the
active path is not advertised.
Junos OS also provides support for configuring a BGP export policy that matches on the
state of an advertised route. You can match on either active or inactive routes. For more
information, see the Routing Policy Feature Guide for Routing Devices.
To configure BGP to advertise the best external path to internal peers, include the
advertise-external statement:
advertise-external;
For a complete list of hierarchy levels at which you can configure this
statement, see the statement summary section for this statement.
To configure BGP to advertise the best external path only if the route selection process
reaches the point where the MED value is evaluated, include the conditional statement:
advertise-external {
conditional;
}
For a complete list of hierarchy levels at which you can configure this statement, see the
statement summary section for this statement.
Configuring How Often BGP Exchanges Routes with the Routing Table
BGP stores the route information it receives from update messages in the routing table,
and the routing table exports active routes from the routing table into BGP. BGP then
advertises the exported routes to its peers. By default, the exchange of route information
between BGP and the routing table occurs immediately after the routes are received.
This immediate exchange of route information might cause instabilities in the network
reachability information. To guard against this, you can delay the time between when
BGP and the routing table exchange route information.
To configure how often BGP and the routing table exchange route information, include
the out-delay statement:
out-delay seconds;
By default, the routing table retains some of the route information learned from BGP. To
have the routing table retain all or none of this information, include the keep statement:
For a list of hierarchy levels at which you can include these statements, see the statement
summary sections for these statements.
The routing table can retain the route information learned from BGP in one of the following
ways:
• Default (omit the keep statement)—Keep all route information that was learned from
BGP, except for routes whose AS path is looped and whose loop includes the local AS.
• keep all—Keep all route information that was learned from BGP.
• keep none—Discard routes that were received from a peer and that were rejected by
import policy or other sanity checking, such as AS path or next hop. When you configure
keep none for the BGP session and the inbound policy changes, Junos OS forces
readvertisement of the full set of routes advertised by the peer.
In an AS path healing situation, routes with looped paths theoretically could become
usable during a soft reconfiguration when the AS path loop limit is changed. However,
there is a significant memory usage difference between the default and keep all.
• A peer readvertises routes back to the peer from which it learned them.
• Another vendor's routing device advertises the routes back to the sending peer.
• The Junos OS peer’s default behavior of not readvertising routes back to the sending
peer is overridden by configuring advertise-peer-as.
• A provider edge (PE) routing device discards any VPN route that does not have any of
the expected route targets.
When keep all is configured, the behavior of discarding routes received in the above
scenarios is overridden.
Junos OS does not advertise the routes learned from one EBGP peer back to the same
external BGP (EBGP) peer. In addition, the software does not advertise those routes back
to any EBGP peers that are in the same AS as the originating peer, regardless of the
routing instance. You can modify this behavior by including the advertise-peer-as
statement in the configuration. To disable the default advertisement suppression, include
the advertise-peer-as statement:
advertise-peer-as;
If you include the advertise-peer-as statement in the configuration, BGP advertises the
route regardless of this check.
no-advertise-peer-as;
For a list of hierarchy levels at which you can include these statements, see the statement
summary section for these statements.
Requirements
Overview
You can configure a BGP peer to accept route filters from remote peers and perform
outbound route filtering using the received filters. By filtering out unwanted updates, the
sending peer saves resources needed to generate and transmit updates, and the receiving
peer saves resources needed to process updates. This feature can be useful, for example,
in a virtual private network (VPN) in which subsets of customer edge (CE) devices are
not capable of processing all the routes in the VPN. The CE devices can use prefix-based
outbound route filtering to communicate to the provider edge (PE) routing device to
transmit only a subset of routes, such as routes to the main data centers only.
The maximum number of prefix-based outbound route filters that a BGP peer can accept
is 5000. If a remote peer sends more than 5000 outbound route filters to a peer address,
the additional filters are discarded, and a system log message is generated.
You can configure interoperability for the routing device as a whole or for specific BGP
groups or peers only.
Topology
In the sample network, Device CE1 is a router from another vendor. The configuration
shown in this example is on Juniper Networks Router PE1.
Other Vendor
CE2 CE4
g041113
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
To configure Router PE1 to accept route filters from Device CE1 and perform outbound
route filtering using the received filters:
[edit routing-options]
user@PE1# set autonomous-system 65500
3. Configure Router PE1 to accept IPv4 route filters from Device CE1 and perform
outbound route filtering using the received filters.
4. (Optional) Enable interoperability with routing devices that use the vendor-specific
compatibility code of 130 for outbound route filters and the code type of 128.
The IANA standard code is 3, and the standard code type is 64.
Results From configuration mode, confirm your configuration by entering the show protocols and
show routing-options commands. If the output does not display the intended configuration,
repeat the instructions in this example to correct the configuration.
}
}
}
neighbor 192.168.165.56;
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Display information about the prefix-based outbound route filter received from Device CE1.
Action From operational mode, enter the show bgp neighbor orf detail command.
inet-unicast
Filter updates recv: 4 Immediate: 0
Filter: prefix-based receive
Updates recv: 4
Received filter entries:
seq 10 2.2.0.0/16 deny minlen 0 maxlen 0
seq 20 3.3.0.0/16 deny minlen 24 maxlen 0
seq 30 4.4.0.0/16 deny minlen 0 maxlen 28
seq 40 5.5.0.0/16 deny minlen 24 maxlen 28
Purpose Verify that the bgp-orf-cisco-mode setting is enabled for the peer by making sure that
the ORFCiscoMode option is displayed in the show bgp neighbor command output.
Action From operational mode, enter the show bgp neighbor command.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
The configuration to enable multihop EBGP sessions requires connectivity between the
two EBGP peers. This example uses static routes to provide connectivity between the
devices.
Unlike directly connected EBGP sessions in which physical address are typically used in
the neighbor statements, you must use loopback interface addresses for multihop EBGP
by specifying the loopback interface address of the indirectly connected peer. In this way,
EBGP multihop is similar to internal BGP (IBGP).
Finally, you must add the multihop statement. Optionally, you can set a maximum
time-to-live (TTL) value with the ttl statement. The TTL is carried in the IP header of
BGP packets. If you do not specify a TTL value, the system’s default maximum TTL value
is used. The default TTL value is 64 for multihop EBGP sessions. Another option is to
retain the BGP next-hop value for route advertisements by including the
no-nexthop-change statement.
Device C and Device E have an established EBGP session. Device D is not a BGP-enabled
device. All of the devices have connectivity via static routes.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Device C
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
To configure Device C:
1. Configure the interface to the directly connected device (to-D), and configure the
loopback interface.
3. Configure the multihop statement to enable Device C and Device E to become EBGP
peers.
Because the peers are two hops away from each other, the example uses the ttl 2
statement.
You must configure a route to both the loopback interface address and to the
address on the physical interface.
[edit routing-options]
user@C# set static route 10.10.10.14/32 next-hop 10.10.10.10
user@C# set static route 192.168.6.7/32 next-hop 10.10.10.10
5. Configure the local router ID and the autonomous system (AS) number.
[edit routing-options]
user@C# set router-id 192.168.40.4
user@C# set autonomous-system 17
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
term 1 {
from protocol static;
then accept;
}
}
If you are done configuring the device, enter commit from configuration mode.
Repeat these steps for all BFD sessions in the topology.
Configuring Device D
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
To configure Device D:
2. Configure the interfaces to the directly connected devices, and configure a loopback
interface.
3. Configure connectivity to the other devices using static routes to the loopback
interface addresses.
On Device D, you do not need static routes to the physical addresses because Device
D is directly connected to Device C and Device E.
[edit routing-options]
user@D# set static route 192.168.40.4/32 next-hop 10.10.10.9
user@D# set static route 192.168.6.7/32 next-hop 10.10.10.14
[edit routing-options]
user@D# set router-id 192.168.6.6
Results From configuration mode, confirm your configuration by entering the show interfaces and
show routing-options commands. If the output does not display the intended configuration,
repeat the instructions in this example to correct the configuration.
If you are done configuring the device, enter commit from configuration mode.
Repeat these steps for all BFD sessions in the topology.
Configuring Device E
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
To configure Device E:
2. Configure the interface to the directly connected device (to-D), and configure the
loopback interface.
4. Configure the multihop statement to enable Device C and Device E to become EBGP
peers.
Because the peers are two hops away from each other, the example uses the ttl 2
statement.
You must configure a route to both the loopback interface address and to the
address on the physical interface.
[edit routing-options]
user@E# set static route 10.10.10.8/30 next-hop 10.10.10.13
user@E# set static route 192.168.40.4/32 next-hop 10.10.10.13
6. Configure the local router ID and the autonomous system (AS) number.
[edit routing-options]
user@E# set router-id 192.168.6.7
user@E# set autonomous-system 18
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
address 10.10.10.14/30;
}
}
}
lo0 {
unit 5 {
family inet {
address 192.168.6.7/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Verifying Connectivity
Purpose Make sure that Device C can ping Device E, specifying the loopback interface address as
the source of the ping request.
The loopback interface address is the source address that BGP will use.
Action From operational mode, enter the ping 10.10.10.14 source 192.168.40.4 command from
Device C, and enter the ping 10.10.10.9 source 192.168.6.7 command from Device E.
Action From operational mode, enter the show bgp summary command.
Meaning The output shows that both devices have one peer each. No peers are down.
Purpose Check to make sure that routes are being advertised by BGP.
Action From operational mode, enter the show route advertising-protocol bgp neighbor command.
Meaning The send-static routing policy is exporting the static routes from the routing table into
BGP. BGP is advertising these routes between the peers because the BGP peer session
is established.
System routes 4 –
Redirects 30 –
Kernel 40 –
SNMP 50 –
Router discovery 55 –
In general, the narrower the scope of the statement, the higher precedence its preference
value is given, but the smaller the set of routes it affects. To modify the default preference
value for routes learned by routing protocols, you generally apply routing policy when
configuring the individual routing protocols. You also can modify some preferences with
other configuration statements, which are indicated in the table.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
Routing information can be learned from multiple sources, such as through static
configuration, BGP, or an interior gateway protocol (IGP). When Junos OS determines a
route’s preference to become the active route, it selects the route with the lowest
preference as the active route and installs this route into the forwarding table. By default,
the routing software assigns a preference of 170 to routes that originated from BGP. Of
all the routing protocols, BGP has the highest default preference value, which means
that routes learned by BGP are the least likely to become the active route.
Some vendors have a preference (distance) of 20 for external BGP (EBGP) and a distance
of 200 for internal BGP (IGBP). Junos OS uses the same value (170) for both EBGP and
IBGP. However, this difference between vendors has no operational impact because
Junos OS always prefers EBGP routes over IBGP routes.
Another area in which vendors differ is in regard to IGP distance compared to BGP
distance. For example, some vendors assign a distance of 110 to OSPF routes. This is
higher than the EBGP distance of 20 , and results in the selection of an EBGP route over
an equivalent OSPF route. In the same scenario, Junos OS chooses the OSPF route,
because of the default preference 10 for an internal OSPF route and 150 for an external
OSPF route, which are both lower than the 170 preference assigned to all BGP routes.
In a multivendor environment, you might want to change the preference value for BGP
routes so that Junos OS chooses an EBGP route instead of an OSPF route. To accomplish
this goal, one option is to include the preference statement in the EBGP configuration.
To modify the default BGP preference value, include the preferece statement, specifying
32
a value from 0 through 4,294,967,295 (2 – 1).
routing table to export to BGP the best route learned by BGP even if Junos
OS did not select it to be an active route. By default, BGP stores the route
information it receives from update messages in the Junos OS routing table,
and the routing table exports only active routes into BGP, which BGP then
advertises to its peers. The advertise-inactive statement causes Junos OS to
advertise the best BGP route that is inactive because of IGP preference. When
you use the advertise-inactive statement, the Junos OS device uses the OSPF
route for forwarding, and the other vendor’s device uses the EBGP route for
forwarding. However, from the perspective of an EBGP peer in a neighboring
AS, both vendors’ devices appear to behave the same way.
Topology
In the sample network, Device R1 and Device R2 have EBGP routes to each other and also
OSPF routes to each other.
• Accept the default preference values of 170 for BGP and 10 for OSPF.
AS 65500
R1
R2
lo0:
10.255.14.177
g041157
AS 65000
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R1# set fe-1/2/0 unit 4 family inet address 1.12.0.1/30
user@R1# set lo0 unit 2 family inet address 10.255.71.24/32
[edit routing-options]
user@R1# set autonomous-system 65500
4. Configure OSPF.
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
interface 10.255.71.24;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Repeat these steps on Device R2.
Verification
Purpose Make sure that the routing tables on Device R1 and Device R2 reflect the fact that Device
R1 is using the configured EBGP preference of 8, and Device R2 is using the default EBGP
preference of 170.
Meaning The output shows that on Device R1, the active path to Device R2’s loopback interface
(10.255.14.177/32) is a BGP route. The output also shows that on Device R2, the active
path to Device R1’s loopback interface (10.255.71.24/32) is an OSPF route.
2. Choose the path with the lowest preference value (routing protocol process
preference).
Routes that are not eligible to be used for forwarding (for example, because they were
rejected by routing policy or because a next hop is inaccessible) have a preference of
–1 and are never chosen.
For non-BGP paths, choose the path with the lowest preference2 value.
4. If the accumulated interior gateway protocol (AIGP) attribute is enabled, prefer the
path with the lower AIGP attribute.
5. Prefer the path with the shortest autonomous system (AS) path value (skipped if the
as-path-ignore statement is configured).
Routes learned from an IGP have a lower origin code than those learned from an
exterior gateway protocol (EGP), and both have lower origin codes than incomplete
routes (routes whose origin is unknown).
7. Prefer the path with the lowest multiple exit discriminator (MED) metric.
• If nondeterministic routing table path selection behavior is not configured (that is,
if the path-selection cisco-nondeterministic statement is not included in the BGP
configuration), for paths with the same neighboring AS numbers at the front of the
AS path, prefer the path with the lowest MED metric. To always compare MEDs
whether or not the peer ASs of the compared routes are the same, include the
path-selection always-compare-med statement.
• If nondeterministic routing table path selection behavior is configured (that is, the
path-selection cisco-nondeterministic statement is included in the BGP
configuration), prefer the path with the lowest MED metric.
Confederations are not considered when determining neighboring ASs. A missing MED
metric is treated as if a MED were present but zero.
By default, only the MEDs of routes that have the same peer autonomous systems
(ASs) are compared. You can configure routing table path selection options to obtain
different behaviors.
8. Prefer strictly internal paths, which include IGP routes and locally generated routes
(static, direct, local, and so forth).
9. Prefer strictly external BGP (EBGP) paths over external paths learned through internal
BGP (IBGP) sessions.
10. Prefer the path whose next hop is resolved through the IGP route with the lowest
metric.
NOTE: A path is considered a BGP equal-cost path (and will be used for
forwarding) if a tie-break is performed after the previous step. All paths
with the same neighboring AS, learned by a multipath-enabled BGP
neighbor, are considered.
BGP multipath does not apply to paths that share the same MED-plus-IGP
cost yet differ in IGP cost. Multipath path selection is based on the IGP
cost metric, even if two paths have the same MED-plus-IGP cost.
11. If both paths are external, prefer the currently active path to minimize route-flapping.
This rule is not used if any one of the following conditions is true:
12. Prefer a primary route over a secondary route. A primary route is one that belongs to
the routing table. A secondary route is one that is added to the routing table through
an export policy.
13. Prefer the path from the peer with the lowest router ID. For any path with an originator
ID attribute, substitute the originator ID for the router ID during router ID comparison.
14. Prefer the path with the shortest cluster list length. The length is 0 for no list.
15. Prefer the path from the peer with the lowest peer IP address.
The shortest AS path step of the algorithm, by default, evaluates the length of the AS
path and determines the active path. You can configure an option that enables Junos
OS to skip this step of the algorithm by including the as-path-ignore option.
To configure routing table path selection behavior, include the path-selection statement:
path-selection {
(always-compare-med | cisco-non-deterministic | external-router-id);
as-path-ignore;
med-plus-igp {
igp-multiplier number;
med-multiplier number;
}
}
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
Routing table path selection can be configured in one of the following ways:
• Emulate the Cisco IOS default behavior (cisco-non-deterministic). This mode evaluates
routes in the order that they are received and does not group them according to their
neighboring AS. With cisco-non-deterministic mode, the active path is always first. All
inactive, but eligible, paths follow the active path and are maintained in the order in
which they were received, with the most recent path first. Ineligible paths remain at
the end of the list.
As an example, suppose you have three path advertisements for the 192.168.1.0 /24
route:
• Path 2—learned through IBGP; AS Path of 65020; MED of 150; IGP cost of 5
• Path 3—learned through IBGP; AS Path of 65010; MED of 100; IGP cost of 10
These advertisements are received in quick succession, within a second, in the order
listed. Path 3 is received most recently, so the routing device compares it against path
2, the next most recent advertisement. The cost to the IBGP peer is better for path 2,
so the routing device eliminates path 3 from contention. When comparing paths 1 and
2, the routing device prefers path 1 because it is received from an EBGP peer. This allows
the routing device to install path 1 as the active path for the route.
• Always comparing MEDs whether or not the peer ASs of the compared routes are the
same (always-compare-med).
• Override the rule that If both paths are external, the currently active path is preferred
(external-router-id). Continue with the next step (Step 12) in the path-selection process.
• Adding the IGP cost to the next-hop destination to the MED value before comparing
MED values for path selection (med-plus-igp).
BGP multipath does not apply to paths that share the same MED-plus-IGP cost, yet
differ in IGP cost. Multipath path selection is based on the IGP cost metric, even if two
paths have the same MED-plus-IGP cost.
BGP advertises only the active path, unless you configure BGP to advertise multiple paths
to a destination.
Suppose a routing device has in its routing table four paths to a destination and is
configured to advertise up to three paths (add-path send path-count 3). The three paths
are chosen based on path selection criteria. That is, the three best paths are chosen in
path-selection order. The best path is the active path. This path is removed from
consideration and a new best path is chosen. This process is repeated until the specified
number of paths is reached.
Example: Ignoring the AS Path Attribute When Selecting the Best Path
If multiple BGP routes to the same destination exist, BGP selects the best path based
on the route attributes of the paths. One of the route attributes that affects the best-path
decision is the length of the AS paths of each route. Routes with shorter AS paths are
preferred over those with longer AS paths. Although not typically practical, some scenarios
might require that the AS path length be ignored in the route selection process. This
example shows how to configure a routing device to ignore the AS path attribute.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
On externally connected routing devices, the purpose of skipping the AS path comparison
might be to force an external BGP (EBGP) versus internal BGP (IBGP) decision to remove
traffic from your network as soon as possible. On internally connected routing devices,
you might want your IBGP-only routers to default to the local externally connected
gateway. The local IBGP-only (internal) routers skip the AS path comparison and move
down the decision tree to use the closest interior gateway protocol (IGP) gateway (lowest
IGP metric). Doing this might be an effective way to force these routers to use a LAN
connection instead of their WAN connection.
In this example, Device R2 is learning about the loopback interface address on Device
R4 (4.4.4.4/32) from Device R1 and Device R3. Device R1 is advertising 4.4.4.4/32 with
an AS-path of 1 5 4, and Device R3 is advertising 4.4.4.4/32 with an AS-path of 3 4. Device
R2 selects the path for 4.4.4.4/32 from Device R3 as the best path because the AS path
is shorter than the AS path from Device R1.
This example modifies the BGP configuration on Device R2 so that the AS-path length
is not used in the best-path selection.
Device R1 has a lower router ID (1.1.1.1) than Device R3 (1.1.1.1). If all other path selection
criteria are equal (or, as in this case, ignored), the route learned from Device R1 is used.
Because the AS-path attribute is being ignored, the best path is toward Device R1 because
of its lower router ID value.
AS 4
R4
AS 5
R5
R1 R2 R3
AS 1 AS 2 AS 3
g041166
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device R2
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R2# set fe-1/2/0 unit 2 family inet address 192.168.10.2/24
user@R2# set fe-1/2/1 unit 3 family inet address 192.168.20.2/24
user@R2# set lo0 unit 2 family inet address 2.2.2.2/32
2. Configure EBGP.
3. Configure the autonomous system (AS) path attribute to be ignored in the Junos
OS path selection algorithm.
[edit policy-options]
user@R2# set policy-statement send-direct term 1 from protocol direct
user@R2# set policy-statement send-direct term 1 then accept
user@R2# set policy-statement send-local term 1 from protocol local
user@R2# set policy-statement send-local term 1 then accept
user@R2# set policy-statement send-static term 1 from protocol static
user@R2# set policy-statement send-static term 1 then accept
6. Configure the autonomous system (AS) number and the router ID.
[edit routing-options]
user@R2# set router-id 2.2.2.2
user@R2# set autonomous-system 2
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
family inet {
address 2.2.2.2/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode. Repeat
the configuration on the other devices in the network, changing the interface names and
IP addresses, as needed.
Verification
Purpose Make sure that from Device R2, the active path to get to AS 4 is through AS 1 and AS 5,
not through AS 3.
From operational mode, enter the show route 4.4.4.4 protocol bgp command.
Meaning The asterisk (*) is next to the path learned from R1, meaning that this is the active path.
The AS path for the active path is 1 5 4, which is longer than the AS path (3 4) for the
nonactive path learned from Router R3.
• A remote AS for which you provide connectivity is multihomed, but only to the local
AS.
Most companies acquire their own AS number. Some companies also use private AS
numbers to connect to their public AS network. These companies might use a different
private AS number for each region in which their company does business. In any
implementation, announcing a private AS number to the Internet must be avoided. Service
providers can use the remove-private statement to prevent advertising private AS numbers
to the Internet.
In an enterprise scenario, suppose that you have multiple AS numbers in your company,
some of which are private AS numbers, and one with a public AS number. The one with
a public AS number has a direct connection to the service provider. In the AS that connects
directly to the service provider, you can use the remove-private statement to filter out
any private AS numbers in the advertisements that are sent to the service provider.
The AS numbers are stripped from the AS path starting at the left end of the AS path
(the end where AS paths have been most recently added). The routing device stops
searching for private ASs when it finds the first nonprivate AS or a peer’s private AS. If
the AS path contains the AS number of the external BGP (EBGP) neighbor, BGP does
not remove the private AS number.
The operation takes place after any confederation member ASs have already been
removed from the AS path, if applicable.
The software is preconfigured with knowledge of the set of AS numbers that is considered
private, a range that is defined in the Internet Assigned Numbers Authority (IANA) assigned
numbers document. The set of AS numbers reserved as private are in the range
from 64,512 through 65,534, inclusive.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
Service providers and enterprise networks use the remove-private statement to prevent
advertising private AS numbers to the Internet. The remove-private statement works in
the outbound direction. You configure the remove-private statement on a device that
has a public AS number and that is connected to one or more devices that have private
AS numbers. Generally, you would not configure this statement on a device that has a
private AS number.
R1 ISP R2
g041165
In this example, Device R1 is connected to its service provider using private AS number
65535. The example shows the remove-private statement configured on Device ISP to
prevent Device R1’s private AS number from being announced to Device R2. Device R2
sees only the AS number of the service provider.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Device ISP set interfaces fe-1/2/0 unit 2 family inet address 192.168.10.10/24
set interfaces fe-1/2/1 unit 3 family inet address 192.168.20.20/24
set interfaces lo0 unit 2 family inet address 10.10.0.1/32
set protocols bgp group ext type external
set protocols bgp group ext neighbor 192.168.10.1 peer-as 65535
set protocols bgp group ext neighbor 192.168.20.1 remove-private
set protocols bgp group ext neighbor 192.168.20.1 peer-as 200
set routing-options autonomous-system 100
Device ISP
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
2. Configure EBGP.
3. For the neighbor in autonomous system (AS) 200 (Device R2), remove private AS
numbers from the advertised AS paths.
[edit routing-options]
user@ISP# set autonomous-system 100
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, and show routing-options commands. If the output does not display the
intended configuration, repeat the instructions in this example to correct the configuration.
peer-as 200;
}
}
}
If you are done configuring the device, enter commit from configuration mode. Repeat
the configuration on Device R1 and Device R2, changing the interface names and IP
address, as needed, and adding the routing policy configuration.
Verification
Purpose Make sure that Device ISP has the remove-private setting enabled in its neighbor session
with Device R2.
Action From operational mode, enter the show bgp neighbor 192.168.20.1 command.
Meaning The RemovePrivateAS option shows that Device ISP has the expected setting.
Purpose Make sure that the devices have the expected routes and AS paths.
Action From operational mode, enter the show route protocol bgp command.
Meaning Device ISP has the private AS number 65535 in its AS path to Device R1. However, Device
ISP does not advertise this private AS number to Device R2. This is shown in the routing
table of Device R2. Device R2’s path to Device R1 contains only the AS number for Device
ISP.
Purpose Verify that without the remove-private statement, the private AS number appears in
Device R2’s routing table.
Action From configuration mode on Device ISP, enter the deactivate remove-private command
and then recheck the routing table on Device R2.
Meaning Private AS number 65535 appears in Device R2’s AS path to Device R1.
Example: Overriding the Default BGP Routing Policy on PTX Series Packet Transport
Routers
• Understanding the Default BGP Routing Policy on Packet Transport Routers on page 256
• Example: Overriding the Default BGP Routing Policy on PTX Series Packet Transport
Routers on page 258
The PTX Series routers are MPLS transit platforms that do IP forwarding, typically using
interior gateway protocol (IGP) routes. The PTX Series Packet Forwarding Engine (PFE)
can accommodate a relatively small number of variable-length prefixes.
NOTE: A PTX Series router can support full BGP routes in the control plane
so that it can be used as a route reflector (RR). It can do exact-length lookup
multicast forwarding and can build the multicast forwarding plane for use
by the unicast control plane (for example. to perform a reverse-path
forwarding lookup for multicast).
Given the PFE limitation, the default routing policy for PTX Series routers is for BGP routes
not to be installed in the forwarding table. You can override the default routing policy
and select certain BGP routes to install in the forwarding table.
The default behavior for load balancing and BGP routes on PTX Series routers is as
follows. It has the following desirable characteristics:
• Allows you to override the default behavior without needing to alter the default policy
directly
Also, you can use the show policy command to view the default policy.
Junos OS chains the junos-ptx-series-default policy and any user-configured export policy.
Because the junos-ptx-series-default policy does not use flow-control actions, any export
policy that you configure is executed (by way of the implicit next-policy action) for every
route. Thus you can override any actions set by the junos-ptx-series-default policy. If you
do not configure an export policy, the actions set by junos-ptx-series-default policy are
the only actions.
You can use the policy action install-to-fib to override the no-install-to-fib action.
Similarly, you can set the load-balance per-prefix action to override the load-balance
per-packet action.
Example: Overriding the Default BGP Routing Policy on PTX Series Packet Transport Routers
This example shows how to override the default routing policy on packet transport routers,
such as the PTX Series Packet Transport Routers.
Requirements
Overview
By default, the PTX Series routers do not install BGP routes in the forwarding table.
For PTX Series routers, the configuration of the from protocols bgp condition with the
then accept action does not have the usual result that it has on other Junos OS routing
devices. With the following routing policy on PTX Series routers, BGP routes do not get
installed in the forwarding table.
forwarding-table {
export accept-no-install;
}
No BGP routes are installed in the forwarding table. This is the expected behavior.
This example shows how to use the then install-to-fib action to effectively override the
default BGP routing policy.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
Results From configuration mode, confirm your configuration by entering the show policy-options
and show routing-options commands. If the output does not display the intended
configuration, repeat the instructions in this example to correct the configuration.
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Make sure that the configured policy overrides the default policy.
Action From operational mode, enter the show route forwarding-table command.
Meaning This output shows that the route to 66.0.0.1/32 is installed in the forwarding table.
After performing route sanity checks, a BGP router accepts the routes received from its
peers and installs them into the routing table. By default, all routers in IBGP and EBGP
sessions follow the standard BGP advertisement rules. While a router in an IBGP session
advertises only the routes learned from its direct peers, a router in an EBGP session
advertises all routes learned from its direct and indirect peers (peers of peers). Hence,
in a typical network configured with EBGP, a router adds all routes received from an EBGP
peer into its routing table and advertises nearly all routes to all EBGP peers.
A service provider exchanging BGP routes with both customers and peers on the Internet
is at risk of malicious and unintended threats that can compromise the proper routing of
traffic, as well as the operation of the routers.
• BGP route manipulation—If a malicious administrator alters the contents of the BGP
routing table, it could prevent traffic from reaching its intended destination.
• BGP route hijacking—A rogue administrator of a BGP peer could maliciously announce
a network’s prefixes in an attempt to reroute the traffic intended for the victim network
to the administrator’s network to either gain access to the contents of traffic or to block
the victim’s online services.
Conditional installation of prefixes can be used to address all the problems previously
mentioned. If a customer requires access to remote networks, it is possible to install a
specific route in the routing table of the router that is connected with the remote network.
This does not happen in a typical EBGP network and hence, conditional installation of
prefixes becomes essential.
ASs are not only bound by physical relationships but by business or other organizational
relationships. An AS can provide services to another organization, or act as a transit AS
between two other ASs. These transit ASs are bound by contractual agreements between
the parties that include parameters on how to connect to each other and most
importantly, the type and quantity of traffic they carry for each other. Therefore, for both
legal and financial reasons, service providers must implement policies that control how
BGP routes are exchanged with neighbors, which routes are accepted from those
neighbors, and how those routes affect the traffic between the ASs.
There are many different options available to filter routes received from a BGP peer to
both enforce inter-AS policies and mitigate the risks of receiving potentially harmful
routes. Conventional route filtering examines the attributes of a route and accepts or
rejects the route based on such attributes. A policy or filter can examine the contents of
the AS-Path, the next-hop value, a community value, a list of prefixes, the address family
of the route, and so on.
For example:
[edit]
policy-options {
condition condition-name {
if-route-exists address table table-name;
}
}
Figure 26 on page 263 illustrates where BGP import and export policies are applied. An
import policy is applied to inbound routes that are visible in the output of the show route
receive-protocol bgp neighbor-address command. An export policy is applied to outbound
routes that are visible in the output of the show route advertising-protocol bgp
neighbor-address command.
for the existence of the route defined under the condition statement (also configured
under the from statement).
If the route does not match the entire set of required conditions defined in the policy, or
if the route defined under the condition statement does not exist in the routing table, the
route is not exported to its BGP peers. Thus, a conditional export policy matches the
routes for the desired route or prefix you want installed in the peers’ routing table.
To configure the conditional installation of prefixes with the help of an export policy:
[edit]
policy-options {
condition condition-name {
if-route-exists address table table-name;
}
}
2. Create an export policy with the newly created condition using the condition statement.
[edit]
policy-options {
policy-statement policy-name {
term 1 {
from {
protocols bgp;
condition condition-name;
}
then {
accept;
}
}
}
}
3. Apply the export policy to the device that requires only selected prefixes to be exported
from the routing table.
[edit]
protocols bgp {
group group-name {
export policy-name;
}
}
Requirements
Overview
In this example, three routers in three different autonomous systems (ASs) are connected
and configured with the BGP protocol. Router Internet, which is the upstream router, has
five addresses configured on its lo0.0 loopback interface (11.1.1.1/32, 12.1.1.1/32, 13.1.1.1,
14.1.1.1/32, and 15.1.1.1/32), and an extra loopback address (192.168.9.1/32) to be configured
as the router ID. These six addresses are exported into BGP to emulate the contents of
a BGP routing table of a router connected to the Internet, and advertised to Router North.
Router North exports a default route into BGP, and advertises the default route and the
five BGP routes to Router South, which is the downstream router. Router South receives
the default route and only one other route (11.1.1.1/32), and installs this route and the
default route in its routing table.
• On Device North, send 0/0 to Device South only if a particular route is also sent (in the
example 11.1.1.1/32).
• On Device South, accept the default route and the 11.1.1.1/32 route. Drop all other routes.
Consider that Device South might be receiving the entire Internet table, while the
operator only wants Device South to have the default and one other specific prefix.
condition prefix_11 {
if-route-exists {
11.1.1.1/32;
table inet.0;
}
}
The logic of the conditional export policy can be summarized as follows: If 0/0 is present,
and if 11.1.1.1/32 is present, then send the 0/0 prefix. This implies that if 11.1.1.1/32 is not
present, then do not send 0/0.
In this example, four routes are dropped as a result of the import policy on Device South.
This is because the export policy on Device North leaks all of the routes received from
Device Internet, and the import policy on Device South excludes some of these routes.
It is important to understand that in Junos OS, although an import policy (inbound route
filter) might reject a route, not use it for traffic forwarding, and not include it in an
advertisement to other peers, the router retains these routes as hidden routes. These
hidden routes are not available for policy or routing purposes. However, they do occupy
memory space on the router. A service provider filtering routes to control the amount of
information being kept in memory and processed by a router might want the router to
entirely drop the routes being rejected by the import policy.
Hidden routes can be viewed by using the show route receive-protocol bgp neighbor-address
hidden command. The hidden routes can then be retained or dropped from the routing
table by configuring the keep all | none statement at the [edit protocols bgp] or [edit
protocols bgp group group-name] hierarchy level.
• By default, all routes learned from BGP are retained, except those where the AS path
is looped. (The AS path includes the local AS.)
• By configuring the keep all statement, all routes learned from BGP are retained, even
those with the local AS in the AS path.
• By configuring the keep none statement, BGP discards routes that were received from
a peer and that were rejected by import policy or other sanity checking. When this
statement is configured and the inbound policy changes, Junos OS re-advertises all
the routes advertised by the peer.
Topology
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Router Internet set interfaces lo0 unit 0 family inet address 11.1.1.1/32
set interfaces lo0 unit 0 family inet address 12.1.1.1/32
set interfaces lo0 unit 0 family inet address 13.1.1.1/32
set interfaces lo0 unit 0 family inet address 14.1.1.1/32
set interfaces lo0 unit 0 family inet address 15.1.1.1/32
set interfaces lo0 unit 0 family inet address 192.168.9.1/32
set interfaces fe-0/1/3 unit 0 family inet address 10.0.89.14/30
set protocols bgp group toNorth local-address 10.0.89.14
set protocols bgp group toNorth peer-as 200
set protocols bgp group toNorth neighbor 10.0.89.13
set protocols bgp group toNorth export into-bgp
set policy-options policy-statement into-bgp term 1 from interface lo0.0
set policy-options policy-statement into-bgp term 1 then accept
set routing-options router-id 192.168.9.1
set routing-options autonomous-system 300
Router North set interfaces fe-1/3/1 unit 0 family inet address 10.0.78.14/30
set interfaces fe-1/3/0 unit 0 family inet address 10.0.89.13/30
set interfaces lo0 unit 0 family inet address 192.168.8.1/32
set protocols bgp group toInternet local-address 10.0.89.13
set protocols bgp group toInternet peer-as 300
Router South set interfaces fe-0/1/2 unit 0 family inet address 10.0.78.13/30
set interfaces lo0 unit 0 family inet address 192.168.7.1/32
set protocols bgp group toNorth local-address 10.0.78.13
set protocols bgp group toNorth import import-selected-routes
set protocols bgp group toNorth peer-as 200
set protocols bgp group toNorth neighbor 10.0.78.14
set policy-options policy-statement import-selected-routes term 1 from neighbor 10.0.78.14
set policy-options policy-statement import-selected-routes term 1 from route-filter
11.0.0.0/8 orlonger
set policy-options policy-statement import-selected-routes term 1 from route-filter
0.0.0.0/0 exact
set policy-options policy-statement import-selected-routes term 1 then accept
set policy-options policy-statement import-selected-routes term 2 then reject
set routing-options router-id 192.168.7.1
set routing-options autonomous-system 100
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the Junos OS CLI User Guide.
1. Configure the router interfaces forming the links between the three routers.
Router Internet
[edit interfaces]
user@Internet# set fe-0/1/3 unit 0 family inet address 10.0.89.14/30
Router North
[edit interfaces]
user@North# set fe-1/3/1 unit 0 family inet address 10.0.78.14/30
Router South
[edit interfaces]
user@South# set fe-0/1/2 unit 0 family inet address 10.0.78.13/30
Router Internet
[edit interfaces lo0 unit 0 family inet]
user@Internet# set address 11.1.1.1/32
user@Internet# set address 12.1.1.1/32
user@Internet# set address 13.1.1.1/32
user@Internet# set address 14.1.1.1/32
user@Internet# set address 15.1.1.1/32
user@Internet# set address 192.168.9.1/32
Also, configure the loopback interface addresses on Routers North and South.
Router North
[edit interfaces lo0 unit 0 family inet]
user@North# set address 192.168.8.1/32
Router South
[edit interfaces lo0 unit 0 family inet]
user@South# set address 192.168.7.1/32
3. Configure the static default route on Router North to be advertised to Router South.
[edit routing-options]
user@North# set static route 0/0 reject
4. Define the condition for exporting prefixes from the routing table on Router North.
Router Internet
[edit policy-options policy-statement into-bgp ]
user@Internet# set term 1 from interface lo0.0
user@Internet# set term 1 then accept
Router North
[edit policy-options policy-statement conditional-export-bgp]
user@North# set term prefix_11 from protocol bgp
user@North# set term prefix_11 from route-filter 11.0.0.0/5 orlonger
user@North# set term prefix_11 then accept
7. Configure BGP on all three routers to enable the flow of prefixes between the
autonomous systems.
NOTE: Ensure that you apply the defined import and export policies to
the respective BGP groups for prefix advertisement to take place.
Router Internet
[edit protocols bgp group toNorth]
user@Internet# set local-address 10.0.89.14
user@Internet# set peer-as 200
user@Internet# set neighbor 10.0.89.13
user@Internet# set export into-bgp
Router North
[edit protocols bgp group toInternet]
user@North# set local-address 10.0.89.13
user@North# set peer-as 300
user@North# set neighbor 10.0.89.14
Router South
[edit protocols bgp group toNorth]
user@South# set local-address 10.0.78.13
user@South# set peer-as 200
user@South# set neighbor 10.0.78.14
user@South# set import import-selected-routes
8. Configure the router ID and autonomous system number for all three routers.
Router Internet
Router North
[edit routing options]
user@North# set router-id 192.168.8.1
user@North# set autonomous-system 200
Router South
[edit routing options]
user@South# set router-id 192.168.7.1
user@South# set autonomous-system 100
Results
From configuration mode, confirm your configuration by issuing the show interfaces, show
protocols bgp, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
term others {
then reject;
}
}
condition prefix_11 {
if-route-exists {
11.1.1.1/32;
table inet.0;
}
}
If you are done configuring the routers, enter commit from configuration mode.
Verification
Verifying BGP
Purpose Verify that BGP sessions have been established between the three routers.
Action From operational mode, run the show bgp neighbor neighbor-address command.
1. Check the BGP session on Router Internet to verify that Router North is a neighbor.
Accepted prefixes: 0
Suppressed due to damping: 0
Advertised prefixes: 6
Last traffic (seconds): Received 9 Sent 18 Checked 28
Input messages: Total 12 Updates 1 Refreshes 0 Octets 232
Output messages: Total 14 Updates 1 Refreshes 0 Octets 383
Output Queue[0]: 0
2. Check the BGP session on Router North to verify that Router Internet is a neighbor.
Check the following fields in these outputs to verify that BGP sessions have been
established:
• State—Ensure that the value is Established. If not, check the configuration again and
see show bgp neighbor for more details on the output fields.
Similarly, verify that Routers North and South form peer relationships with each other.
Purpose Verify that the routes sent from Router Internet are received by Router North.
Action 1. From operational mode on Router Internet, run the show route advertising-protocol
bgp neighbor-address command.
The output verifies that Router Internet advertises the routes 11.1.1.1/32, 12.1.1.1/32,
13.1.1.1/32, 14.1.1.1/32, 15.1.1.1/32, and 192.168.9.1/32 (the loopback address used as
router ID) to Router North.
2. From operational mode on Router North, run the show route receive-protocol bgp
neighbor-address command.
The output verifies that Router North has received all the routes advertised by Router
Internet.
Meaning Prefixes sent by Router Internet have been successfully installed into the routing table
on Router North.
Purpose Verify that the routes received from Router Internet and the static default route are
advertised by Router North to Router South.
Action 1. From operational mode on Router North, run the show route 0/0 exact command.
The output verifies the presence of the static default route (0.0.0.0/0) in the routing
table on Router North.
2. From operational mode on Router North, run the show route advertising-protocol bgp
neighbor-address command.
The output verifies that Router North is advertising the static route and the 11.1.1.1/32
route received from Router Internet, as well as many other routes, to Router South.
Purpose Verify that the BGP import policy successfully installs the required prefixes.
Action See if the import policy on Router South is operational by checking if only the static
default route from Router North and the 11.1.1.1/32 route from Router South are installed
in the routing table.
From operational mode, run the show route receive-protocol bgp neighbor-address
command.
The output verifies that the BGP import policy is operational on Router South, and only
the static default route of 0.0.0.0/0 from Router North and the 11.1.1.1/32 route from
Router Internet have leaked into the routing table on Router South.
Meaning The installation of prefixes is successful because of the configured BGP import policy.
Purpose Verify that when Device Internet stops sending the 11.1.1.1/32 route, Device North stops
sending the default 0/0 route.
Action 1. Cause Device Internet to stop sending the 11.1.1.1/32 route by deactivating the 11.1.1.1/32
address on the loopback interface.
2. From operational mode on Router North, run the show route advertising-protocol bgp
neighbor-address command.
The output verifies that Router North is not advertising the default route to Router
South. This is the expected behavior when the 11.1.1.1/32 route is not present.
Purpose Verify the presence of routes hidden by the import policy configured on Router South.
NOTE: This section demonstrates the effects of various changes you can
make to the configuration depending on your needs.
Action View routes hidden from the routing table of Router South by:
• Using the hidden option for the show route receive-protocol bgp neighbor-address
command.
1. From operational mode, run the show route receive-protocol bgp neighbor-address
hidden command to view hidden routes.
The output verifies the presence of routes hidden by the import policy (12.1.1.1/32,
13.1.1.1/32, 14.1.1.1/32, and 15.1.1.1/32) on Router South.
2. Deactivate the BGP import policy by configuring the deactivate import statement at
the [edit protocols bgp group group-name] hierarchy level.
3. Run the show route receive-protocol bgp neighbor-address operational mode command
to check the routes after deactivating the import policy.
The output verifies the presence of previously hidden routes (12.1.1.1/32, 13.1.1.1/32,
14.1.1.1/32, and 15.1.1.1/32).
4. Activate the BGP import policy and remove the hidden routes from the routing table
by configuring the activate import and keep none statements respectively at the [edit
protocols bgp group group-name] hierarchy level.
5. From operational mode, run the show route receive-protocol bgp neighbor-address
hidden command to check the routes after activating the import policy and configuring
the keep none statement.
The output verifies that the hidden routes are not maintained in the routing table
because of the configured keep none statement.
By default, BGP readvertises only active routes. To have the routing table export to BGP
the best route learned by BGP even if Junos OS did not select it to be an active route,
include the advertise-inactive statement:
advertise-inactive;
In Junos OS, BGP advertises BGP routes that are installed or active, which are routes
selected as the best based on the BGP path selection rules. The advertise-inactive
statement allows nonactive BGP routes to be advertised to other peers.
Junos OS also provides support for configuring a BGP export policy that matches the
state of an advertised route. You can match either active or inactive routes, as follows:
policy-options {
policy-statement name{
from state (active|inactive);
}
}
This qualifier only matches when used in the context of an export policy. When a route
is being advertised by a protocol that can advertise inactive routes (such as BGP), state
For example, the following configuration can be used as a BGP export policy to mark
routes advertised due to the advertise-inactive setting with a user-defined community.
That community can be later used by the receiving routers to filter out such routes from
the forwarding table. Such a mechanism can be used to address concerns that advertising
paths not used for forwarding by the sender might lead to forwarding loops.
Requirements
No special configuration beyond device initialization is required before configuring this
example.
Overview
In this example, Device R2 has two external BGP (EBGP) peers, Device R1 and Device R3.
Device R1 has a static route to 172.16.5/24. Likewise, Device R2 also has a static route to
172.16.5/24. Through BGP, Device R1 sends information about its static route to Device
R2. Device R2 now has information about 172.16.5/24 from two sources—its own static
route and the BGP-learned route received from Device R1. Static routes are preferred
over BGP-learned routes, so the BGP route is inactive on Device R2. Normally Device R2
would send the BGP-learned information to Device R3, but Device R2 does not do this
because the BGP route is inactive. Device R3, therefore, has no information about
172.16.5/24 unless you enable the advertise-inactive command on Device R2, which causes
Device R2 to send the BGP-learned to Device R3.
Topology
“CLI Quick Configuration” on page 281 shows the configuration for all of the devices in
Figure 28 on page 281.
The section “Step-by-Step Procedure” on page 282 describes the steps on Device R2.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R2# set fe-1/2/0 unit 0 family inet address 10.0.0.2/30
4. Add the advertise-inactive statement to the EBGP group peering session with Device
R3.
[edit routing-options]
user@R2# set autonomous-system 200
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
unit 0 {
family inet {
address 10.0.0.5/30;
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.2/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly.
Purpose On Device R2, make sure that the 172.16.5.0/24 prefix is in the routing table and has the
expected active path.
Meaning Device R2 receives the 172.16.5.0/24 route from both Device R1 and from its own statically
configured route. The static route is the active path, as designated by the asterisk (*).
The static route path has the lowest route preference (5) as compared to the BGP
preference (170). Therefore, the static route becomes active.
Purpose On Device R2, make sure that the 172.16.5.0/24 route is advertised toward Device R3.
Purpose Make sure that the 172.16.6.0/24 prefix is in Device R3’s routing table.
Purpose See what happens when the advertise-inactive statement is removed from the BGP
configuration on Device R2.
2. On Device R2, check to see if the 172.16.5.0/24 route is advertised toward Device R3.
3. On Device R3, ensure that the 172.16.5/24 route is absent from the routing table.
Meaning Device R1 advertises route 172.16.5/24 to Device R2, but Device R2 has a manually
configured static route for this prefix. Static routes are preferred over BGP routes, so
Device R2 installs the BGP route as an inactive route. Because the BGP route is not active,
Device R2 does not readvertise the BGP route to Device R3. This is the default behavior
in Junos OS. If you add the advertise-inactive statement to the BGP configuration on
Device R2, Device R2 readvertises nonactive routes.
Related • Example: Configuring BGP to Advertise the Best External Route to Internal Peers on
Documentation page 285
Example: Configuring BGP to Advertise the Best External Route to Internal Peers
The BGP protocol specification, as defined in RFC 1771, specifies that a BGP peer shall
advertise to its internal peers the higher preference external path, even if this path is not
the overall best (in other words, even if the best path is an internal path). In practice,
deployed BGP implementations do not follow this rule. The reasons for deviating from
the specification are as follows:
• Minimizing the amount of advertised information. BGP scales according to the number
of available paths.
There are, however, several scenarios in which the behavior, specified in RFC 1771, of
advertising the best external route might be beneficial. Limiting path information is not
always desirable as path diversity might help reduce restoration times. Advertising the
best external path can also address internal BGP (IBGP) route oscillation issues as
described in RFC 3345, Border Gateway Protocol (BGP) Persistent Route Oscillation
Condition.
The conditional option limits the behavior of the advertise-external setting, such that the
external route is advertised only if the route selection process reaches the point where
the multiple exit discriminator (MED) metric is evaluated. Thus, an external route is not
advertised if it has, for instance, an AS path that is worse (longer) than that of the active
path. The conditional option restricts external path advertisement to when the best
external path and the active path are equal until the MED step of the route selection
process. Note that the criteria used for selecting the best external path is the same
whether or not the conditional option is configured.
Junos OS also provides support for configuring a BGP export policy that matches the
state of an advertised route. You can match either active or inactive routes, as follows:
policy-options {
policy-statement name{
from state (active|inactive);
}
}
This qualifier only matches when used in the context of an export policy. When a route
is being advertised by a protocol that can advertise inactive routes (such as BGP), state
inactive matches routes advertised as a result of the advertise-inactive and
advertise-external statements.
For example, the following configuration can be used as a BGP export policy toward
internal peers to mark routes advertised due to the advertise-external setting with a
user-defined community. That community can be later used by the receiving routers to
filter out such routes from the forwarding table. Such a mechanism can be used to address
concerns that advertising paths not used for forwarding by the sender might lead to
forwarding loops.
Requirements
Junos OS 9.3 or later is required.
Overview
This example shows three routing devices. Device R2 has an external BGP (EBGP)
connection to Device R1. Device R2 has an IBGP connection to Device R3.
Device R1 advertises 172.16.6.0/24. Device R2 does not set the local preference in an
import policy for Device R1’s routes, and thus 172.16.6.0/24 has the default local preference
of 100.
Topology
“CLI Quick Configuration” on page 287 shows the configuration for all of the devices in
Figure 29 on page 287.
The section “Step-by-Step Procedure” on page 288 describes the steps on Device R2.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
6. Configure the autonomous system (AS) number and the router ID.
[edit routing-options ]
user@R2# set router-id 192.168.0.2
user@R2# set autonomous-system 200
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.2/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly.
Purpose On Device R2, make sure that the 172.16.6.0/24 prefix is in the routing table and has the
expected active path.
Meaning Device R2 receives the 172.16.6.0/24 route from both Device R1 and Device R3. The route
from Device R3 is the active path, as designated by the asterisk (*). The active path has
the highest local preference. Even if the local preferences of the two routes were equal,
the route from Device R3 would remain active because it has the shortest AS path.
Purpose On Device R2, make sure that the 172.16.6.0/24 route is advertised toward Device R3.
Purpose Make sure that the 172.16.6.0/24 prefix is in Device R3’s routing table.
Meaning Device R3 has the static route and the BGP route for 172.16.6.0/24.
Note that the BGP route is hidden on Device R3 if the route is not reachable or if the next
hop cannot be resolved. To fulfill this requirement, this example includes a static default
route on Device R3 (static route 0.0.0.0/0 next-hop 10.0.0.5).
Purpose See how the conditional option works in the context of the BGP path selection algorithm.
2. On Device R2, check to see if the 172.16.6.0/24 route is advertised toward Device R3.
As expected, the route is no longer advertised. You might need to wait a few seconds
to see this result.
4. On Device R2, ensure that the local preferences of the two paths are equal.
6. On Device R2, check to see if the 172.16.6.0/24 route is advertised toward Device R3.
As expected, the route is now advertised because the AS path length is ignored and
because the local preferences are equal.
Junos OS does not advertise the routes learned from one EBGP peer back to the same
external BGP (EBGP) peer. In addition, the software does not advertise those routes back
to any EBGP peers that are in the same autonomous system (AS) as the originating peer,
regardless of the routing instance. You can modify this behavior by including the
advertise-peer-as statement in the configuration.
If you include the advertise-peer-as statement in the configuration, BGP advertises the
route regardless of this check.
no-advertise-peer-as;
The route suppression default behavior is disabled if the as-override statement is included
in the configuration. If you include both the as-override and no-advertise-peer-as
statements in the configuration, the no-advertise-peer-as statement is ignored.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
This example shows three routing devices with external BGP (EBGP) connections. Device
R2 has an EBGP connection to Device R1 and another EBGP connection to Device R3.
Although separated by Device R2 which is in AS 64511, Device R1 and Device R3 are in the
same AS (AS 64512). Device R1 and Device R3 advertise into BGP direct routes to their
own loopback interface addresses.
Device R2 receives these loopback interface routes, and the advertise peer-as statement
allows Device R2 to advertise them. Specifically, Device R1 sends the 192.168.0.1 route
to Device R2, and because Device R2 has the advertise peer-as configured, Device R2 can
send the 192.168.0.1 route to Device R3. Likewise, Device R3 sends the 192.168.0.3 route
to Device R2, and advertise peer-as enables Device R2 to forward the route to Device R1.
To enable Device R1 and Device R3 to accept routes that contain their own AS number
in the AS path, the loops 2 statement is required on Device R1 and Device R3.
Topology
“CLI Quick Configuration” on page 187 shows the configuration for all of the devices in
Figure 18 on page 187.
The section “Step-by-Step Procedure” on page 188 describes the steps on Device R1 and
Device R2.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R1# set fe-1/2/0 unit 0 family inet address 10.0.0.1/30
2. Configure BGP.
3. Prevent routes from Device R3 from being hidden on Device R1 by including the
loops 2 statement.
The loops 2 statement means that the local device’s own AS number can appear
in the AS path up to one time without causing the route to be hidden. The route is
hidden if the local device’s AS number is detected in the path two or more times.
5. Apply the export policy to the BGP peering session with Device R2.
[edit routing-options ]
user@R1# set autonomous-system 300
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
2. Configure BGP.
3. Configure Device R2 to advertise routes learned from one EBGP peer to another
EBGP peer in the same AS.
In other words, advertise to Device R1 routes learned from Device R3 (and the
reverse), even though Device R1 and Device R3 are in the same AS.
[edit routing-options]
user@R2# set autonomous-system 200
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
neighbor 10.1.0.2 {
peer-as 300;
}
}
}
If you are done configuring the devices, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly.
Purpose Make sure that the routing tables on Device R1 and Device R3 contain the expected routes.
Action 1. On Device R2, deactivate the advertise-peer-as statement in the BGP configuration.
3. On Device R1, check to see what routes are advertised to Device R2.
4. On Device R2, check to see what routes are received from Device R1.
5. On Device R2, check to see what routes are advertised to Device R3.
* 10.0.0.0/30 Self I
* 10.1.0.0/30 Self I
* 192.168.0.2/32 Self I
7. On Device R2, recheck the routes that are advertised to Device R3.
8. On Device R3, check the routes that are received from Device R2.
10. On Device R3, recheck the routes that are received from Device R2.
Meaning First the advertise-peer-as statement and the loops statement are deactivated so that
the default behavior can be examined. Device R1 sends to Device R2 a route to Device
R1’s loopback interface address, 192.168.0.1/32. Device R2 does not advertise this route
to Device R3. After activating the advertise-peer-as statement, Device R2 does advertise
the 192.168.0.1/32 route to Device R3. Device R3 does not accept this route until after the
loops statement is activated.
Related • Example: Configuring a Layer 3 VPN with Route Reflection and AS Override on page 176
Documentation
This example shows how to create a policy that accepts BGP routes, but removes BGP
communities from the routes.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
This example shows two routing devices with an external BGP (EBGP) connection
between them. Device R2 uses the BGP session to send two static routes to Device R1.
On Device R1, an import policy specifies that all BGP communities must be removed from
the routes.
By default, when communities are configured on EBGP peers, they are sent and accepted.
To suppress the acceptance of communities received from a neighbor, you can remove
all communities or a specified set of communities. When the result of a policy is an empty
set of communities, the community attribute is not included. To remove all communities,
first define a wildcard set of communities (here, the community is named wild):
[edit policy-options]
community wild members "* : *";
Then, in the routing policy statement, specify the community delete action:
[edit policy-options]
policy-statement policy-name {
term term-name {
then community delete wild;
}
}
To suppress a particular community from any autonomous system (AS), define the
community as community wild members "*:community-value".
Topology
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R1# set fe-1/1/0 unit 0 description to-R2
user@R1# set fe-1/1/0 unit 0 family inet address 10.0.0.1/30
2. Configure BGP.
Apply the import policy to the BGP peering session with Device R2.
4. Configure the autonomous system (AS) number and the router ID.
[edit routing-options ]
user@R1# set router-id 192.168.0.1
user@R1# set autonomous-system 1
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R2# set fe-1/1/0 unit 0 description to-R1
user@R2# set fe-1/1/0 unit 0 family inet address 10.0.0.2/30
[edit routing-options]
user@R2# set router-id 192.168.0.3
user@R2# set autonomous-system 2
3. Configure BGP.
6. Configure a routing policy that advertises static routes into BGP and adds the BGP
community to the routes.
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
description to-R2;
family inet {
address 10.0.0.1/30;
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.1/32;
}
}
}
}
}
}
If you are done configuring the devices, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly.
Purpose Make sure that the routing table on Device R1 does not contain BGP communities.
Action 1. On Device R1, run the show route protocols bgp extensive command.
2. On Device R1, deactivate the community remove configuration in the import policy.
3. On Device R1, run the show route protocols bgp extensive command to view the
advertised communities.
Meaning The output shows that in Device R1’s routing table, the communities are suppressed in
the BGP routes sent from Device R2. When the community remove setting in Device R1’s
import policy is deactivated, the communities are no longer suppressed.
Related • Example: Redistributing BGP Routes with a Specific Community Tag into IS-IS on
Documentation page 207
This example shows how to create a policy that accepts BGP routes based on the number
of BGP communities.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
This example shows two routing devices with an external BGP (EBGP) connection
between them. Device R2 uses the BGP session to send two static routes to Device R1.
On Device R1, an import policy specifies that the BGP-received routes can contain up to
five communities to be considered a match. For example, if a route contains three
communities, it is considered a match and is accepted. If a route contains six or more
communities, it is considered a nonmatch and is rejected.
It is important to remember that the default policy for EBGP is to accept all routes. To
ensure that the nonmatching routes are rejected, you must include a then reject action
at the end of the policy definition.
Topology
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R1# set fe-1/1/0 unit 0 description to-R2
user@R1# set fe-1/1/0 unit 0 family inet address 10.0.0.1/30
2. Configure BGP.
Apply the import policy to the BGP peering session with Device R2.
4. Configure the autonomous system (AS) number and the router ID.
[edit routing-options ]
user@R1# set router-id 192.168.0.1
user@R1# set autonomous-system 1
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R2# set fe-1/1/0 unit 0 description to-R1
user@R2# set fe-1/1/0 unit 0 family inet address 10.0.0.2/30
[edit routing-options]
user@R2# set router-id 192.168.0.3
user@R2# set autonomous-system 2
3. Configure BGP.
6. Configure a routing policy that advertises static routes into BGP and adds the BGP
community to the routes.
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
then accept;
}
term 2 {
then reject;
}
}
}
}
router-id 192.168.0.3;
autonomous-system 2;
If you are done configuring the devices, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly.
Purpose Make sure that the routing table on Device R1 contains the expected BGP routes.
Action 1. On Device R1, run the show route protocols bgp command.
4. On Device R1, run the show route protocols bgp extensive command to view the
advertised communities.
Task: BGP_2.10.0.0.2+179
Announcement bits (1): 0-KRT
AS path: 2 I
Communities: 2:1 2:2 2:3 2:4 2:5 2:6 2:7 2:8 2:9 2:10
Accepted
Localpref: 100
Router ID: 192.168.0.3
Meaning The output shows that in Device R1’s routing table, the BGP routes sent from Device R2
are hidden. When the community-count setting in Device R1’s import policy is modified,
the BGP routes are no longer hidden.
Related • Example: Redistributing BGP Routes with a Specific Community Tag into IS-IS on
Documentation page 207
Example: Using Routing Policy to Set a Preference Value for BGP Routes
This example shows how to use routing policy to set the preference for routes learned
from BGP. Routing information can be learned from multiple sources. To break ties among
equally specific routes learned from multiple sources, each source has a preference value.
Routes that are learned through explicit administrative action, such as static routes, are
preferred over routes learned from a routing protocol, such as BGP or OSPF. This concept
is called administrative distance by some vendors.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
Routing information can be learned from multiple sources, such as through static
configuration, BGP, or an interior gateway protocol (IGP). When Junos OS determines a
route’s preference to become the active route, it selects the route with the lowest
preference as the active route and installs this route into the forwarding table. By default,
the routing software assigns a preference of 170 to routes that originated from BGP. Of
all the routing protocols, BGP has the highest default preference value, which means
that routes learned by BGP are the least likely to become the active route.
Some vendors have a preference (distance) of 20 for external BGP (EBGP) and a distance
of 200 for internal BGP (IGBP). Junos OS uses the same value (170) for both EBGP and
IBGP. However, this difference between vendors has no operational impact because
Junos OS always prefers EBGP routes over IBGP routes.
Another area in which vendors differ is in regard to IGP distance compared to BGP
distance. For example, some vendors assign a distance of 110 to OSPF routes. This is
higher than the EBGP distance of 20 , and results in the selection of an EBGP route over
an equivalent OSPF route. In the same scenario, Junos OS chooses the OSPF route,
because of the default preference 10 for an internal OSPF route and 150 for an external
OSPF route, which are both lower than the 170 preference assigned to all BGP routes.
This example shows a routing policy that matches routes from specific next hops and
sets a preference. If a route does not match the first term, it is evaluated by the second
term.
Topology
In the sample network, Device R1 and Device R3 have EBGP sessions with Device R2.
• For routes received through BGP from next-hop 10.0.0.1 (Device R1), set the route
preference to 10.
• For routes received through BGP from next-hop 10.1.0.2 (Device R3), set the route
preference to 15.
“CLI Quick Configuration” on page 316 shows the configuration for all of the devices in
Figure 33 on page 316.
The section “Step-by-Step Procedure” on page 317 describes the steps on Device R2.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R2# set fe-1/2/0 unit 0 family inet address 10.0.0.2/30
[edit routing-options]
user@R2# set autonomous-system 200
4. Configure the routing policy that changes the preference of received routes.
This affects Device R2’s routing table and has no impact on Device R1 and Device
R3.
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
then {
preference 10;
}
}
term term2 {
from {
protocol bgp;
next-hop 10.1.0.2;
}
then {
preference 15;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly.
Purpose Make sure that the routing tables on Device R1 and Device R2 reflect the fact that Device
R1 is using the configured EBGP preference of 8, and Device R2 is using the default EBGP
preference of 170.
Action From operational mode, enter the show route protocols bgp command.
Meaning The output shows that on Device R2, the preference values have been changed to 15 for
routes learned from Device R3, and the preference values have been changed to 10 for
routes learned from Device R1.
Example: Load Balancing BGP Traffic with Unequal Bandwidth Allocated to the Paths
This example shows how to configure BGP to select multiple unequal-cost paths as
active paths.
BGP communities can help you control routing policy. An example of a good use for BGP
communities is unequal load balancing. When an autonomous system border router
(ASBR) receives routes from directly connected external BGP (EBGP) neighbors, the
ASBR then advertises those routes to internal neighbors, using IBGP advertisements. In
the IBGP adverisements, you can attach the link-bandwidth community to communicate
the bandwidth of the advertised external link. This is useful when multiple external links
are available, and you want to do unequal load balancing over the links. You configure
the link-bandwidth extended community on all ingress links of the AS. The bandwidth
information in the link-bandwidth extended community is based on the configured
bandwidth of the EBGP link. It is not based on the amount of traffic on the link. Junos OS
supports BGP link-bandwidth and multipath load balancing, as described in Internet
draft draft-ietf-idr-link-bandwidth-06, BGP Link Bandwidth Extended Community.
Requirements
Before you begin:
• Configure BGP.
• Configure a routing policy that exports routes (such as direct routes or IGP routes)
from the routing table into BGP.
Overview
In this example, Device R1 is in AS 65000 and is connected to both Device R2 and
Device R3, which are in AS 65001.
By default, when BGP multipath is used, traffic is distributed equally among the several
paths calculated. The bandwidth extended community allows an additional attribute to
be added to BGP paths, thus allowing the traffic to be distributed unequally. The primary
application is a scenario where multiple external paths exist for a given network with
asymmetric bandwidth capabilities. In such a scenario, you can tag routes received with
the bandwidth extended community. When BGP multipath (internal or external) operates
among routes that contain the bandwidth attribute, the forwarding engine can unequally
distribute traffic according to the bandwidth corresponding to each path.
When BGP has several candidate paths available for multipath purposes, BGP does not
perform unequal cost load balancing according to the bandwidth community unless all
candidate paths have this attribute.
[edit policy-options]
user@host# set community members bandwidth:[1-65535]:[0-4294967295]
The first 16-bit number represents the local autonomous system. The second 32-bit
number represents the link bandwidth in bytes per second.
For example:
[edit policy-options]
user@host# show
community bw-t1 members bandwidth:10458:193000;
community bw-t3 members bandwidth:10458:5592000;
community bw-oc3 members bandwidth:10458:19440000;
Where 10458 is the local AS number. The values correspond to the bandwidth of the T1,
T3, and OC-3 paths in bytes per second. The value specified as the bandwidth value does
not need to correspond to the actual bandwidth of a specific interface. The balance
factors used are calculated as a function of the total bandwidth specified. To tag a route
with this extended community, define a policy statement, as follows:
[edit policy-options]
user@host# show
policy-statement link-bw-t1 {
then {
community set bw-t1;
}
accept;
}
Apply this as an import policy on the BGP peering sessions facing the asymmetrical
bandwidth links. Although in theory the community attribute can be added or removed
at any point in the network, in the scenario described above, applying the community as
an import policy in the EBGP peering session facing the external link allows for that
attribute to influence the local multipath decision, and is potentially easier to manage.
Topology
“CLI Quick Configuration” on page 322 shows the configuration for all of the devices in
Figure 34 on page 322. The section“Step-by-Step Procedure” on page 324 describes the
steps on Device R1.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit routing-options]
user@R1# set forwarding-table export loadbal
[editpolicy-options]
user@R1# set community bw-high members bandwidth:65000:60000000
user@R1# set community bw-low members bandwidth:65000:40000000
[editpolicy-options bw-dis]
user@R1# set term a from protocol bgp
user@R1# set term a from neighbor 10.0.1.1
user@R1# set term a then community add bw-high
user@R1# set term a then accept
[edit routing-options]
user@R1# set autonomous-system 65000
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
neighbor 10.0.0.2;
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly:
Verifying Routes
Purpose Verify that both routes are selected and that the next hops on the routes show a
60%/40% balance.
Action From operational mode, run the show route protocol bgp detail command.
Address: 0x92604d8
Next-hop reference count: 4
Source: 10.0.0.2
Next hop: 10.0.0.2 via ge-1/2/0.0, selected
State: <NotBest Ext>
Inactive reason: Not Best in its group - Active preferred
Local AS: 65000 Peer AS: 65001
Age: 3:36:36
Task: BGP_65001.10.0.0.2+55344
AS path: 65001 I
Communities: bandwidth:65000:40000000
Accepted MultipathContrib
Localpref: 100
Router ID: 192.168.0.3
Meaning The active path, denoted with an asterisk (*), has two next hops: 10.0.1.1 and 10.0.0.2 to
the 172.16/16 destination.
Likewise, the active path, denoted with an asterisk (*), has two next hops: 10.0.1.1 and
10.0.0.2 to the 10.0.2.0 destination.
In both cases, the 10.0.1.1 next hop is copied from the inactive path to the active path.
The balance of 40 percent and 60 percent is shown in the show route output. This
indicates that traffic is being distributed between two next hops and that 60 percent of
the traffic is following the first path, while 40 percent is following the second path.
The BFD failure detection timers are adaptive and can be adjusted to be faster or slower.
The lower the BFD failure detection timer value, the faster the failure detection and vice
versa. For example, the timers can adapt to a higher value if the adjacency fails (that is,
the timer detects failures more slowly). Or a neighbor can negotiate a higher value for a
timer than the configured value. The timers adapt to a higher value when a BFD session
flap occurs more than three times in a span of 15 seconds. A back-off algorithm increases
the receive (Rx) interval by two if the local BFD instance is the reason for the session
flap. The transmission (Tx) interval is increased by two if the remote BFD instance is the
reason for the session flap. You can use the clear bfd adaptation command to return BFD
interval timers to their configured values. The clear bfd adaptation command is hitless,
meaning that the command does not affect traffic flow on the routing device.
In Junos OS Release 8.3 and later, BFD is supported on internal BGP (IBGP) and multihop
external BGP (EBGP) sessions as well as on single-hop EBGP sessions. In Junos OS
Release 9.1 through Junos OS Release 11.1, BFD supports IPv6 interfaces in static routes
only. In Junos OS Release 11.2 and later, BFD supports IPv6 interfaces with BGP.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
Optionally, you can specify the minimum transmit and receive intervals separately using
the transmit-interval minimum-interval and minimum-receive-interval statements. For
information about these and other optional BFD configuration statements, see
bfd-liveness-detection.
BFD is supported on the default routing instance (the main router), routing instances,
and logical systems. This example shows BFD on logical systems.
Figure 35 on page 331 shows a typical network with internal peer sessions.
192.168.6.5
AS 17 A
192.163.6.4
C B
192.168.40.4
g040732
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device A
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
To configure Device A:
3. Configure BGP.
The neighbor statements are included for both Device B and Device C, even though
Device A is not directly connected to Device C.
4. Configure BFD.
You must configure the same minimum interval on the connecting peer.
6. Configure OSPF.
Other useful options for this scenario might be to accept routes learned through
OSPF or local routes.
[edit routing-options]
user@host:A# set router-id 192.168.6.5
user@host:A# set autonomous-system 17
9. If you are done configuring the device, enter commit from configuration mode.
Repeat these steps to configure Device B and Device C.
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
file bgp-bfd;
flag bfd detail;
}
local-address 192.168.6.5;
export send-direct;
bfd-liveness-detection {
minimum-interval 1000;
}
neighbor 192.163.6.4;
neighbor 192.168.40.4;
}
}
ospf {
area 0.0.0.0 {
interface lo0.1 {
passive;
}
interface lt-1/2/0.1;
}
}
Verification
Action From operational mode, enter the show bgp neighbor command. You can use the | match
bfd filter to narrow the output.
Meaning The output shows that Logical System A has two neighbors with BFD enabled. When
BFD is not enabled, the output displays BFD: disabled, down, and the <BfdEnabled> option
is absent. If BFD is enabled and the session is down, the output displays BFD: enabled,
down. The output also shows that BFD-related events are being written to a log file
because trace operations are configured.
Purpose Verify that the BFD sessions are up, and view details about the BFD sessions.
Action From operational mode, enter the show bfd session extensive command.
Detect Transmit
Address State Interface Time Interval Multiplier
192.168.40.4 Up 3.000 1.000 3
Client BGP, TX interval 1.000, RX interval 1.000
Session up time 00:48:03
Local diagnostic None, remote diagnostic None
Remote state Up, version 1
Logical system 12, routing table index 25
Min async interval 1.000, min slow interval 1.000
Adaptive async TX interval 1.000, RX interval 1.000
Local min TX interval 1.000, minimum RX interval 1.000, multiplier 3
Remote min TX interval 1.000, min RX interval 1.000, multiplier 3
Local discriminator 14, remote discriminator 13
Echo mode disabled/inactive
Multi-hop route table 25, local-address 192.168.6.5
2 sessions, 2 clients
Cumulative transmit rate 2.0 pps, cumulative receive rate 2.0 pps
Meaning The TX interval 1.000, RX interval 1.000 output represents the setting configured with the
minimum-interval statement. All of the other output represents the default settings for
BFD. To modify the default settings, include the optional statements under the
bfd-liveness-detection statement.
Purpose View the contents of the BFD trace file to assist in troubleshooting, if needed.
Action From operational mode, enter the file show /var/log/A/bgp-bfd command.
Meaning Before the routes are established, the No route to host message appears in the output.
After the routes are established, the last two lines show that both BFD sessions come
up.
Viewing Detailed BFD Events After Deactivating and Reactivating a Loopback Interface
Purpose Check to see what happens after bringing down a router or switch and then bringing it
back up. To simulate bringing down a router or switch, deactivate the loopback interface
on Logical System B.
Action 1. From configuration mode, enter the deactivate logical-systems B interfaces lo0 unit 2
family inet command.
3. From configuration mode, enter the activate logical-systems B interfaces lo0 unit 2
family inet command.
• keyed-md5—Keyed Message Digest 5 hash algorithm for sessions with transmit and
receive intervals greater than 100 ms. To authenticate the BFD session, keyed MD5
uses one or more secret keys (generated by the algorithm) and a sequence number
that is updated periodically. With this method, packets are accepted at the receiving
end of the session if one of the keys matches and the sequence number is greater than
or equal to the last sequence number received. Although more secure than a simple
password, this method is vulnerable to replay attacks. Increasing the rate at which the
sequence number is updated can reduce this risk.
• keyed-sha-1—Keyed Secure Hash Algorithm I for sessions with transmit and receive
intervals greater than 100 ms. To authenticate the BFD session, keyed SHA uses one
or more secret keys (generated by the algorithm) and a sequence number that is
updated periodically. The key is not carried within the packets. With this method,
packets are accepted at the receiving end of the session if one of the keys matches
and the sequence number is greater than the last sequence number received.
The security authentication keychain defines the authentication attributes used for
authentication key updates. When the security authentication keychain is configured and
associated with a protocol through the keychain name, authentication key updates can
occur without interrupting routing and signaling protocols.
The authentication keychain contains one or more keychains. Each keychain contains
one or more keys. Each key holds the secret data and the time at which the key becomes
valid. The algorithm and keychain must be configured on both ends of the BFD session,
and they must match. Any mismatch in configuration prevents the BFD session from
being created.
BFD allows multiple clients per session, and each client can have its own keychain and
algorithm defined. To avoid confusion, we recommend specifying only one security
authentication keychain.
The following sections provide instructions for configuring and viewing BFD authentication
on BGP:
BFD authentication can be configured for the entire BGP protocol, or a specific BGP group,
neighbor, or routing instance.
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.
[edit]
user@host# set protocols bgp bfd-liveness-detection authentication algorithm
keyed-sha-1
user@host# set protocols bgp group bgp-gr1 bfd-liveness-detection authentication
algorithm keyed-sha-1
user@host# set protocols bgp group bgp-gr1 neighbor 10.10.10.7 bfd-liveness-detection
authentication algorithm keyed-sha-1
2. Specify the keychain to be used to associate BFD sessions on BGP with the unique
security authentication keychain attributes.
The keychain name you specify must match a keychain name configured at the [edit
security authentication key-chains] hierarchy level.
[edit]
user@host# set protocols bgp bfd-liveness-detection authentication keychain bfd-bgp
user@host# set protocols bgp group bgp-gr1 bfd-liveness-detection authentication
keychain bfd-bgp
user@host# set protocols bgp group bgp-gr1 neighbor 10.10.10.7 bfd-liveness-detection
authentication keychain bfd-bgp
• At least one key, a unique integer between 0 and 63. Creating multiple keys allows
multiple clients to use the BFD session.
• The time at which the authentication key becomes active, in the format
yyyy-mm-dd.hh:mm:ss.
[edit security]
[edit]
user@host# set protocols bgp bfd-liveness-detection authentication loose-check
user@host# set protocols bgp group bgp-gr1 bfd-liveness-detection authentication
loose-check
user@host# set protocols bgp group bgp-gr1 neighbor 10.10.10.7 bfd-liveness-detection
authentication loose-check
5. (Optional) View your configuration using the show bfd session detail or show bfd
session extensive command.
6. Repeat these steps to configure the other end of the BFD session.
NOTE: BFD authentication is only supported in the Canada and United States
version of the Junos OS image and is not available in the export version.
You can view the existing BFD authentication configuration using the show bfd session
detail and show bfd session extensive commands.
The following example shows BFD authentication configured for the bgp-gr1 BGP group.
It specifies the keyed SHA-1 authentication algorithm and a keychain name of bfd-bgp.
The authentication keychain is configured with two keys. Key 1 contains the secret data
“$9$ggaJDmPQ6/tJgF/AtREVsyPsnCtUHm” and a start time of June 1, 2009, at 9:46:02
AM PST. Key 2 contains the secret data “$9$a5jiKW9l.reP38ny.TszF2/9” and a start time
of June 1, 2009, at 3:29:20 PM PST.
If you commit these updates to your configuration, you see output similar to the following.
In the output for the show bfd session detail command, Authenticate is displayed to
indicate that BFD authentication is configured. For more information about the
configuration, use the show bfd session extensive command. The output for this command
provides the keychain name, the authentication algorithm and mode for each client in
the session, and the overall BFD authentication configuration status, keychain name,
and authentication algorithm and mode.
• Load balancing across multiple links between two routing devices belonging to different
autonomous systems (ASs)
• Load balancing across multiple links between two routing devices belonging to different
external confederation peers
BGP multipath does not apply to paths that share the same MED-plus-IGP cost, yet differ
in IGP cost. Multipath path selection is based on the IGP cost metric, even if two paths
have the same MED-plus-IGP cost.
Requirements
• Configure BGP.
• Configure a routing policy that exports routes (such as direct routes or IGP routes)
from the routing table into BGP.
Overview
policy-statement policy-name {
from {
match-conditions;
route-filter destination-prefix match-type <actions>;
prefix-list name;
}
then {
load-balance per-packet;
}
}
2. Apply the policy to routes exported from the routing table to the forwarding table. To
do this, include the forwarding-table and export statements:
forwarding-table {
export policy-name;
}
3. Specify all next hops of that route, if more than one exists, when allocating a label
corresponding to a route that is being advertised.
4. Configure the forwarding-options hash key for MPLS to include the IP payload.
Topology
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit routing-options]
user@R1# set forwarding-table export loadbal
[edit routing-options]
user@R1# set autonomous-system 65000
Results From configuration mode, confirm your configuration by entering the show protocols,
show policy-options, and show routing-options commands. If the output does not display
the intended configuration, repeat the instructions in this example to correct the
configuration.
[edit]
user@R1# show protocols
bgp {
group external {
type external;
peer-as 65001;
multipath;
neighbor 10.0.1.1;
neighbor 10.0.0.2;
}
}
[edit]
user@R1# show policy-options
policy-statement loadbal {
from {
route-filter 10.0.0.0/16 orlonger;
}
then {
load-balance per-packet;
}
}
[edit]
user@R1# show routing-options
autonomous-system 65000;
forwarding-table {
export loadbal;
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Verifying Routes
Purpose Verify that routes are learned from both routers in the neighboring AS.
Meaning The active path, denoted with an asterisk (*), has two next hops: 10.0.1.1 and 10.0.0.2 to
the 10.0.2.0 destination. The 10.0.1.1 next hop is copied from the inactive path to the
active path.
Verifying Forwarding
Purpose Verify that both next hops are installed in the forwarding table.
Action From operational mode, run the show route forwarding-table command.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
single-hop EBGP peer to accept a remote next hop, which restores multipath functionality
for routes that are resolved over these next-hop addresses. You can configure this
statement at the global, group, and neighbor hierarchy levels for BGP. The statement is
also supported on logical systems and the VPN routing and forwarding (VRF) routing
instance type. Both the remote next-hop and the EBGP peer must support BGP route
refresh as defined in RFC 2918, Route Refresh Capability in BGP-4. If the remote peer does
not support BGP route refresh, the session is reset.
When you enable a single-hop EBGP peer to accept a remote next hop, you must also
configure an import routing policy on the EBGP peer that specifies the remote next-hop
address.
This example includes an import routing policy, agg_route, that enables a single-hop
external BGP peer (Device R1) to accept the remote next-hop 1.1.10.10 for the route to
the 1.1.230.0/23 network. At the [edit protocols bgp] hierarchy level, the example includes
the import agg_route statement to apply the policy to the external BGP peer and includes
the accept-remote-nexthop statement to enable the single-hop EBGP peer to accept
the remote next hop.
AS 65500 AS 65000
R0 R1
lo0:10.255.14.177
R2
g041156
AS 65000
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Device R0
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure EBGP.
[edit routing-options]
user@R0# set static route 1.1.10.10/32 reject
user@R0# set static route 1.1.230.0/23 reject
6. Export the agg_route and test_route policies from the routing table into BGP.
[edit routing-options]
user@R0# set autonomous-system 65500
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
then accept;
}
}
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R1
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure OSPF.
4. Configure IBGP.
5. Configure EBGP.
7. Configure a routing policy that enables a single-hop external BGP peer (Device R1)
to accept the remote next-hop 1.1.10.10 for the route to the 1.1.230.0/23 network.
8. Import the agg_route policy into the routing table on Device R1.
[edit routing-options]
user@R1# set autonomous-system 65000
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
fe-1/2/2 {
unit 5 {
family inet {
address 1.1.1.2/30;
}
}
}
lo0 {
unit 2 {
family inet {
address 10.255.71.24/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R2
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
2. Configure OSPF.
3. Configure IBGP.
[edit routing-options]
user@R1# set autonomous-system 65000
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, and show routing-options commands. If the output does not display the
intended configuration, repeat the instructions in this example to correct the configuration.
type internal;
local-address 10.255.14.177;
neighbor 10.255.71.24;
}
}
ospf {
area 0.0.0.0 {
interface fe-1/2/0.6;
interface 10.255.14.177;
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
• Verifying That the Multipath Route with the Indirect Next Hop Is in the Routing
Table on page 359
• Deactivating and Reactivating the accept-remote-nexthop Statement on page 360
Verifying That the Multipath Route with the Indirect Next Hop Is in the Routing Table
Action From operational mode, enter the show route 1.1.230.0 extensive command.
1
AS path: 65500 I
Accepted Multipath
Localpref: 100
Router ID: 10.255.14.179
Indirect next hops: 1
Protocol next hop: 1.1.10.10
Indirect next hop: 91c0000 262142
Indirect path forwarding next hops: 2
Next hop type: Router
Next hop: 1.1.0.1 via fe-1/2/0.3
Next hop: 1.1.1.1 via fe-1/2/2.5
1.1.10.10/32 Originating RIB: inet.0
Node path count: 1
Forwarding nexthops: 2
Nexthop: 1.1.0.1 via fe-1/2/0.3
Nexthop: 1.1.1.1 via fe-1/2/2.5
BGP Preference: 170/-101
Next hop type: Indirect
Address: 0x90c44d8
Next-hop reference count: 4
Source: 1.1.1.1
Next hop type: Router, Next hop index: 262143
Next hop: 1.1.0.1 via fe-1/2/0.3, selected
Next hop: 1.1.1.1 via fe-1/2/2.5
Protocol next hop: 1.1.10.10
Indirect next hop: 91c0000 262142
State: <NotBest Ext>
Inactive reason: Not Best in its group - Update source
Local AS: 65000 Peer AS: 65500
Age: 2:55:27 Metric2: 0
Task: BGP_65500.1.1.1.1+53260
AS path: 65500 I
Accepted
Localpref: 100
Router ID: 10.255.14.179
Indirect next hops: 1
Protocol next hop: 1.1.10.10
Indirect next hop: 91c0000 262142
Indirect path forwarding next hops: 2
Next hop type: Router
Next hop: 1.1.0.1 via fe-1/2/0.3
Next hop: 1.1.1.1 via fe-1/2/2.5
1.1.10.10/32 Originating RIB: inet.0
Node path count: 1
Forwarding nexthops: 2
Nexthop: 1.1.0.1 via fe-1/2/0.3
Nexthop: 1.1.1.1 via fe-1/2/2.5
Meaning The output shows that Device R1 has a route to the 1.1.230.0 network with the multipath
feature enabled (Accepted Multipath). The output also shows that the route has an
indirect next hop of 1.1.10.10.
Purpose Make sure that the multipath route with the indirect next hop is removed from the routing
table when you deactivate the accept-remote-nexthop statement.
Action 1. From configuration mode, enter the deactivate protocols bgp accept-remote-nexthop
command.
Meaning When the accept-remote-nexthop statement is deactivated, the multipath route to the
1.1.230.0 network is removed from the routing table .
Related • Example: Overriding the Default BGP Routing Policy on PTX Series Packet Transport
Documentation Routers on page 256
• Example: Load Balancing BGP Traffic with Unequal Bandwidth Allocated to the Paths
on page 320
Example: Load Balancing BGP Traffic with Unequal Bandwidth Allocated to the Paths
• Understanding Load Balancing for BGP Traffic with Unequal Bandwidth Allocated to
the Paths on page 362
• Example: Load Balancing BGP Traffic with Unequal Bandwidth Allocated to the
Paths on page 363
Understanding Load Balancing for BGP Traffic with Unequal Bandwidth Allocated to the Paths
The multipath option removes the tiebreakers from the active route decision process,
thereby allowing otherwise equal cost BGP routes learned from multiple sources to be
installed into the forwarding table. However, when the available paths are not equal cost,
you may wish to load balance the traffic asymmetrically.
Once multiple next hops are installed in the forwarding table, a specific forwarding next
hop is selected by the Junos OS software per-prefix load-balancing algorithm. This
process hashes against a packet’s source and destination addresses to deterministically
map the prefix pairing onto one of the available next hops. Per-prefix mapping works
best when the hash function is presented with a large number of prefixes, such as might
occur on an Internet peering exchange, and it serves to prevent packet reordering among
pairs of communicating nodes.
An enterprise network normally wants to alter the default behavior to evoke a per-packet
load-balancing algorithm. Per-packet is emphasized here because its use is a misnomer
that stems from the historic behavior of the original Internet Processor ASIC. In reality,
current Juniper Networks routers support per-prefix (default) and per-flow load balancing.
The latter involves hashing against various Layer 3 and Layer 4 headers, including portions
of the source address, destination address, transport protocol, incoming interface, and
application ports. The effect is that now individual flows are hashed to a specific next
hop, resulting in a more even distribution across available next hops, especially when
routing between fewer source and destination pairs.
Fortunately, the Juniper Networks BGP implementation supports the notion of a bandwidth
community. This extended community encodes the bandwidth of a given next hop, and
when combined with multipath, the load-balancing algorithm distributes flows across
the set of next hops proportional to their relative bandwidths. Put another way, if you
have a 10-Mbps and a 1-Mbps next hop, on average nine flows will map to the high-speed
next hop for every one that uses the low speed.
Use of BGP bandwidth community is supported only with per-packet load balancing.
• Configure the external BGP (EBGP) peering sessions, enable multipath, and define an
import policy to tag routes with a bandwidth community that reflects link speed.
• Enable per-packet (really per-flow) load balancing for optimal distribution of traffic.
Example: Load Balancing BGP Traffic with Unequal Bandwidth Allocated to the Paths
This example shows how to configure BGP to select multiple unequal-cost paths as
active paths.
BGP communities can help you control routing policy. An example of a good use for BGP
communities is unequal load balancing. When an autonomous system border router
(ASBR) receives routes from directly connected external BGP (EBGP) neighbors, the
ASBR then advertises those routes to internal neighbors, using IBGP advertisements. In
the IBGP adverisements, you can attach the link-bandwidth community to communicate
the bandwidth of the advertised external link. This is useful when multiple external links
are available, and you want to do unequal load balancing over the links. You configure
the link-bandwidth extended community on all ingress links of the AS. The bandwidth
information in the link-bandwidth extended community is based on the configured
bandwidth of the EBGP link. It is not based on the amount of traffic on the link. Junos OS
supports BGP link-bandwidth and multipath load balancing, as described in Internet
draft draft-ietf-idr-link-bandwidth-06, BGP Link Bandwidth Extended Community.
Requirements
• Configure BGP.
• Configure a routing policy that exports routes (such as direct routes or IGP routes)
from the routing table into BGP.
Overview
By default, when BGP multipath is used, traffic is distributed equally among the several
paths calculated. The bandwidth extended community allows an additional attribute to
be added to BGP paths, thus allowing the traffic to be distributed unequally. The primary
application is a scenario where multiple external paths exist for a given network with
asymmetric bandwidth capabilities. In such a scenario, you can tag routes received with
the bandwidth extended community. When BGP multipath (internal or external) operates
among routes that contain the bandwidth attribute, the forwarding engine can unequally
distribute traffic according to the bandwidth corresponding to each path.
When BGP has several candidate paths available for multipath purposes, BGP does not
perform unequal cost load balancing according to the bandwidth community unless all
candidate paths have this attribute.
[edit policy-options]
user@host# set community members bandwidth:[1-65535]:[0-4294967295]
The first 16-bit number represents the local autonomous system. The second 32-bit
number represents the link bandwidth in bytes per second.
For example:
[edit policy-options]
user@host# show
community bw-t1 members bandwidth:10458:193000;
community bw-t3 members bandwidth:10458:5592000;
community bw-oc3 members bandwidth:10458:19440000;
Where 10458 is the local AS number. The values correspond to the bandwidth of the T1,
T3, and OC-3 paths in bytes per second. The value specified as the bandwidth value does
not need to correspond to the actual bandwidth of a specific interface. The balance
factors used are calculated as a function of the total bandwidth specified. To tag a route
with this extended community, define a policy statement, as follows:
[edit policy-options]
user@host# show
policy-statement link-bw-t1 {
then {
community set bw-t1;
}
accept;
}
Apply this as an import policy on the BGP peering sessions facing the asymmetrical
bandwidth links. Although in theory the community attribute can be added or removed
at any point in the network, in the scenario described above, applying the community as
an import policy in the EBGP peering session facing the external link allows for that
attribute to influence the local multipath decision, and is potentially easier to manage.
Topology
“CLI Quick Configuration” on page 322 shows the configuration for all of the devices in
Figure 34 on page 322. The section“Step-by-Step Procedure” on page 324 describes the
steps on Device R1.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit routing-options]
user@R1# set forwarding-table export loadbal
[editpolicy-options]
user@R1# set community bw-high members bandwidth:65000:60000000
user@R1# set community bw-low members bandwidth:65000:40000000
[editpolicy-options bw-dis]
user@R1# set term a from protocol bgp
user@R1# set term a from neighbor 10.0.1.1
user@R1# set term a then community add bw-high
user@R1# set term a then accept
[edit routing-options]
user@R1# set autonomous-system 65000
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
protocol bgp;
neighbor 10.0.1.1;
}
then {
community add bw-high;
accept;
}
}
term b {
from {
protocol bgp;
neighbor 10.0.0.2;
}
then {
community add bw-low;
accept;
}
}
}
policy-statement loadbal {
from {
route-filter 10.0.0.0/16 orlonger;
}
then {
load-balance per-packet;
}
}
community bw-high members bandwidth:65000:60000000;
community bw-low members bandwidth:65000:40000000;
If you are done configuring the device, enter commit from configuration mode.
Verification
Verifying Routes
Purpose Verify that both routes are selected and that the next hops on the routes show a
60%/40% balance.
Action From operational mode, run the show route protocol bgp detail command.
Communities: bandwidth:65000:40000000
Accepted MultipathContrib
Localpref: 100
Router ID: 192.168.0.3
Meaning The active path, denoted with an asterisk (*), has two next hops: 10.0.1.1 and 10.0.0.2 to
the 172.16/16 destination.
Likewise, the active path, denoted with an asterisk (*), has two next hops: 10.0.1.1 and
10.0.0.2 to the 10.0.2.0 destination.
In both cases, the 10.0.1.1 next hop is copied from the inactive path to the active path.
The balance of 40 percent and 60 percent is shown in the show route output. This
indicates that traffic is being distributed between two next hops and that 60 percent of
the traffic is following the first path, while 40 percent is following the second path.
Instead of advertising only the active path to a destination, you can configure BGP to
advertise multiple paths to the destination. Within an autonomous system (AS), the
availability of multiple exit points to reach a destination provides the following benefits:
• Fault tolerance—Path diversity leads to reduction in restoration time after failure. For
instance, a border router after receiving multiple paths to the same destination can
precompute a backup path and have it ready so that when the primary path becomes
invalid, the border router can use the backup to quickly restore connectivity. Without
a backup path, the restoration time depends on BGP reconvergence, which includes
withdraw and advertisement messages in the network before a new best path can be
learned.
• Internal BGP (IBGP) peers only. No support on external BGP (EBGP) peers.
• Prefix policies enable you to filter routes on a router that is configured to advertise
multiple paths to a destination. However, prefix policies can only match routes. Prefix
policies cannot change the attributes of routes.
Requirements
• Five of the BGP-enabled devices do not necessarily need to be routers. For example,
they can be EX Series Ethernet Switches.
• Three of the BGP-enabled devices are configured to send multiple paths or receive
multiple paths (or both send and receive multiple paths). These three BGP-enabled
devices must be M Series Multiservice Edge Routers, MX Series 3D Universal Edge
Routers, or T Series Core Routers.
Overview
The following statements are used for configuring multiple paths to a destination:
In this example, Router R5, Router R6, and Router R7 redistribute static routes into BGP.
Router R1 and Router R4 are route reflectors. Router R2 and Router R3 are clients to
Route Reflector R1. Router R8 is a client to Route Reflector R4.
With the add-path receive configuration, Router R4 is configured to receive multiple paths
from Router R1.
With the add-path receive configuration, Router R8 is configured to receive multiple paths
from Router R4.
The add-path send prefix-policy allow_199 policy configuration (along with the
corresponding route filter) limits Router R4 to sending multiple paths for only the
199.1.1.1/32 route.
Topology Diagram
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Router R1
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
1. Configure the interfaces to Router R2, Router R3, Router R4, and Router R5, and
configure the loopback (lo0) interface.
[edit interfaces]
user@R1# set fe-0/0/0 unit 12 family inet address 10.0.12.1/24
The destination of the paths can be any destination that Router R1 can reach through
multiple paths.
[edit routing-options]
user@R1# set router-id 10.0.0.10
user@R1# set autonomous-system 1
user@R1# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
family inet {
address 10.0.13.1/24;
}
}
}
fe-1/0/0 {
unit 14 {
family inet {
address 10.0.14.1/24;
}
}
}
fe-1/2/0 {
unit 15 {
family inet {
address 10.0.15.1/24;
}
}
}
lo0 {
unit 10 {
family inet {
address 10.0.0.10/32;
}
}
}
}
}
}
ospf {
area 0.0.0.0 {
interface lo0.10 {
passive;
}
interface fe-0/0/0.12;
interface fe-0/0/1.13;
interface fe-1/0/0.14;
interface fe-1/2/0.15;
}
}
Configuring Router R2
[edit interfaces]
user@R2# set fe-1/2/0 unit 21 family inet address 10.0.12.2/24
[edit protocols]
user@R2# set bgp group rr type internal
user@R2# set bgp group rr local-address 10.0.0.20
3. For routes sent from Router R2 to Router R1, advertise Router R2 as the next hop,
because Router R1 does not have a route to Router R6’s address on the 10.0.26.0/24
network.
[edit]
user@R2# set policy-options policy-statement set_nh_self then next-hop self
[edit]
user@R2# set routing-options autonomous-system 1
user@R2# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options,and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
passive;
}
interface fe-1/2/0.21;
interface fe-1/2/1.28;
}
}
Configuring Router R3
[edit interfaces]
user@R3# set fe-1/0/1 unit 31 family inet address 10.0.13.2/24
[edit protocols]
user@R3# set bgp group rr type internal
user@R3# set bgp group rr local-address 10.0.0.30
3. For routes sent from Router R3 to Router R1, advertise Router R3 as the next hop,
because Router R1 does not have a route to Router R7’s address on the 10.0.37.0/24
network.
[edit]
user@R3# set policy-options policy-statement set_nh_self then next-hop self
[edit]
user@R3# set routing-options autonomous-system 1
user@R3# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
user@R3# show policy-options
policy-statement set_nh_self {
then {
next-hop self;
}
}
Configuring Router R4
[edit interfaces]
user@R4# set fe-1/2/0 unit 41 family inet address 10.0.14.2/24
The destination of the paths can be any destination that Router R4 can reach through
multiple paths.
4. Configure Router R4 to receive multiple paths from its neighbor, Router R1.
The destination of the paths can be any destination that Router R1 can reach through
multiple paths.
6. Configure a policy that allows Router R4 to send Router R8 multiple paths to the
199.1.1.1/32 route.
Router R4 receives multiple paths for the 198.1.1.1/32 route and the 199.1.1.1/32 route.
However, because of this policy, Router R4 only sends multiple paths for the
199.1.1.1/32 route.
[edit protocols bgp group rr_client neighbor 10.0.0.80 family inet unicast]
user@R4# set add-path send prefix-policy allow_199
[edit routing-options]
user@R4# set autonomous-system 1
user@R4# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
type internal;
local-address 10.0.0.40;
family inet {
unicast {
add-path {
receive;
}
}
}
neighbor 10.0.0.10;
}
group rr_client {
type internal;
local-address 10.0.0.40;
cluster 10.0.0.40;
neighbor 10.0.0.80 {
family inet {
unicast {
add-path {
send {
path-count 6;
prefix-policy allow_199;
}
}
}
}
}
}
}
ospf {
area 0.0.0.0 {
interface lo0.40 {
passive;
}
interface fe-1/2/0.41;
interface fe-1/2/1.48;
}
}
Configuring Router R5
[edit interfaces]
[edit routing-options]
user@R5# set static route 199.1.1.1/32 reject
user@R5# set static route 198.1.1.1/32 reject
[edit routing-options]
user@R5# set autonomous-system 2
user@R5# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
Configuring Router R6
[edit interfaces]
user@R6# set fe-1/2/0 unit 62 family inet address 10.0.26.2/24
[edit protocols]
user@R6# set bgp group e1 type external
user@R6# set bgp group e1 neighbor 10.0.26.1 peer-as 1
[edit]
user@R6# set routing-options static route 199.1.1.1/32 reject
user@R6# set routing-options static route 198.1.1.1/32 reject
4. Redistribute static and direct routes from Router R6’s routing table into BGP.
[edit routing-options]
user@R6# set autonomous-system 2
user@R6# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
Configuring Router R7
[edit interfaces]
user@R7# set fe-1/2/0 unit 73 family inet address 10.0.37.2/24
[edit]
user@R7# set routing-options static route 199.1.1.1/32 reject
4. Redistribute static and direct routes from Router R7’s routing table into BGP.
[edit routing-options]
user@R7# set autonomous-system 2
user@R7# commit
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
address 10.0.0.70/32;
}
}
}
Configuring Router R8
[edit interfaces]
user@R8# set fe-1/2/0 unit 84 family inet address 10.0.48.2/24
[edit protocols]
user@R8# set bgp group rr type internal
user@R8# set bgp group rr local-address 10.0.0.80
3. Configure Router R8 to receive multiple paths from its neighbor, Router R4.
The destination of the paths can be any destination that Router R4 can reach through
multiple paths.
[edit protocols]
user@R8# set bgp group rr neighbor 10.0.0.40 family inet unicast add-path receive
[edit]
user@R8# commit
Results
From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
Verification
• Verifying That the BGP Peers Have the Ability to Send and Receive Multiple
Paths on page 392
• Verifying That Router R1 Is Advertising Multiple Paths on page 392
• Verifying That Router R4 Is Receiving and Advertising Multiple Paths on page 393
• Verifying That Router R8 Is Receiving Multiple Paths on page 394
• Checking the Path ID on page 394
Verifying That the BGP Peers Have the Ability to Send and Receive Multiple Paths
Purpose Make sure that one or both of the following strings appear in the output of the show bgp
neighbor command:
Purpose Make sure that multiple paths to the 198.1.1.1/32 destination and multiple paths to the
199.1.1.1/32 destination are advertised to Router R4.
Meaning When you see one prefix and more than one next hop, it means that multiple paths are
advertised to Router R4.
Purpose Make sure that multiple paths to the 199.1.1.1/32 destination are received from Router R1
and advertised to Router R8. Make sure that multiple paths to the 198.1.1.1/32 destination
are received from Router R1, but only one path to this destination is advertised to Router
R8.
Meaning The show route receive-protocol command shows that Router R4 receives two paths to
the 198.1.1.1/32 destination and three paths to the 199.1.1.1/32 destination. The show route
advertising-protocol command shows that Router R4 advertises only one path to the
198.1.1.1/32 destination and advertises all three paths to the 199.1.1.1/32 destination.
Because of the prefix policy that is applied to Router R4, Router R4 does not advertise
multiple paths to the 198.1.1.1/32 destination. Router R4 advertises only one path to the
198.1.1.1/32 destination even though it receives multiple paths to this destination.
Purpose Make sure that Router R8 receives multiple paths to the 199.1.1.1/32 destination through
Router R4. Make sure that Router R8 receives only one path to the 198.1.1.1/32 destination
through Router R4.
Purpose On the downstream devices, Router R4 and Router R8, verify that a path ID uniquely
identifies the path. Look for the Addpath Path ID: string.
Localpref: 100
Router ID: 10.0.0.40
Addpath Path ID: 3
To use route reflection in an AS, you designate one or more routers as a route
reflector—typically, one per point of presence (POP). Route reflectors have the special
BGP ability to readvertise routes learned from an internal peer to other internal peers.
So rather than requiring all internal peers to be fully meshed with each other, route
reflection requires only that the route reflector be fully meshed with all internal peers.
The route reflector and all of its internal peers form a cluster, as shown in
Figure 40 on page 400.
NOTE: For some Juniper Networks devices, you must have an Advanced BGP
Feature license installed on each device that uses a route reflector. For license
details, see the Junos OS Initial Configuration Guide for Security Devices.
Figure 40 on page 400 shows Router RR configured as the route reflector for Cluster 127.
The other routers are designated internal peers within the cluster. BGP routes are
advertised to Router RR by any of the internal peers. RR then readvertises those routes
to all other peers within the cluster.
You can configure multiple clusters and link them by configuring a full mesh of route
reflectors (see Figure 41 on page 400).
However, as clusters become large, a full mesh with a route reflector becomes difficult
to scale, as does a full mesh between route reflectors. To help offset this problem, you
can group clusters of routers together into clusters of clusters for hierarchical route
reflection (see Figure 42 on page 401).
Figure 42 on page 401 shows RR 2, RR 3, and RR 4 as the route reflectors for Clusters 127,
19, and 45, respectively. Rather than fully mesh those route reflectors, the network
administrator has configured them as part of another cluster (Cluster 6) for which RR 1
is the route reflector. When a router advertises a route to RR 2, RR 2 readvertises the
route to all the routers within its own cluster, and then readvertises the route to RR 1. RR
1 readvertises the route to the routers in its cluster, and those routers propagate the route
down through their clusters.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
Generally, internal BGP (IBGP)-enabled devices need to be fully meshed, because IBGP
does not readvertise updates to other IBGP-enabled devices. The full mesh is a logical
mesh achieved through configuration of multiple neighbor statements on each
IBGP-enabled device. The full mesh is not necessarily a physical full mesh. Maintaining
a full mesh (logical or physical) does not scale well in large deployments.
Figure 43 on page 403 shows an IBGP network with Device A acting as a route reflector.
Device B and Device C are clients of the route reflector. Device D and Device E are outside
the cluster, so they are nonclients of the route reflector.
On Device A (the route reflector), you must form peer relationships with all of the
IBGP-enabled devices by including the neighbor statement for the clients (Device B and
Device C) and the nonclients (Device D and Device E). You must also include the cluster
statement and a cluster identifier. The cluster identifier can be any 32-bit value. This
example uses the loopback interface IP address of the route reflector.
On Device B and Device C, the route reflector clients, you only need one neighbor
statement that forms a peer relationship with the route reflector, Device A.
On Device D and Device E, the nonclients, you need a neighbor statement for each
nonclient device (D-to-E and E-to-D). You also need a neighbor statement for the route
reflector (D-to-A and E-to-A). Device D and Device E do not need neighbor statements
for the client devices (Device B and Device C).
AS 17
192.168.5.5
192.168.0.1
192.168.6.5
Route Reflector
192.163.6.4
C B
192.168.40.4
g040867
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
To configure IBGP in the network using Juniper Networks Device A as a route reflector:
[edit interfaces]
user@A# set fe-0/0/0 unit 1 description to-B
user@A# set fe-0/0/0 unit 1 family inet address 10.10.10.1/30
user@A# set fe-0/0/1 unit 3 description to-D
user@A# set fe-0/0/1 unit 3 family inet address 10.10.10.9/30
user@A# set lo0 unit 1 family inet address 192.168.6.5/32
2. Configure BGP, including the cluster identifier and neighbor relationships with all
IBGP-enabled devices in the autonomous system (AS).
Also apply the policy that redistributes OSPF routes into BGP.
[edit routing-options]
user@A# set router-id 192.168.6.5
user@A# set autonomous-system 17
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
If you are done configuring the device, enter commit from configuration mode.
NOTE: Repeat these steps for each nonclient BGP peer within the cluster
that you are configuring, if the other nonclient devices are from Juniper
Networks. Otherwise, consult the device’s documentation for instructions.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@B# set fe-0/0/0 unit 2 description to-A
user@B# set fe-0/0/0 unit 2 family inet address 10.10.10.2/30
user@B# set fe-0/0/1 unit 5 description to-C
user@B# set fe-0/0/1 unit 5 family inet address 10.10.10.5/30
user@B# set lo0 unit 2 family inet address 192.163.6.4/32
Also apply the policy that redistributes OSPF routes into BGP.
3. Configure OSPF.
[edit routing-options]
user@B# set router-id 192.163.6.4
user@B# set autonomous-system 17
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
If you are done configuring the device, enter commit from configuration mode.
NOTE: Repeat these steps for each client BGP peer within the cluster that
you are configuring if the other client devices are from Juniper Networks.
Otherwise, consult the device’s documentation for instructions.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@D# set fe-0/0/0 unit 4 description to-A
user@D# set fe-0/0/0 unit 4 family inet address 10.10.10.10/30
user@D# set fe-0/0/1 unit 7 description to-E
user@D# set fe-0/0/1 unit 7 family inet address 10.10.10.13/30
user@D# set lo0 unit 4 family inet address 192.168.0.1/32
2. Configure the BGP neighbor relationships with the RRroute reflector and with the
other nonclient peers.
Also apply the policy that redistributes OSPF routes into BGP.
3. Configure OSPF.
[edit routing-options]
user@D# set router-id 192.168.0.1
user@D# set autonomous-system 17
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
passive;
}
interface fe-0/0/0.4;
interface fe-0/0/1.7;
}
}
If you are done configuring the device, enter commit from configuration mode.
NOTE: Repeat these steps for each nonclient BGP peer within the cluster
that you are configuring if the other nonclient devices are from Juniper
Networks. Otherwise, consult the device’s documentation for instructions.
Verification
Purpose Verify that BGP is running on configured interfaces and that the BGP session is established
for each neighbor address.
Action From operational mode, enter the show bgp neighbor command.
Output Queue[0]: 0
Action From operational mode, enter the show bgp group command.
Action From operational mode, enter the show bgp summary command.
Purpose Verify that the routing table contains the IBGP routes.
• Understanding a Route Reflector that Belongs to Two Different Clusters on page 416
• Example: Configuring a Route Reflector that Belongs to Two Different
Clusters on page 417
Normally, a single RR is a member of only one cluster. Consider, for example, that in a
hierarchical RR design, a tier-two RR can be the client of a tier-1 RR, but they can not be
clients of each other.
However, when two RRs are clients of each other and the routes are being reflected from
one cluster to another, only one of the cluster IDs is included in the cluster list. This is
because having one cluster ID in the cluster list is adequate for loop prevention in this
case.
Table 5 on page 417 summarizes the rules that route reflectors use when filling in a reflected
route's cluster list with cluster IDs.
When reflecting a route from one of the clients The RR fills the cluster ID associated with that
to a non-client router client in the cluster list of the reflected route.
When reflecting a route from a non-client router The RR fills the cluster ID associated with that
to a client router client in the cluster list of the reflected route.
When reflecting a route from a client router to The RR fills the cluster ID associated with
another client router that is in a different cluster client1 in the cluster list before reflecting the
cluster ID to client2. The cluster ID associated
client1 -> RR -> client2 (different cluster) with client 2 is not added.
Requirements
Configure the device interfaces and an internal gateway protocol (IGP). For an example
of an RR setup that includes the interface and IGP configuration, see “Example: Configuring
a Route Reflector” on page 401.
Overview
In this example, Device RR1 is a route reflector for both Device R2 and Device RR2.
Client
2.2.2.2/32 R2 192.168.48.1
g041322
192.168.16.1 192.168.32.1
This example shows the BGP configuration on Device RR1 and Device RR2.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
Results From configuration mode, confirm your configuration by entering the show protocols
command. If the output does not display the intended configuration, repeat the
instructions in this example to correct the configuration.
If you are done configuring the device, enter commit from configuration mode.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
Results From configuration mode, confirm your configuration by entering the show protocols
command. If the output does not display the intended configuration, repeat the
instructions in this example to correct the configuration.
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Verify that BGP is running on configured interfaces and that the BGP session is established
for each neighbor address.
Action From operational mode, enter the show bgp neighbor command.
Meaning The 2.2.2.2/32 route originates from the Device RR1’s client peer, Device R2. When this
route is sent to RR1’s client, Device RR2, the route has the 5.5.5.5 cluster ID attached,
which is the cluster ID for RR1-R2.
Purpose Check the route advertisement from Device RR1 to Device RR2.
Action From operational mode, enter the show bgp group command.
Meaning The 1.1.1.1/32 route originates from the Device RR1’s non-client peer, Device R0. When
this route is sent to RR1’s client, Device RR2, the route has the 6.6.6.6 cluster ID attached,
which is the cluster ID for RR1-RR2.
Device RR1 preserves the inbound cluster ID from Device R2 when advertising to another
client in a different cluster (Device R4).
Within a sub-AS, the same internal BGP (IBGP) full mesh requirement exists. Connections
to other confederations are made with standard external BGP (EBGP), and peers outside
the sub-AS are treated as external. To avoid routing loops, a sub-AS uses a confederation
sequence, which operates like an AS path but uses only the privately assigned sub-AS
numbers.
The confederation AS appears whole to other confederation ASs. The AS path received
by other ASs shows only the globally assigned AS number. It does not include the
confederation sequence or the privately assigned sub-AS numbers. The sub-AS numbers
are removed when the route is advertised out of the confederation AS.
Figure 45 on page 422 shows an AS divided into four confederations.
AS 3
Sub-AS 64517 Sub-AS 64550
IBGP IBGP
EBGP
g015021
IBGP IBGP
Figure 45 on page 422 shows AS 3 divided into four sub-ASs, 64517, 64550, 65300, and
65410, which are linked through EBGP sessions. Because the confederations are
connected by EBGP, they do not need to be fully meshed. EBGP routes are readvertised
to other sub-ASs.
Requirements
Overview
Within a BGP confederation, the links between the confederation member autonomous
systems (ASs) must be external BGP (EBGP) links, not internal BGP (IBGP) links.
Similar to route reflectors, BGP confederations reduce the number of peer sessions and
TCP sessions to maintain connections between IBGP routing devices. BGP confederation
is one method used to solve the scaling problems created by the IBGP full mesh
requirement. BGP confederations effectively break up a large AS into subautonomous
systems. Each sub-AS must be uniquely identified within the confederation AS by a
sub-AS number. Typically, sub-AS numbers are taken from the private AS numbers
between 64512 and 65535. Within a sub-AS, the same IBGP full mesh requirement exists.
Connections to other confederations are made with standard EBGP, and peers outside
the sub-AS are treated as external. To avoid routing loops, a sub-AS uses a confederation
sequence, which operates like an AS path but uses only the privately assigned sub-AS
numbers.
Figure 46 on page 423 shows a sample network in which AS 17 has two separate
confederations: sub-AS 64512 and sub-AS 64513, each of which has multiple routers.
Within a sub-AS, an IGP is used to establish network connectivity with internal peers.
Between sub-ASs, an EBGP peer session is established.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step This procedure shows the steps for the devices that are in sub-AS 64512.
Procedure
The autonomous-system statement sets the sub-AS number of the device.
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.
[edit routing-options]
user@host# set autonomous-system 64512
The number 17 represents the main AS. The members statement lists all the sub-ASs
in the main AS.
3. On the border device in sub-AS 64512, configure an EBGP connection to the border
device in AS 64513.
4. Configure an IBGP group for peering with the devices within sub-AS 64512.
Results From configuration mode, confirm your configuration by entering the show routing-options
and show protocols commands. If the output does not display the intended configuration,
repeat the instructions in this example to correct the configuration.
autonomous-system 64512;
confederation 17 members [ 64512 64513 ];
If you are done configuring the device, enter commit from configuration mode.
Repeat these steps for sSub-AS 64513.
Verification
Purpose Verify that BGP is running on configured interfaces and that the BGP session is active for
each neighbor address.
Action From the CLI, enter the show bgp neighbor command.
Sample Output
user@host> show bgp neighbor
Peer: 10.255.245.12+179 AS 35 Local: 10.255.245.13+2884 AS 35
Type: Internal State: Established (route reflector client)Flags: Sync
Last State: OpenConfirm Last Event: RecvKeepAlive
Last Error: None
Options: Preference LocalAddress HoldTime Cluster AddressFamily Rib-group Refresh
Meaning The output shows a list of the BGP neighbors with detailed session information. Verify
the following information:
• For Type, each peer is configured as the correct type (either internal or external).
Action From the CLI, enter the show bgp group command.
Sample Output
user@host> show bgp group
Group Type: Internal AS: 10045 Local AS: 10045
Name: pe-to-asbr2 Flags: Export Eval
Export: [ match-all ]
Total peers: 1 Established: 1
10.0.0.4+179
bgp.l3vpn.0: 1/1/0
vpn-green.inet.0: 1/1/0
Meaning The output shows a list of the BGP groups with detailed group information. Verify the
following information:
• For Group Type, each group has the correct type (either internal or external).
• For Total peers, the expected number of peers within the group is shown.
• For Established, the expected number of peers within the group have BGP sessions in
the Established state.
• The IP addresses of all the peers within the group are present.
Action From the CLI, enter the show bgp summary command.
Sample Output
user@host> show bgp summary
Groups: 1 Peers: 3 Down peers: 0
Table Tot Paths Act Paths Suppressed History Damp State Pending
inet.0 6 4 0 0 0 0
Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn
State|#Active/Received/Damped...
10.0.0.2 65002 88675 88652 0 2 42:38 2/4/0
0/0/0
10.0.0.3 65002 54528 54532 0 1 2w4d22h 0/0/0
0/0/0
10.0.0.4 65002 51597 51584 0 0 2w3d22h 2/2/0
0/0/0
Meaning The output shows a summary of BGP session information. Verify the following information:
• For Down Peers, the total number of unestablished peers is 0. If this value is not zero,
one or more peering sessions are not yet established.
• Under Up/Dwn State, the BGP state reflects the number of paths received from the
neighbor, the number of these paths that have been accepted, and the number of
routes being damped (such as 0/0/0). If the field is Active, it indicates a problem in
the establishment of the BGP session.
Router and route authentication enables routers to share information only if they can
verify that they are talking to a trusted source, based on a password (key). In this method,
a hashed key is sent along with the route being sent to another router. The receiving router
compares the sent key to its own configured key. If they are the same, it accepts the
route. By using a hashing algorithm, the key is not sent over the wire in plain text. Instead,
a hash is calculated using the configured key. The routing update is used as the input
text, along with the key, into the hashing function. This hash is sent along with the route
update to the receiving router. The receiving router compares the received hash with a
hash it generates on the route update using the preshared key configured on it. If the two
hashes are the same, the route is assumed to be from a trusted source. The key is known
only to the sending and receiving routers.
the keys roll over from one to the next without resetting any peering sessions or interrupting
the routing protocol.
The sending peer uses the following rules to identify the active authentication key:
• The start time is less than or equal to the current time (in other words, not in the future).
• The start time is greater than that of all other keys in the chain whose start time is less
than the current time (in other words, closest to the current time).
The receiving peer determines the key with which it authenticates based on the incoming
key identifier.
The sending peer identifies the current authentication key based on a configured start
time and then generates a hash value using the current key. The sending peer then inserts
a TCP-enhanced authentication option object into the BGP update message. The object
contains an object ID (assigned by IANA), the object length, the current key, and a hash
value.
The receiving peer examines the incoming TCP-enhanced authentication option, looks
up the received authentication key, and determines whether the key is acceptable based
on the start time, the system time, and the tolerance parameter. If the key is accepted,
the receiving peer calculates a hash and authenticates the update message.
Initial application of a keychain to a TCP session causes the session to reset. However,
once the keychain is applied, the addition or removal of a password from the keychain
does not cause the TCP session to reset. Also, the TCP session does not reset when the
keychain changes from one authentication algorithm to another.
Requirements
Overview
When you configure authentication, the algorithm creates an encoded checksum that is
included in the transmitted packet. The receiving routing device uses an authentication
key (password) to verify the packet’s checksum.
This example includes the following statements for configuring and applying the keychain:
• key—A keychain can have multiple keys. Each key within a keychain must be identified
by a unique integer value. The range of valid identifier values is from 0 through 63.
The key can be up to 126 characters long. Characters can include any ASCII strings. If
you include spaces, enclose all characters in quotation marks (“ ”).
• key-chain—For each keychain, you must specify a name. This example defines one
keychain: bgp-auth. You can have multiple keychains on a routing device. For example,
you can have a keychain for BGP, a keychain for OSPF, and a keychain for LDP.
• secret—For each key in the keychain, you must set a secret password. This password
can be entered in either encrypted or plain text format in the secret statement. It is
always displayed in encrypted format.
• start-time—Each key must specify a start time in UTC format. Control gets passed
from one key to the next. When a configured start time arrives (based on the routing
device’s clock), the key with that start time becomes active. Start times are specified
in the local time zone for a routing device and must be unique within the keychain.
This example configures a keychain named bgp-auth. Key 0 will be sent and accepted
starting at 2011-6-23.20:19:33 -0700, and will stop being sent and accepted when the
next key in the keychain (key 1) becomes active. Key 1 becomes active one year later at
2012-6-23.20:19:33 -0700, and will not stop being sent and accepted unless another key
is configured with a start time that is later than the start time of key 1. A clock-skew
tolerance of 30 seconds applies to the receiver accepting the keys. During the tolerance
period, either the current or previous key is acceptable. The keys are shared-secret
passwords. This means that the neighbors receiving the authenticated routing updates
must have the same authentication keychain configuration, including the same keys
(passwords). So Router R0 and Router R1 must have the same authentication-key-chain
configuration if they are configured as peers. This example shows the configuration on
only one of the routing devices.
Topology Diagram
R0 R1
g041117
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
To configure Router R1 to accept route filters from Device CE1 and perform outbound
route filtering using the received filters:
[edit routing-options]
user@R1# set autonomous-system 65533
The start time of each key must be unique within the keychain.
4. Apply the authentication keychain to BGP, and set the hashing algorithm.
Results From configuration mode, confirm your configuration by entering the show protocols,
show routing-options, and show security commands. If the output does not display the
intended configuration, repeat the instructions in this example to correct the configuration.
If you are done configuring the device, enter commit from configuration mode.
Repeat the procedure for every BGP-enabled device in the network, using the appropriate
interface names and addresses for each BGP-enabled device.
Verification
Purpose Make sure that the AutheKeyChain option appears in the output of the show bgp neighbor
command.
Action From operational mode, enter the show bgp neighbor command.
Action From operational mode, enter the monitor traffic interface fe-0/0/1 command.
Purpose Check the number of packets dropped by TCP because of authentication errors.
Action From operational mode, enter the show system statistics tcp | match auth command.
Purpose Check the number of packets dropped by TCP because of authentication errors.
Action From operational mode, enter the show security keychain detail command.
The Junos OS implementation of IPsec supports two types of security: host to host and
gateway to gateway. Host-to-host security protects BGP sessions with other routers. An
SA to be used with BGP must be configured manually and use transport mode. Static
values must be configured on both ends of the security association. To apply host
protection, you configure manual SAs in transport mode and then reference the SA by
name in the BGP configuration to protect a session with a given peer.
Manual SAs require no negotiation between the peers. All values, including the keys, are
static and specified in the configuration. Manual SAs statically define the security
parameter index values, algorithms, and keys to be used and require matching
configurations on both end points of the tunnel (on both peers). As a result, each peer
must have the same configured options for communication to take place.
In transport mode, IPsec headers are inserted after the original IP header and before the
transport header.
The security parameter index is an arbitrary value used in combination with a destination
address and a security protocol to uniquely identify the SA.
Requirements
• Configure BGP.
Overview
The SA is configured at the [edit security ipsec security-association name] hierarchy level
with the mode statement set to transport. In transport mode, Junos OS does not support
authentication header (AH) or encapsulating security payload (ESP) header bundles.
Junos OS supports only the BGP protocol in transport mode.
This example specifies bidirectional IPsec to decrypt and authenticate the incoming and
outgoing traffic using the same algorithm, keys, and SPI in both directions, unlike inbound
and outbound SAs that use different attributes in both directions.
A more specific SA overrides a more general SA. For example, if a specific SA is applied
to a specific peer, that SA overrides the SA applied to the whole peer group.
Topology Diagram
R0 R1
g041117
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
[edit]
set security ipsec security-association test-sa mode transport
set security ipsec security-association test-sa manual direction bidirectional protocol
esp
set security ipsec security-association test-sa manual direction bidirectional spi 1000
set security ipsec security-association test-sa manual direction bidirectional encryption
algorithm 3des-cbc
set security ipsec security-association test-sa manual direction bidirectional encryption
key ascii-text
"$9$kPT3AtO1hr6/u1IhvM8X7Vb2JGimfz.PtuB1hcs2goGDkqf5Qndb.5QzCA0BIRrvx7VsgJ"
set protocols bgp group 1 neighbor 1.1.1.1 ipsec-sa test-sa
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
When you use an ASCII text key, the key must contain exactly 24 characters.
Results From configuration mode, confirm your configuration by entering the show protocols and
show security commands. If the output does not display the intended configuration,
repeat the instructions in this example to correct the configuration.
encryption {
algorithm 3des-cbc;
key ascii-text
"$9$kPT3AtO1hr6/u1IhvM8X7Vb2JGimfz.PtuB1hcs2goGDkqf5Qndb.5QzCA0BIRrvx7VsgJ";
## SECRET-DATA
}
}
}
}
}
If you are done configuring the device, enter commit from configuration mode. Repeat
the configuration on Router R0, changing only the neighbor address.
Verification
Purpose Make sure that the correct settings appear in the output of the show ipsec
security-associations command.
Action From operational mode, enter the show ipsec security-associations command.
Meaning The output is straighforward for most fields except the AUX-SPI field. The AUX-SPI is
the value of the auxiliary security parameter index. When the value is AH or ESP, AUX-SPI
is always 0. When the value is AH+ESP, AUX-SPI is always a positive integer.
Over time, BGP has become the dominant interdomain routing protocol on the Internet.
However, it has limited guarantees of stability and security. Configuring security options
for BGP must balance suitable security measures with acceptable costs. No one method
has emerged as superior to other methods. Each network administrator must configure
security measures that meet the needs of the network being used.
For detailed information about the security issues associated with BGP’s use of TCP as
a transport protocol, see RFC 4272, BGP Security Vulnerabilities Analysis.
Example: Configuring a Filter to Block TCP Access to a Port Except from Specified BGP Peers
This example shows how to configure a standard stateless firewall filter that blocks all
TCP connection attempts to port 179 from all requesters except from specified BGP
peers.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
In this example, you create a stateless firewall filter that blocks all TCP connection
attempts to port 179 from all requesters except the specified BGP peers.
The stateless firewall filter filter_bgp179 matches all packets from the directly connected
interfaces on Device A and Device B to the destination port number 179.
Figure 49 on page 441 shows the topology used in this example. Device C attempts to
make a TCP connection to Device E. Device E blocks the connection attempt. This example
shows the configuration on Device E.
10.2 A
AS 22
10.1
AS 17 E 10.5 10.6 B
10.9
10.10
g040870
C
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device E
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
To configure Device E with a stateless firewall filter that blocks all TCP connection
attempts to port 179 from all requestors except specified BGP peers:
2. Configure BGP.
[edit routing-options]
user@E# set autonomous-system 17
4. Define the filter term that accepts TCP connection attempts to port 179 from the
specified BGP peers.
5. Define the other filter term to reject packets from other sources.
Results From configuration mode, confirm your configuration by entering the show firewall, show
interfaces, show protocols, and show routing-options commands. If the output does not
display the intended configuration, repeat the instructions in this example to correct the
configuration.
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose Make sure that the filter is listed in output of the show firewall filter command.
Action From operational mode, run the show system connections extensive command on Device C
and Device E.
The output on Device C shows the attempt to establish a TCP connection. The output
on Device E shows that connections are established with Device A and Device B only.
Purpose Use the monitor traffic command to compare the traffic on an interface that establishes
a TCP connection with the traffic on an interface that does not establish a TCP connection.
Action From operational mode, run the monitor traffic command on the Device E interface to
Device B and on the Device E interface to Device C. The following sample output verifies
that in the first example, acknowledgment (ack) messages are received. In the second
example, ack messages are not received.
Example: Configuring a Filter to Limit TCP Access to a Port Based On a Prefix List
This example shows how to configure a standard stateless firewall filter that limits certain
TCP and Internet Control Message Protocol (ICMP) traffic destined for the Routing Engine
by specifying a list of prefix sources that contain allowed BGP peers.
Requirements
Overview
In this example, you create a stateless firewall filter that blocks all TCP connection
attempts to port 179 from all requesters except BGP peers that have a specified prefix.
A source prefix list, plist_bgp179, is created that specifies the list of source prefixes that
contain allowed BGP peers.
The stateless firewall filter filter_bgp179 matches all packets from the source prefix list
plist_bgp179 to the destination port number 179.
Configuration
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.
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
set policy-options prefix-list plist_bgp179 apply-path "protocols bgp group <*> neighbor
<*>"
set firewall family inet filter filter_bgp179 term 1 from source-address 0.0.0.0/0
set firewall family inet filter filter_bgp179 term 1 from source-prefix-list plist_bgp179 except
set firewall family inet filter filter_bgp179 term 1 from destination-port bgp
set firewall family inet filter filter_bgp179 term 1 then reject
set firewall family inet filter filter_bgp179 term 2 then accept
set interfaces lo0 unit 0 family inet filter input filter_bgp179
set interfaces lo0 unit 0 family inet address 127.0.0.1/32
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
1. Expand the prefix list bgp179 to include all prefixes pointed to by the BGP peer group
defined by protocols bgp group <*> neighbor <*>.
2. Define the filter term that rejects TCP connection attempts to port 179 from all
requesters except the specified BGP peers.
Results
From configuration mode, confirm your configuration by entering the show firewall, show
interfaces, and show policy-options commands. If the output does not display the intended
configuration, repeat the instructions in this example to correct the configuration.
}
address 127.0.0.1/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Repeat the procedure, where appropriate, for every BGP-enabled device in the network,
using the appropriate interface names and addresses for each BGP-enabled device.
Verification
Purpose Verify that the firewall filter filter_bgp179 is applied to the IPv4 input traffic at logical
interface lo0.0.
Action Use the show interfaces statistics operational mode command for logical interface lo0.0,
and include the detail option. Under the Protocol inet section of the command output
section, the Input Filters field displays the name of the stateless firewall filter applied
to the logical interface in the input direction:
[edit]
user@host> show interfaces statistics lo0.0 detail
Logical interface lo0.0 (Index 321) (SNMP ifIndex 16) (Generation 130)
Flags: SNMP-Traps Encapsulation: Unspecified
Traffic statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Local statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Transit statistics:
Input bytes : 0 0 bps
Output bytes : 0 0 bps
Input packets: 0 0 pps
Output packets: 0 0 pps
Protocol inet, MTU: Unlimited, Generation: 145, Route table: 0
Flags: Sendbcast-pkt-to-re
Input Filters: filter_bgp179
Addresses, Flags: Primary
Destination: Unspecified, Local: 127.0.0.1, Broadcast: Unspecified,
Generation: 138
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
TCP negotiates a maximum segment size (MSS) value during session connection
establishment between two peers. The MSS value negotiated is primarily based on the
maximum transmission unit (MTU) of the interfaces to which the communicating peers
are directly connected. However, due to variations in link MTU on the path taken by the
TCP packets, some packets in the network that are well within the MSS value might be
fragmented when the packet size exceeds the link's MTU.
To configure the TCP MSS value, include the tcp-mss statement with a segment size
from 1 through 4096.
If the router receives a TCP packet with the SYN bit and the MSS option set, and the MSS
option specified in the packet is larger than the MSS value specified by the tcp-mss
statement, the router replaces the MSS value in the packet with the lower value specified
by the tcp-mss statement.
The configured MSS value is used as the maximum segment size for the sender. The
assumption is that the TCP MSS value used by the sender to communicate with the BGP
neighbor is the same as the TCP MSS value that the sender can accept from the BGP
neighbor. If the MSS value from the BGP neighbor is less than the MSS value configured,
the MSS value from the BGP neighbor is used as the maximum segment size for the
sender.
This feature is supported with TCP over IPv4 and TCP over IPv6.
Topology Diagram
g041159
BGP Session
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R0# set fe-1/2/0 unit 1 family inet address 1.1.0.1/30
user@R0# set lo0 unit 1 family inet address 10.255.14.179/32
5. Configure the BGP neighbors, with the TCP MSS set globally for the group or
specifically for the various neighbors.
NOTE: The TCP MSS neighbor setting overrides the group setting.
[edit routing-options]
user@R0# set autonomous-system 65000
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, and show routing-options commands. If the output does not display the
intended configuration, repeat the instructions in this example to correct the configuration.
area 0.0.0.0 {
interface fe-1/2/0.1;
interface 10.255.14.179;
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
To confirm that the configuration is working properly, run the following commands:
• monitor traffic interface, to monitor BGP traffic and to make sure that the configured
TCP MSS value is used as the MSS option in the TCP SYN packet.
Troubleshooting
Problem Consider an example in which two routing devices (R1 and R2) have an internal BGP
(IBGP) connection. On both of the routers, the connected interfaces have 4034 as the
IPv4 MTU.
In the following packet capture on Device R1, the negotiated MSS is 3994. In the show
system connections extensive information for MSS, it is set to 2048.
05:50:01.575218 Out
Juniper PCAP Flags [Ext], PCAP Extension(s) total length 16
Device Media Type Extension TLV #3, length 1, value: Ethernet (1)
Logical Interface Encapsulation Extension TLV #6, length 1, value:
Ethernet (14)
Device Interface Index Extension TLV #1, length 2, value: 137
Logical Interface Index Extension TLV #4, length 4, value: 69
-----original packet-----
00:21:59:e1:e8:03 > 00:19:e2:20:79:01, ethertype IPv4 (0x0800), length
78: (tos 0xc0, ttl 64, id 53193, offset 0, flags [DF], proto: TCP (6), length:
Solution This is expected behavior with Junos OS. The MSS value is equal to the MTU value minus
the IP or IPv6 and TCP headers. This means that the MSS value is generally 40 bytes
less than the MTU (for IPv4) and 60 bytes less than the MTU (for IPv6). This value is
negotiated between the peers. In this example, it is 4034 - 40 = 3994. Junos OS then
rounds this value to a multiple of 2 KB. The value is 3994 / 2048 * 2048=2048. So it is
not necessary to see same MSS value with in the show system connections output.
1.95 is rounded to 1.
1 * 2048 = 2048
The hijacked prefix is seen widely across the Internet as transit routers propagate the
updated path information. The invalid routes can be distributed broadly across the Internet
as the routers in the default free zone (DFZ) carry the hijacked route. Eventually the
correct AS path is restored to BGP peers, but in the meantime service interruptions are
to be expected.
Because BGP relies on a transitive trust model, validation between customer and provider
is important. In the example above, the service provider AS 1 did not validate the faulty
advertisement for 10.65.153.0/24. By accepting this advertisement and readvertising it
to its peers and providers, AS 1 was propagating the wrong route. The routers that received
this route from AS 1 selected it because it was a more specific route. The actual content
provider was advertising 10.65.152.0/22 before the mistake occurred. The /24 was a
smaller (and more specific) advertisement. According to the usual BGP route selection
process, the /24 was then chosen, effectively completing the hijack.
Even with fast detection and reaction of the content provider and cooperation with other
providers, service for their prefix can be interrupted for many minutes up to several hours.
The exact duration of the outage depends on your vantage point on the Internet. When
these sorts of events occur, there is renewed interest in solutions to this vulnerability.
BGP is fundamental to provider relationships and will not be going away anytime soon.
This example demonstrates a solution that uses origin validation. This solution relies on
cryptographic extensions to BGP and a distributed client-server model that avoids
overtaxing router CPUs.
PoP
AS 100
Site 1
Cache
Server
AS 100
Site 2
g041208
Supported Standards
The Junos OS implementation of origin validation supports the following RFCs and draft:
• RFC 6810, The Resource Public Key Infrastructure (RPKI) to Router Protocol
The RPKI and origin validation use X.509 certificates with extensions specified in RFC 3779,
X.509 Extensions for IP Addresses and AS Identifiers.
Each RPKI cache server maintains a local cache of the entire distributed repository
collection by regularly synchronizing each element in the local cache against the original
repository publication point.
On the router, the database entries are formatted as route validation (RV) records. An
RV record is a (prefix, maximum length, origin AS) triple. It matches any route whose
prefix matches the RV prefix, whose prefix length does not exceed the maximum length
given in the RV record, and whose origin AS equals the origin AS given in the RV record.
The maximum length value must be greater than or equal to the length of the authorized
prefix and less than or equal to the length (in bits) of an IP address in the address family
(32 for IPv4 and 128 for IPv6). The maximum length defines the IP address prefix that
the AS is authorized to advertise.
For example, if the IP address prefix is 200.4.66/24, and the maximum length is 26, the
AS is authorized to advertise 200.4.66.0/24, 200.4.66.0/25, 200.4.66.128/25,
200.4.66.0/26, 200.4.66.64/26, 200.4.66.128/26, and 200.4.66.192/26. When the
maximum length is not present, the AS is only authorized to advertise exactly the prefix
specified in the RV.
As another example, an RV can contain the prefix 200.4.66/24 with a maximum length
of 26, as well as the prefix 200.4.66.0/28 with a maximum length of 28. This RV would
authorize the AS to advertise any prefix beginning with 200.4.66 with a length of at least
24 and no greater than 26, as well as the specific prefix 200.4.66.0/28.
The origin of a route is represented by the right-most AS number in the AS_PATH attribute.
Origin validation operates by comparing the origin AS in a routing update with the
authorized source AS published in RV records.
The security provided by origin validation alone is known to be weak against a determined
attacker because there is no protection against such an attacker spoofing the source AS.
That said, origin validation provides useful protection against accidental announcements.
Although origin validation could be implemented by having each router directly participate
in the RPKI, this is seen as too resource intensive (because many public-key cryptography
operations are required to validate the RPKI data) as well as operationally intensive to
set up and maintain an RPKI configuration on each router. For this reason, a separate
RPKI cache server performs public-key validations, and generates a validated database
of prefix-to-AS mappings. The validated database is downloaded to a client router over
a secure TCP connection. The router thus requires little information about the RPKI
infrastructure and has no public-key cryptography requirements, other than the encrypted
transport password. The router subsequently uses the downloaded data to validate
received route updates.
When you configure server sessions, you can group the sessions together and configure
session parameters for each session in the group. The router tries periodically to set up
a configurable maximum number of connections to cache servers. If connection setup
fails, a new connection attempt is made periodically.
In the meantime, after the validation import policy is applied to the BGP session,
route-validation is performed irrespective of cache session state (up or down) and RV
database (empty or not empty). If the RV database is empty or none of the cache server
sessions are up, the validation state for each route is set to unknown, because no RV
record exists to evaluate a received BGP prefix.
Each inbound message resets a liveliness timer for the RPKI cache server. After all updates
are learned, the router performs periodic liveliness checks based on a configurable interval.
This is done by sending a serial query protocol data unit (PDU) with the same serial
number that the cache server reported in its latest notification PDU. The cache server
responds with zero or more updates and an end-of-data (EOD) PDU, which also refreshes
the liveliness state of the cache server and resets a record-lifetime timer.
When a prefix is received from an external BGP (EBGP) peer, it is examined by an import
policy and marked as Valid, Invalid, or Unknown:
• Valid—Indicates that the prefix and AS pair are found in the database.
• Invalid—Indicates that the prefix is found, but either the corresponding AS received
from the EBGP peer is not the AS that appears in the database, or the prefix length in
the BGP update message is longer than the maximum length permitted in the database.
• Unknown—Indicates that the prefix is not among the prefixes or prefix ranges in the
database.
If there are any potential matches for the route in the validation database, the route has
to match one of them to be valid. Otherwise, it is invalid. Any match is adequate to make
the route valid. It does not need to be a best match. Only if there are no potential matches
is the route considered to be unknown. For more information about the prefix-to-AS
mapping database logic, see Section 2 of Internet draft draft-ietf-sidr-pfx-validate-01,
BGP Prefix Origin Validation.
The route validation (RV) database contains a collection of RV records that the router
downloads from the RPKI cache server. After the RV database is populated with RV
records, the RV database scans the RIB-Local routing table to determine if there are any
prefixes in RIB-Local that might be affected by the RV records in the database. (RIB-Local
contains the IPv4 and IPv6 routes shown in the output of the show route protocol bgp
command.)
This process triggers a BGP reevaluation of BGP import policies (not export policies).
Event-Based
Reevaluation
of Import Policy
Remote
Distributed
RPKI
Repository
Router
RPKI
g041209
Cache
Server
Import policies are applied to RIB-In. Another way to understand this is that Import policies
are applied to the routes that are shown in the output of the show route receive-protocol
bgp command, while export policies are applied to routes that are shown by the show
route advertising-protocol bgp command.
As shown in Figure 53 on page 459, you use import routing policies to control which routes
BGP places in the routing table, and export routing policies to control which routes BGP
advertises from the routing table to its neighbors.
When you configure a route-validation import policy, the policy configuration uses a
validation-database match condition. This match condition triggers a query in the RV
database for the validation state of a prefix in a given routing instance. The default
operation is to query the validation database matching the routing instance. If no route
validation instance is found, the master instance is queried.
In the following BGP import policy, the from validation-database condition triggers a
lookup in the router’s RV database. An action is taken if the validation state is valid. The
action is to accept the route and set the validation-state in the routing table to valid.
[edit policy-options]
policy-statement validation-1 {
term valid {
from {
protocol bgp;
validation-database valid; # Triggers a lookup in the RV database
}
then {
validation-state valid; # Sets the validation state in the routing table
accept;
}
}
}
Prefix validation is done only for external BGP (EBGP) updates. Within an AS, you likely
do not want to have an RPKI session running on every internal BGP (IBGP) router. Instead,
you need a way to carry the validation state across the IBGP mesh so that all IBGP
speakers have consistent information. This is accomplished by carrying the validation
state in a non-transitive extended community. The community attribute announces and
receives the validation state of a prefix between IBGP neighbors.
Junos OS supports the following well-known extended communities for route validation:
• origin-validation-state-valid
• origin-validation-state-invalid
• origin-validation-state-unknown
The following sample BGP import policy is configured on the router that has a session
with an RPKI server.
The following sample BGP import policy is configured on an IBGP peer router that does
not have a session with an RPKI server.
When you configure origin validation on a router that has dual Routing Engines and
nonstop active routing is enabled, both the master and the standby Routing Engines have
a copy of the RV database. These two RV databases remain synchronized with each
other.
The router does not maintain two identical sessions with the RPKI server. The RPKI-RTR
protocol runs on the master Routing Engine only. On the standby Routing Engine, the
RPKI cache server session is always down.
The RV database is actively maintained by the master Routing Engine through its session
with the RPKI server. This database is replicated on the standby Routing Engine. Though
the session is down on the standby Routing Engine , the replicated RV database does
contain RV records. When the standby Routing Engine switches over and becomes the
master Routing Engine, it already has a fully populated RV database.
To view the contents of the two databases, use the show validation database and show
validation replication database commands.
The route validation model has one major shortcoming: It only provides positive updates.
It can declare which AS is the legitimate owner of a prefix. However, it cannot explicitly
convey a negative update, as in: This prefix is never originated by a given AS. This
functionality can be provided to some extent using an AS 0 workaround.
The Junos OS implementation does not attempt to restrict its inputs from the cache. For
example, an RV record with origin AS 0 is installed and matched upon just like any other.
This enables a workaround to mark a prefix range as never allowed to be announced
because AS 0 is not a valid AS. The AS in the RV record never matches the AS received
from the EBGP peer. Thus, any matching prefix is marked invalid.
Requirements
• Resource public key infrastructure (RPKI) cache server, using third-party software to
authenticate BGP prefixes.
• Junos OS Release 12.2 or later running on the routing device that communicates with
the cache server over a TCP connection.
Overview
Sometimes routes are unintentionally advertised due to operator error. To prevent this
security issue, you can configure BGP to validate the originating AS. This feature uses a
cache server to authenticate prefixes or prefix ranges.
[edit routing-options]
validation {
group group-name {
max-sessions number;
session address {
hold-time seconds;
local-address local-ip-address;
port port-number;
preference number;
record-lifetime seconds;
refresh-time seconds;
}
}
static {
record destination {
maximum-length prefix-length {
origin-autonomous-system as-number {
Most of the available configuration statements are optional. The required settings are
as follows:
validation {
group group-name {
session address {
}
}
}
The [edit routing-options validation static] hierarchy level enables you to configure static
records on a routing device, thus overwriting records received from an RPKI cache server.
For example:
You can configure a routing policy that operates based on the validation state of a route
prefix. You can use a community attribute to announce and receive the validation state
of a prefix between external BGP (EBGP) and internal BGP (IBGP) peers. Using a routing
policy might be more convenient on some routers than configuring a session with an RPKI
server. This example demonstrates the use of the validation-state community attribute
between IBGP peers.
R1 R0 R2
g041201
IBGP EBGP
AS 100 AS 100 AS 200
In this example, Device R0 has an IBGP connection to Device R1 and an EBGP connection
to Device R2. Device R0 receives route validation (RV) records from the cache server
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device R0
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
2. Configure BGP.
Apply the send-direct export policy so that direct routes are exported from the
routing table into BGP.
Apply the validation import policy to set the validation-state and BGP community
attributes for all the routes imported (or received) from Device R0’s EBGP peers.
Configure an IBGP session with Device R1. Configure an EBGP session with Device
R2.
3. Configure OSPF (or another interior gateway protocol [IGP]) on the interface that
faces the IBGP peer and on the loopback interface.
NOTE: If you use the loopback interface address in the IBGP neighbor
statement, you must enable an IGP on the loopback interface. Otherwise,
the IBGP session is not established.
4. Configure the routing policy that exports direct routes from the routing table into
BGP.
5. Configure the routing policy that specifies attributes to be modified based on the
validation state of each BGP route.
[edit policy-options]
user@R0# set community origin-validation-state-invalid members 0x43:100:2
user@R0# set community origin-validation-state-unknown members 0x43:100:1
user@R0# set community origin-validation-state-valid members 0x43:100:0
[edit routing-options]
user@R0# set autonomous-system 100
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
}
ge-1/2/2 {
unit 9 {
description to-cache;
family inet {
address 10.0.0.9/30;
}
}
}
lo0 {
unit 1 {
family inet {
address 1.0.1.1/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R1
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R1# set ge-1/2/0 unit 1 family inet address 10.0.0.1/30
2. Configure BGP.
Apply the validation-ibgp import policy to set the validation-state and BGP
community attributes for all the routes received from Device R1’s IBGP peers.
3. Configure OSPF.
4. Configure the routing policy that specifies attributes to be modified based on the
validation-state BGP community attribute of the BGP routes received from Device
R0.
[edit policy-options]
user@R1# set community origin-validation-state-invalid members 0x43:100:2
user@R1# set community origin-validation-state-unknown members 0x43:100:1
user@R1# set community origin-validation-state-valid members 0x43:100:0
[edit routing-options]
user@R1# set autonomous-system 100
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
family inet {
address 1.1.1.1/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Configuring Device R2
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
Several addresses are configured on the loopback interface to serve as routes for
demonstration purposes.
[edit interfaces]
user@R2# set ge-1/2/0 unit 6 family inet address 10.0.0.6/30
2. Configure BGP.
[edit routing-options]
user@R2# set autonomous-system 200
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
address 2.2.0.2/32;
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
• Verifying That the Modified Attributes Are Displayed in the Routing Tables on page 472
• Using Trace Operations on page 473
• Displaying Validation Information on page 474
Verifying That the Modified Attributes Are Displayed in the Routing Tables
Purpose Verify that the BGP routes on Device R0 and Device R1 have the expected validation
states and the expected local preferences.
Meaning The routes have the expected validation states and local-preference values, based on
information received from the RPKI cache server.
Purpose Configure trace operations for origin validation, and monitor the results of a newly
advertised route.
user@R0# commit
• On Device R2, add a route by adding another address on the loopback interface.
user@R2# commit
IPv4 records: 3
IPv6 records: 0
IPv4 records: 3
IPv6 records: 0
Related • Understanding BGP Communities and Extended Communities as Routing Policy Match
Documentation Conditions on page 205
• How BGP Communities and Extended Communities Are Evaluated in Routing Policy
Match Conditions
If you configure both route reflection and VPNs on the same routing device, the following
modifications to the route reflection configuration cause current BGP sessions to be
reset:
• Adding a cluster ID—If a BGP session shares the same autonomous system (AS) number
with the group where you add the cluster ID, all BGP sessions are reset regardless of
whether the BGP sessions are contained in the same group.
• Creating a new route reflector—If you have an internal BGP (IBGP) group with an AS
number and create a new route reflector group with the same AS number, all BGP
sessions in the IBGP group and the new route reflector group are reset.
• Changing configuration statements that affect BGP peers, such as renaming a BGP
group, resets the BGP sessions.
• If you change the address family specified in the [edit protocols bgp family] hierarchy
level, all current BGP sessions on the routing device are dropped and then reestablished.
Example: Preventing BGP Session Flaps When VPN Families Are Configured
This example shows a workaround for a known issue in which BGP sessions sometimes
go down and then come back up (in other words, flap) when virtual private network
(VPN) families are configured. If any VPN family (for example, inet-vpn, inet6-vpn,
inet-mpvn, inet-mdt, inet6-mpvn, l2vpn, iso-vpn, and so on) is configured on a BGP master
instance, a flap of either a route reflector (RR) internal BGP (IBGP) session or an external
BGP (EBGP) session causes flaps of other BGP sessions configured with the same VPN
family.
Requirements
• Configure BGP.
• Configure VPNs.
Overview
The reason for the flapping behavior is related to BGP operation in Junos OS when
originating VPN routes.
BGP has the following two modes of operation with respect to originating VPN routes:
• If BGP does not need to propagate VPN routes because the session has no EBGP peer
and no RR clients, BGP exports VPN routes directly from the instance.inet.0 routing
table to other PE routers. This behavior is efficient in that it avoids the creation of two
copies of many routes (one in the instance.inet.0 table and one in the bgp.l3vpn.0
table).
• If BGP does need to propagate VPN routes because the session has an EBGP peer or
RR clients, BGP first exports the VPN routes from the instance.inet.0 table to the
bgp.l3vpn.0 table. Then BGP exports the routes to other PE routers. In this scenario,
two copies of the route are needed to enable best-route selection. A PE router might
receive the same VPN route from a CE device and also from an RR client or EBGP peer.
When, because of a configuration change, BGP transitions from needing two copies of
a route to not needing two copies of a route (or the reverse), all sessions over which VPN
routes are exchanged go down and then come back up. Although this example focuses
on the family inet-vpn unicast statement, the concept applies to all VPN network layer
reachability information (NLRI) families. This issue impacts logical systems as well. All
BGP sessions in the master instance related to the VPN NLRI family are brought down
to implement the table advertisement change for the VPN NLRI family. Changing an RR
to a non-RR or the reverse (by adding or removing the cluster statement) causes the
table advertisement change. Also, configuring the first EBGP session or removing the
EBGP session from the configuration in the master instance for a VPN NLRI family causes
the table advertisement change.
The way to prevent these unnecessary session flaps is to configure an extra RR client or
EBGP session as a passive session with a neighbor address that does not exist. This
example focuses on the EBGP case, but the same workaround works for the RR case.
When a session is passive, the routing device does not send Open requests to a peer.
Once you configure the routing device to be passive, the routing device does not originate
the TCP connection. However, when the routing device receives a connection from the
peer and an Open message, it replies with another BGP Open message. Each routing
device declares its own capabilities.
Figure 55 on page 480 shows the topology for the EBGP case. Router R1 has an IBGP
session with Routers R2 and R3 and an EBGP session with Router R4. All sessions have
the family inet-vpn unicast statement configured. If the R1-R4 EBGP session flaps, the
R1-R2 and R1-R3 BGP sessions flap also.
IBGP
R3
IBGP
R1 R2
EBGP
g040893
R4
Figure 56 on page 480 shows the topology for the RR case. Router R1 is the RR, and
Router R3 is the client. Router R1 has IBGP sessions with Routers R2 and R3. All sessions
have the family inet-vpn unicast statement configured. If the R1-R3 session flaps, the
R1-R2 and R1-R4 sessions flap also.
R3
Route Reflector
Client
IBGP
R1 R2
Route Reflector
IBGP
g040894
R4
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
3. Run the show bgp summary command to view the session flaps.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
1. Add a passive EBGP session with a neighbor address that does not exist in the peer
autonomous system (AS).
2. Run the show bgp summary command to verify that the real sessions have been
established and the passive session is idle.
Verification
Purpose Try to cause the flap issue after the workaround is configured.
Purpose Make sure that the IBGP sessions do not flap after the EBGP session is deactivated.
Flap damping reduces the number of update messages by marking routes as ineligible
for selection as the active or preferable route. Marking routes in this way leads to some
delay, or suppression, in the propagation of route information, but the result is increased
network stability. You typically apply flap damping to external BGP (EBGP) routes (routes
in different ASs). You can also apply flap damping within a confederation, between
confederation member ASs. Because routing consistency within an AS is important, do
not apply flap damping to internal BGP (IBGP) routes. (If you do, it is ignored.) The
exception to this rule is when flap damping is applied at the address family level, which
is supported in Junos OS Release 12.2 and later. When you apply flap damping at the
address family level, it works for both IBGP and EBGP.
By default, route flap damping is not enabled. Damping is applied to external peers and
to peers at confederation boundaries.
max-suppress minutes Maximum hold-down time for a route, in minutes. 60 (minutes) 1 through 720
To change the default BGP flap damping values, you define actions by creating a named
set of damping parameters and including it in a routing policy with the damping action.
For the damping routing policy to work, you also must enable BGP route flap damping.
Requirements
Before you begin, configure router interfaces and configure routing protocols.
Overview
This example has three routing devices. Device R2 has external BGP (EBGP) connections
with Device R1 and Device R3.
Device R1 and Device R3 have some static routes configured for testing purposes, and
these static routes are advertised through BGP to Device R2.
Device R2 damps routes received from Device R1 and Device R3 according to these criteria:
• Damp all prefixes with a mask length equal to or greater than 17 more aggressively
than routes with a mask length between 9 and 16.
• Damp routes with a mask length between 0 and 8, inclusive, less than routes with a
mask length greater than 8.
The routing policy is evaluated when routes are being exported from the routing table
into the forwarding table. Only the active routes are exported from the routing table.
“CLI Quick Configuration” on page 486 shows the configuration for all of the devices in
Figure 57 on page 486.
The section “Step-by-Step Procedure” on page 487 describes the steps on Device R2.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R2# set fe-1/2/0 unit 0 family inet address 10.0.0.2/30
[edit policy-options]
user@R2# set damping aggressive half-life 30
user@R2# set damping aggressive suppress 2500
user@R2# set damping timid half-life 5
user@R2# set damping dry disable
NOTE: You can refer to the same routing policy one or more times in
the same or different import statements.
[edit routing-options]
user@R2# set autonomous-system 200
Results From configuration mode, confirm your configuration by issuing the show interfaces, show
protocols, show policy-options, and show routing-options commands. If the output does
not display the intended configuration, repeat the instructions in this example to correct
the configuration.
}
}
fe-1/2/1 {
unit 0 {
family inet {
address 10.1.0.1/30;
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.2/32;
}
}
}
disable;
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Purpose To verify your route flap damping policy, some routes must flap. Having a live Internet
feed almost guarantees that a certain number of route flaps will be present. If you have
control over a remote system that is advertising the routes, you can modify the advertising
router's policy to effect the advertisement and withdrawal of all routes or of a given
prefix. In a test environment, you can cause routes to flap by clearing the BGP neighbors
or by restarting the routing process on the BGP neighbors, as shown here.
Action From operational mode on Device R1 and Device R3, enter the restart routing command.
Meaning On Device R2, all of the routes from the neighbors are withdrawn and re-advertised.
Action From operational mode, enter the show bgp summary command.
Meaning This output was captured after the routing process was restarted on Device R2’s neighbors
four times.
Action From operational mode, enter the show route damping suppressed command.
Meaning The output shows some routing instability. Eleven routes are hidden due to damping.
Action From operational mode, enter the show route damping suppressed 172.16.192.0/20 detail
command.
Meaning This output indicates that the displayed route has a mask length that is equal to or greater
than /17, and confirms that it has been correctly mapped to the aggressive damping
profile. You can also see the route’s current (and last) figure of merit value, and when
the route is expected to become active if it remains stable.
Purpose Locating a damped route with a /16 mask confirms that the default parameters are in
effect.
Action From operational mode, enter the show route damping suppressed detail | match 0/16
command.
Meaning Routes with a /16 mask are not impacted by the custom damping rules. Therefore, the
default damping rules are in effect.
• Damp all prefixes with a mask length equal to or greater than 17 more aggressively
than routes with a mask length between 9 and 16.
• Damp routes with a mask length between 0 and 8, inclusive, less than routes with a
mask length greater than 8.
Purpose Use OR groupings or cascaded piping to simplify the determination of what damping
profile is being used for routes with a given mask length.
Action From operational mode, enter the show route damping suppressed command.
user@R2> show route damping suppressed detail | match "0 announced | damp"
Meaning When you are satisfied that your EBGP routes are correctly associated with a damping
profile, you can issue the clear bgp damping operational mode command to restore an
active status to your damped routes, which will return your connectivity to normal
operation.
Example: Configuring BGP Route Flap Damping Based on the MBGP MVPN Address Family
This example shows how to configure an multiprotocol BGP multicast VPN (also called
Next-Generation MVPN) with BGP route flap damping.
Requirements
This example uses Junos OS Release 12.2. BGP route flap damping support for MBGP
MVPN, specifically, and on an address family basis, in general, is introduced in Junos OS
Release 12.2.
Overview
BGP route flap damping helps to diminish route instability caused by routes being
repeatedly withdrawn and readvertised when a link is intermittently failing.
This example uses the default damping parameters and demonstrates an MBGP MVPN
scenario with three provider edge (PE) routing devices, three customer edge (CE) routing
devices, and one provider (P) routing device.
On PE Device R4, BGP route flap damping is configured for address family inet-mvpn. A
routing policy called dampPolicy uses the nlri-route-type match condition to damp only
MVPN route types 3, 4, and 5. All other MVPN route types are not damped.
This example shows the full configuration on all devices in the “CLI Quick Configuration”
on page 495 section. The “Configuring Device R4” on page 498 section shows the
step-by-step configuration for PE Device R4.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device R4
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R4# set ge-1/2/0 unit 10 family inet address 10.1.1.10/30
user@R4# set ge-1/2/0 unit 10 family mpls
[edit protocols]
user@R4# set mpls interface all
user@R4# set mpls interface ge-1/2/0.10
user@R4# set rsvp interface all aggregate
user@R4# set ldp interface ge-1/2/0.10
user@R4# set ldp p2mp
3. Configure BGP.
The BGP configuration enables BGP route flap damping for the inet-mvpn address
family. The BGP configuration also imports into the routing table the routing policy
called dampPolicy. This policy is applied to neighbor PE Device R2.
5. Configure a damping policy that uses the nlri-route-type match condition to damp
only MVPN route types 3, 4, and 5.
The no-damp policy (damping no-damp disable) causes any damping state that is
present in the routing table to be deleted. The then damping no-damp statement
applies the no-damp policy as an action and has no from match conditions.
Therefore, all routes that are not matched by term1 are matched by this term, with
the result that all other MVPN route types are not damped.
[edit policy-options]
user@R4# set damping no-damp disable
7. Configure the parent_vpn_routes to accept all other BGP routes that are not from
the inet-mvpn address family.
[edit routing-options]
user@R4# set router-id 1.1.1.4
user@R4# set autonomous-system 1001
10. If you are done configuring the device, commit the configuration.
user@R4# commit
Results
From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, show routing-instances, and show routing-options
commands. If the output does not display the intended configuration, repeat the
instructions in this example to correct the configuration.
}
}
vt-1/2/0 {
unit 4 {
family inet;
}
}
lo0 {
unit 4 {
family inet {
address 1.1.1.4/32;
}
}
unit 104 {
family inet {
address 100.1.1.4/32;
}
}
}
interface ge-1/2/0.10;
}
}
ldp {
interface ge-1/2/0.10;
p2mp;
}
}
mvpn;
}
}
Verification
Purpose Verify the presence of the no-damp policy, which disables damping for MVPN route types
other than 3, 4, and 5.
Action From operational mode, enter the show policy damping command.
Meaning The output shows that the default damping parameters are in effect and that the no-damp
policy is also in effect for the specified route types.
Action From operational mode, enter the show bgp summary command.
bgp.l3vpn.2: 0/0/0/0
bgp.mvpn.0: 1/1/1/0
vpn-1.inet.0: 3/3/3/0
vpn-1.mvpn.0: 1/1/1/0
1.1.1.5 1001 3157 3154 0 0 23:43:40
Establ
bgp.l3vpn.0: 3/3/3/0
bgp.l3vpn.2: 0/0/0/0
bgp.mvpn.0: 1/1/1/0
vpn-1.inet.0: 3/3/3/0
vpn-1.mvpn.0: 1/1/1/0
Meaning The Damp State field shows that zero routes in the bgp.mvpn.0 routing table have been
damped. Further down, the last number in the State field shows that zero routes have
been damped for BGP peer 1.1.1.2.
To configure error handling for BGP update messages, configure the bgp-error-tolerance
statement at the [edit protocols bgp], [edit protocols bgp group group-name], or [edit
protocols bgp group group-name neighbor address] hierarchy level.
bgp-error-tolerance {
malformed-route-limit number;
malformed-update-log-interval seconds;
no-malformed-route-limit;
}
If an attribute contains attribute flags that conflict with the value of the Attribute Type
field, the attribute flags are reset to the correct value and the update message is
processed. The value of the Extended Length bit in the attribute flags is unchanged
because this value defines whether the attribute length is one or two octets. Hence, the
value of the attribute flag affects how the BGP update packet is parsed.
NOTE: There is no explicit specification for the attribute flag value for the
path attributes.
Malformed update messages are treated on a case by case basis, depending on the
values of the attributes contained in the messages. There are three ways of handling
malformed BGP update messages, listed in the decreasing order of severity.
• The BGP update message contains the MP reach attribute or the MP unreach
attribute.
• The NLRI field or the BGP update message cannot be parsed correctly because of
a mismatch between the attribute length and the value of the attribute length field.
The BGP update messages are scanned for the following attributes and are treated as
malformed based on the values of these attributes:
Junos OS does not change the value of the extended length bit in the attribute flags.
This bit defines whether the attribute length is one octet or two octets. The value of
this flag affects how the BGP packet is parsed. There is no explicit specification of this
value for the path attributes.
• Unknown attribute—If the BGP flag does not indicate that this is an optional attribute,
this malformed attribute is handled by the notification message approach.
Requirements
• Configure BGP.
Overview
When a routing device receives an update message with a malformed attribute, the router
is required to reset the session. This is specified in RFC 4271, A Border Gateway Protocol
4 (BGP-4). Session resets impact not only routes with the offending attribute, but also
other valid routes exchanged over the session. Moreover, this behavior can present a
potential security vulnerability in the case of optional transitive attributes. To minimize
the impact on routing made by malformed update messages, the Internet draft
draft-ietf-idr-error-handling-01.txt, Revised Error Handling for BGP UPDATE Messages
specifies modifications for handling BGP update message with malformed attributes.
The new error handling allows for maintaining the established session and keeping the
valid routes exchanged, while removing the routes carried in the malformed UPDATE
message.
In Figure 59 on page 507, Device R1 has an internal BGP peering session with Device R0,
and an external BGP peering session with Device R2.
lo0:
R0 192.168.0.3
g041430
R1 192.168.0.1
R2 192.168.0.2
bgp-error-tolerance {
malformed-update-log-interval 10;
malformed-route-limit 5;
}
By default, a BGP message is considered to be malformed when any one of the message
attributes is malformed. When a router participating in a BGP session receives a
malformed update message, the entire session is reset. The bgp-error-tolerance statement
overrides this behavior so that the following BGP error handling is in effect:
• For fatal errors, Junos OS sends a notification message titled Error Code Update
Message and resets the BGP session. An error in the MP_{UN}REACH attribute is
considered to be fatal. The presence of multiple MP_{UN}REACH attributes in one
BGP update is also considered to be a fatal error. Junos OS resets the BGP session if
it cannot parse the NLRI field or the BGP update correctly. Failure to parse the BGP
update packet can happen when the attribute length does not match the length of
the attribute value.
• For some nonfatal errors, Junos OS treats all the routes contained in the malformed
BGP update message as withdrawn routes and installs them as hidden, unless the
keep none statement is included in the BGP is configuration. Junos OS uses this error
handling approach for the cases that involve any of the following attributes: ORIGIN,
AS_PATH, NEXT_HOP, MULTI_EXIT_DISC, LOCAL_PREF, ORIGINATOR, CLUSTER,
• For other nonfatal errors, Junos OS discards the malformed path attributes and
continues to process the BGP update message. It is unsafe to use this approach on
the path attributes that might affect route selection or installation. Junos OS uses this
error handling approach for the cases that involve any of the following attributes:
ATOMIC_AGGREGATE, AGGREGATOR, AGGREGATOR4, and AS4PATH.
To facilitate troubleshooting of malformed packets, Junos OS logs the error listing the
malformed path attribute code, flag, length, information about the peer and family, and
the first prefix from the malformed BGP update. Logging of the malformed packets might
slow Junos OS performance if a significant number of malformed packets is received in
a short time. To limit the performance impact, Junos OS implements an algorithm to log
a malformed update, suppress logging for an interval, and log a summary. When the
logging suppression timer expires, the software logs the total number of malformed
attributes received during the interval. In this example, the timer is set to 10 seconds,
using the malformed-update-log-interval statement. The default value is 300 seconds(5
minutes).
“CLI Quick Configuration” on page 508 shows the configuration for all of the devices in
Figure 59 on page 507.
The section “Step-by-Step Procedure” on page 509 describes the steps on Device R1.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit interfaces]
user@R1# set fe-1/2/1 unit 0 description to-R2
user@R1# set fe-1/2/1 unit 0 family inet address 10.10.10.1/30
[edit routing-options]
user@R1# set autonomous-system 64510
user@R1# set router-id 192.168.0.1
Results From configuration mode, confirm your configuration by entering the show interfaces,
show protocols, show policy-options, and show routing-options, commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
}
fe-1/2/1 {
unit 0 {
description to-R2;
family inet {
address 10.10.10.1/30;
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.1/32;
}
}
}
If you are done configuring the devices, enter commit from configuration mode.
Verification
Purpose Verify that BGP error tolerance is enabled, and display the counters related to malformed
path attributes.
Meaning The Malformed attributes field shows that error tolerance is enabled. The log interval
and route limit fields display the configured values.
The attribute counters show that on the EBGP connection, several malformed attributes
were received from Device R2.
Purpose View information about hidden routes and learn why they are hidden.
Meaning The malformed hidden routes are marked with MalformedAttr in the AS path field.
You can remove the hidden routes by running the clear bgp neighbor 10.10.10.2
malformed-route command.
Purpose View information about hidden routes and learn why they are hidden.
Meaning Junos OS displays MalformedAttr in the AS path field in the output of the show route
receive-protocol bgp 10.10.10.2 detail hidden command.
You can remove the hidden routes by running the clear bgp neighbor 10.10.10.2
malformed-route command.
To enable MP-BGP, you configure BGP to carry network layer reachability information
(NLRI) for address families other than unicast IPv4 by including the family inet statement:
family inet {
(any | flow | labeled-unicast | multicast | unicast) {
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
<loops number>;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
rib-group group-name;
topology name {
community {
target identifier;
}
}
}
}
To enable MP-BGP to carry NLRI for the IPv6 address family, include the family inet6
statement:
family inet6 {
(any | labeled-unicast | multicast | unicast) {
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
<loops number>;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
rib-group group-name;
}
}
On routers only, to enable MP-BGP to carry Layer 3 virtual private network (VPN) NLRI
for the IPv4 address family, include the family inet-vpn statement:
family inet-vpn {
(any | flow | multicast | unicast) {
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
<loops number>;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
rib-group group-name;
}
}
On routers only, to enable MP-BGP to carry Layer 3 VPN NLRI for the IPv6 address family,
include the family inet6-vpn statement:
family inet6-vpn {
(any | multicast | unicast) {
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
<loops number>;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
rib-group group-name;
}
}
On routers only, to enable MP-BGP to carry multicast VPN NLRI for the IPv4 address
family and to enable VPN signaling, include the family inet-mvpn statement:
family inet-mvpn {
signaling {
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
<loops number>;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
}
}
To enable MP-BGP to carry multicast VPN NLRI for the IPv6 address family and to enable
VPN signaling, include the family inet6-mvpn statement:
family inet6-mvpn {
signaling {
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
<loops number>;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout <forever | minutes>;
}
}
}
For more information about multiprotocol BGP-based multicast VPNs, see the Multicast
Protocols Feature Guide for Routing Devices.
For a list of hierarchy levels at which you can include these statements, see the statement
summary sections for these statements.
NOTE: If you change the address family specified in the [edit protocols bgp
family] hierarchy level, all current BGP sessions on the routing device are
dropped and then reestablished.
In Junos OS Release 9.6 and later, you can specify a loops value for a specific BGP address
family.
By default, BGP peers carry only unicast routes used for unicast forwarding purposes. To
configure BGP peers to carry only multicast routes, specify the multicast option. To
configure BGP peers to carry both unicast and multicast routes, specify the any option.
When MP-BGP is configured, BGP installs the MP-BGP routes into different routing tables.
Each routing table is identified by the protocol family or address family indicator (AFI)
and a subsequent address family identifier (SAFI).
The following list shows all possible AFI and SAFI combinations:
Routes installed in the inet.2 routing table can only be exported to MP-BGP peers because
they use the SAFI, identifying them as routes to multicast sources. Routes installed in
the inet.0 routing table can only be exported to standard BGP peers.
The inet.2 routing table should be a subset of the routes that you have in inet.0, since it
is unlikely that you would have a route to a multicast source to which you could not send
unicast traffic. The inet.2 routing table stores the unicast routes that are used for multicast
reverse-path-forwarding checks and the additional reachability information learned by
MP-BGP from the NLRI multicast updates. An inet.2 routing table is automatically created
when you configure MP-BGP (by setting NLRI to any).
• Limiting the Number of Prefixes Received on a BGP Peer Session on page 521
• Limiting the Number of Prefixes Accepted on a BGP Peer Session on page 521
• Configuring BGP Routing Table Groups on page 522
• Resolving Routes to PE Routing Devices Located in Other ASs on page 522
• Allowing Labeled and Unlabeled Routes on page 523
You can limit the number of prefixes received on a BGP peer session, and log rate-limited
messages when the number of injected prefixes exceeds a set limit. You can also tear
down the peering when the number of prefixes exceeds the limit.
To configure a limit to the number of prefixes that can be received on a BGP session,
include the prefix-limit statement:
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
For maximum number, specify a value in the range from 1 through 4,294,967,295. When
the specified maximum number of prefixes is exceeded, a system log message is sent.
If you include the teardown statement, the session is torn down when the maximum
number of prefixes is exceeded. If you specify a percentage, messages are logged when
the number of prefixes exceeds that percentage of the specified maximum limit. After
the session is torn down, it is reestablished in a short time (unless you include the
idle-timeout statement). If you include the idle-timeout statement, the session can be
kept down for a specified amount of time, or forever. If you specify forever, the session
is reestablished only after the you issue a clear bgp neighbor command.
NOTE: In Junos OS Release 9.2 and later, you can alternatively configure a
limit to the number of prefixes that can be accepted on a BGP peer session.
For more information, see “Understanding Multiprotocol BGP” on page 517.
In Junos OS Release 9.2 and later, you can limit the number of prefixes that can be
accepted on a BGP peer session. When that specified limit is exceeded, a system log
message is sent. You can also specify to reset the BGP session if the limit to the number
of specified prefixes is exceeded.
To configure a limit to the number of prefixes that can be accepted on a BGP peer session,
include the accepted-prefix-limit statement:
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
For maximum number, specify a value in the range from 1 through 4,294,967,295.
Include the teardown statement to reset the BGP peer session when the number of
accepted prefixes exceeds the configured limit. You can also include a percentage value
from 1 through 100 to have a system log message sent when the number of accepted
prefixes exceeds that percentage of the maximum limit. By default, a BGP session that
is reset is reestablished within a short time. Include the idle-timeout statement to prevent
the BGP session from being reestablished for a specified period of time. You can configure
a timeout value from 1 through 2400 minutes. Include the forever option to prevent the
BGP session from being reestablished until you issue the clear bgp neighbor command.
NOTE: Alternatively, you can configure a limit to the number of prefixes that
can be received (as opposed to accepted) on a BGP peer session. For more
information, see “Limiting the Number of Prefixes Received on a BGP Peer
Session” on page 521.
When a BGP session receives a unicast or multicast NLRI, it installs the route in the
appropriate table (inet.0 or inet6.0 for unicast, and inet.2 or inet6.2 for multicast). To
add unicast prefixes to both the unicast and multicast tables, you can configure BGP
routing table groups. This is useful if you cannot perform multicast NLRI negotiation.
rib-group group-name;
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
You can allow labeled routes to be placed in the inet.3 routing table for route resolution.
These routes are then resolved for provider edge (PE) routing device connections where
the remote PE is located across another autonomous system (AS). For a PE routing
device to install a route in the VPN routing and forwarding (VRF) routing instance, the
next hop must resolve to a route stored within the inet.3 table.
To resolve routes into the inet.3 routing table, include the resolve-vpn statement:
resolve-vpn group-name;
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
You can allow both labeled and unlabeled routes to be exchanged in a single session.
The labeled routes are placed in the inet.3 or inet6.3 routing table, and both labeled and
unlabeled unicast routes can be sent to or received by the routing device.
To allow both labeled and unlabeled routes to be exchanged, include the rib statement:
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
Requirements
No special configuration beyond device initialization is required before you configure this
example.
Overview
• BGP derives next-hop prefixes using the IPv4-compatible IPv6 prefix. For example, the
IPv4 next-hop prefix 10.19.1.1 translates to the IPv6 next-hop prefix ::ffff:10.19.1.1.
• An IPv6 connection must be configured over the link. The connection must be either
an IPv6 tunnel or a dual-stack configuration. Dual stacking is used in this example.
• When configuring IPv4-compatible IPv6 prefixes, use a mask that is longer than 96 bits.
• Configure a static route if you want to use normal IPv6 prefixes. This example uses
static routes.
Figure 60: Topology for Configuring IPv6 BGP Routes over IPv4 Transport
R1 R2 R3
g041158
AS 100 AS 200 AS 300
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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 Device R1
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
1. Configure the interfaces, including both an IPv4 address and an IPv6 address.
[edit interfaces]
user@R1# set fe-1/2/0 unit 1 family inet address 192.168.10.1/24
user@R1# set fe-1/2/0 unit 1 family inet6 address ::ffff:192.168.10.1/120
user@R1# set lo0 unit 1 family inet address 10.10.10.1/32
2. Configure EBGP.
IPv4 unicast routes are enabled by default. The configuration is shown here for
completeness.
[edit policy-options]
user@R1# set policy-statement send-direct term 1 from protocol direct
user@R1# set policy-statement send-direct term 1 then accept
user@R1# set policy-statement send-static term 1 from protocol static
[edit routing-options]
user@R1# set rib inet6.0 static route ::ffff:192.168.20.0/120 next-hop
::ffff:192.168.10.10
user@R1# set static route 192.168.20.0/24 next-hop 192.168.10.10
[edit routing-options]
user@R1# set autonomous-system 100
Results From configuration mode, confirm your configuration by entering the show interfaces,
show policy-options, show protocols, and show routing-options commands. If the output
does not display the intended configuration, repeat the instructions in this example to
correct the configuration.
unicast;
}
family inet6 {
unicast;
}
export [ send-direct send-static ];
peer-as 200;
neighbor 192.168.10.10;
}
}
If you are done configuring the device, enter commit from configuration mode. Repeat
the configuration on Device R2 and Device R3, changing the interface names and IP
addresses, as needed.
Verification
Purpose Make sure that BGP is enabled to carry IPv6 unicast routes.
Action From operational mode, enter the show bgp neighbor command.
Meaning The various occurrences of inet6-unicast in the output shows that BGP is enabled to
carry IPv6 unicast routes.
Purpose Make sure that Device R2 has BGP routes in its inet6.0 routing table.
Action From operational mode, enter the show route protocol bgp inet6.0 command.
family {
l2vpn {
signaling {
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
}
}
}
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
When you set the maximum number of prefixes, a message is logged when that number
is reached. If you include the teardown statement, the session is torn down when the
maximum number of prefixes is reached. If you specify a percentage, messages are logged
when the number of prefixes reaches that percentage. Once the session is torn down, it
is reestablished in a short time. Include the idle-timeout statement to keep the session
down for a specified amount of time, or forever. If you specify forever, the session is
reestablished only after you use the clear bgp neighbor command.
Flow routes and firewall filters are similar in that they filter packets based on their
components and perform an action on the packets that match. Flow routes provide
traffic filtering and rate-limiting capabilities much like firewall filters. In addition, you can
propagate flow routes across different autonomous systems.
Flow routes are propagated by BGP through flow-specification NLRI messages. You must
enable BGP to propagate these NLRIs.
You specify conditions that the packet must match before the action in the then statement
is taken for a flow route. All conditions in the from statement must match for the action
to be taken. The order in which you specify match conditions is not important, because
a packet must match all the conditions in a term for a match to occur.
To configure a match condition, include the match statement at the [edit routing-options
flow] hierarchy level.
destination-port TCP or User Datagram Protocol (UDP) destination port field. You cannot specify both the port and
number destination-port match conditions in the same term.
In place of the numeric value, you can specify one of the following text synonyms (the port numbers
are also listed): afs (1483), bgp (179), biff (512), bootpc (68), bootps (67), cmd (514), cvspserver (2401),
dhcp (67), domain (53), eklogin (2105), ekshell (2106), exec (512), finger (79), ftp (21), ftp-data (20),
http (80), https (443), ident (113), imap (143), kerberos-sec (88), klogin (543), kpasswd (761),
krb-prop (754), krbupdate (760), kshell (544), ldap (389), login (513), mobileip-agent (434),
mobilip-mn (435), msdp (639), netbios-dgm (138), netbios-ns (137), netbios-ssn (139), nfsd (2049),
nntp (119), ntalk (518), ntp (123), pop3 (110), pptp (1723), printer (515), radacct (1813), radius (1812),
rip (520), rkinit (2108), smtp (25), snmp (161), snmptrap (162), snpp (444), socks (1080), ssh (22),
sunrpc (111), syslog (514), tacacs-ds (65), talk (517), telnet (23), tftp (69), timed (525), who (513),
xdmcp (177), zephyr-clt (2103), or zephyr-hm (2104).
dscp number Differentiated Services code point (DSCP). The DiffServ protocol uses the type-of-service (ToS) byte
in the IP header. The most significant six bits of this byte form the DSCP.
fragment type Fragment type field. The keywords are grouped by the fragment type with which they are associated:
• dont-fragment
• first-fragment
• is-fragment
• last-fragment
• not-a-fragment
icmp-code number ICMP code field. This value or keyword provides more specific information than icmp-type. Because
the value’s meaning depends upon the associated icmp-type value, you must specify icmp-type along
with icmp-code.
In place of the numeric value, you can specify one of the following text synonyms (the field values are
also listed). The keywords are grouped by the ICMP type with which they are associated:
icmp-type number ICMP packet type field. Normally, you specify this match in conjunction with the protocol match
statement to determine which protocol is being used on the port.
In place of the numeric value, you can specify one of the following text synonyms (the field values are
also listed): echo-reply (0), echo-request (8), info-reply (16), info-request (15), mask-request (17),
mask-reply (18), parameter-problem (12), redirect (5), router-advertisement (9), router-solicit (10),
source-quench (4), time-exceeded (11), timestamp (13), timestamp-reply (14), or unreachable (3).
port number TCP or UDP source or destination port field. You cannot specify both the port match and either the
destination-port or source-port match condition in the same term.
In place of the numeric value, you can specify one of the text synonyms listed under destination-port.
protocol number IP protocol field. In place of the numeric value, you can specify one of the following text synonyms (the
field values are also listed): ah, egp (8), esp (50), gre (47), icmp (1), igmp (2), ipip (4), ipv6 (41), ospf (89),
pim (103), rsvp (46), tcp (6), or udp (17).
source-port number TCP or UDP source port field. You cannot specify the port and source-port match conditions in the
same term.
In place of the numeric field, you can specify one of the text synonyms listed under destination-port.
You can specify the action to take if the packet matches the conditions you have
configured in the flow route. To configure an action, include the then statement at the
[edit routing-options flow] hierarchy level.
Actions
accept Accept a packet. This is the default.
discard Discard a packet silently, without sending an Internet Control Message Protocol (ICMP) message.
community Replace any communities in the route with the specified communities.
rate-limit bytes-per-second Limit the bandwidth on the flow route. Express the limit in bytes per second (Bps).
The Junos OS installs flow routes into the flow routing table only if they have been
validated using the validation procedure. The Routing Engine does the validation before
the installing routes into the flow routing table.
Flow routes received using the BGP network layer reachability information (NLRI)
messages are validated before they are installed into the flow primary instance routing
table instance.inetflow.0. The validation procedure is described in the
draft-ietf-idr-flow-spec-09.txt, Dissemination of Flow Specification Rules. You can bypass
the validation process for flow routes using BGP NLRI messages and use your own specific
import policy.
To trace validation operations, include the validation statement at the [edit routing-options
flow] hierarchy level.
By default, the Junos OS uses the term-ordering algorithm defined in version 6 of the
BGP flow specification draft. In Junos OS Release 10.0 and later, you can configure the
router to comply with the term-ordering algorithm first defined in version 7 of the BGP
flow specification and supported through RFC 5575, Dissemination of Flow Specification
Routes.
BEST PRACTICE: We recommend that you configure the Junos OS to use the
term-ordering algorithm first defined in version 7 of the BGP flow specification
draft. We also recommend that you configure the Junos OS to use the same
term-ordering algorithm on all routing instances configured on a router.
To configure BGP to use the flow-specification algorithm first defined in version 7 of the
Internet draft, include the standard statement at the [edit routing-options flow term-order]
hierarchy level.
To revert to using the term-ordering algorithm defined in version 6, include the legacy
statement at the [edit routing-options flow term-order] hierarchy level.
NOTE: The configured term order has only local significance. That is, the
term order does not propagate with flow routes sent to the remote BGP peers,
whose term order is completely determined by their own term order
configuration. Therefore, you should be careful when configuring the
order-dependent action next term when you are not aware of the term order
configuration of the remote peers. The local next term might differ from the
next term configured on the remote peer.
Requirements
• Configure BGP.
• Configure a routing policy that exports routes (such as direct routes or IGP routes)
from the routing table into BGP.
Overview
Propagating firewall filter information as part of BGP enables you to propagate firewall
filters against denial-of-service (DOS) attacks dynamically across autonomous systems.
Flow routes are encapsulated into the flow-specification NLRI and propagated through
a network or virtual private networks (VPNs), sharing filter-like information. Flow routes
are an aggregation of match conditions and resulting actions for packets. They provide
you with traffic filtering and rate-limiting capabilities much like firewall filters. Unicast
flow routes are supported for the default instance, VPN routing and forwarding (VRF)
instances, and virtual-router instances.
Import and export policies can be applied to the family inet flow or family inet-vpn flow
NLRI, affecting the flow routes accepted or advertised, similar to the way import and
export policies are applied to other BGP families. The only difference is that the flow
policy configuration must include the from rib inetflow.0 statement. This statement
causes the policy to be applied to the flow routes. An exception to this rule occurs if the
policy has only the then reject or the then accept statement and no from statement. Then,
the policy affects all routes, including IP unicast and IP flow.
The flow route filters are first configured on a router statically, with a set of matching
criteria followed by the actions to be taken. Then, in addition to family inet unicast, family
inet flow (or family inet-vpn flow) is configured between this BGP-enabled device and
its peers.
By default, statically configured flow routes (firewall filters) are advertised to other
BGP-enabled devices that support the family inet flow or family inet-vpn flow NLRI.
The receiving BGP-enabled device performs a validation process before installing the
firewall filter into the flow routing table instance-name.inetflow.0. The validation procedure
is described in Internet draft draft-ietf-idr-flow-spec-09.txt, Dissemination of Flow
Specification Rules.
The receiving BGP-enabled device accepts a flow route if it passes the following criteria:
• The originator of a flow route matches the originator of the best match unicast route
for the destination address that is embedded in the route.
• There are no more specific unicast routes, when compared to the destination address
of the flow route, for which the active route has been received from a different next-hop
autonomous system.
The first criterion ensures that the filter is being advertised by the next-hop used by
unicast forwarding for the destination address embedded in the flow route. For example,
if a flow route is given as 10.1.1.1, proto=6, port=80, the receiving BGP-enabled device
selects the more specific unicast route in the unicast routing table that matches the
destination prefix 10.1.1.1/32. On a unicast routing table containing 10.1/16 and 10.1.1/24,
the latter is chosen as the unicast route to compare against. Only the active unicast route
entry is considered. This follows the concept that a flow route is valid if advertised by
the originator of the best unicast route.
The second criterion addresses situations in which a given address block is allocated to
different entities. Flows that resolve to a best-match unicast route that is an aggregate
route are only accepted if they do not cover more specific routes that are being routed
to different next-hop autonomous systems.
You can bypass the validation process and use your own specific import policy. To disable
the validation procedure and use an import policy instead, include the no-validate
statement at the [edit protocols bgp group group-name family inet flow] hierarchy level.
The import policy configured to select flow routes can only be used to match on a route
community. It cannot be configured to match on flow source addresses, destination
addresses, ports, or any other information.
After a flow route is installed in the inetflow.0 table, it is also added to the list of firewall
filters in the kernel.
On routers only, flow-specification NLRI messages are supported in VPNs. The VPN
compares the route target extended community in the NLRI to the import policy. If there
is a match, the VPN can start using the flow routes to filter and rate-limit packet traffic.
Received flow routes are installed into the flow routing table instance-name.inetflow.0.
Flow routes can also be propagated throughout a VPN network and shared among VPNs.
To enable multiprotocol BGP (MP-BGP) to carry flow-specification NLRI for the inet-vpn
address family, include the flow statement at the [edit protocols bgp group group-name
family inet-vpn] hierarchy level. VPN flow routes are supported for the default instance
only. Flow routes configured for VPNs with family inet-vpn are not automatically validated,
so the no-validate statement is not supported at the [edit protocols bgp group group-name
family inet-vpn] hierarchy level. No validation is needed if the flow routes are configured
locally between devices in a single AS.
Import and export policies can be applied to the family inet flow or family inet-vpn flow
NLRI, affecting the flow routes accepted or advertised, similar to the way import and
export policies are applied to other BGP families. The only difference is that the flow
policy configuration must include the from rib inetflow.0 statement. This statement
causes the policy to be applied to the flow routes. An exception to this rule occurs if the
policy has only the then reject or the then accept statement and no from statement. Then,
the policy affects all routes, including IP unicast and IP flow.
• A policy that allows the advertisement of flow routes specified by a route-filter. Only
the flow routes covered by the 10.13/16 block are advertised. This policy does not affect
unicast routes.
• A policy that allows all unicast and flow routes to be advertised to the neighbor.
• A policy that disallows all routes (unicast or flow) to be advertised to the neighbor.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
In the default term ordering algorithm, as specified in the flowspec RFC draft Version
6, a term with less specific matching conditions is always evaluated before a term
with more specific matching conditions. This causes the term with more specific
matching conditions to never be evaluated. Version 7 of RFC 5575 made a revision
to the algorithm so that the more specific matching conditions are evaluated before
the less specific matching conditions. For backward compatibility, the default
behavior is not altered in Junos OS, even though the newer algorithm makes more
sense. To use the newer algorithm, include the term-order standard statement in
the configuration. This statement is supported in Junos OS Release 10.0 and later.
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.
[edit]
user@host# show routing-options
flow {
term-order standard;
route block-10.131.1.1 {
match {
destination 10.131.1.1/32;
protocol icmp;
icmp-type echo-request;
}
then discard;
}
}
If you are done configuring the device, enter commit from configuration mode.
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit routing-options]
user@host# set autonomous-system 65001
Results From configuration mode, confirm your configuration by entering the show protocols,
show policy-options, and show routing-options commands. If the output does not display
the intended configuration, repeat the instructions in this example to correct the
configuration.
[edit]
user@host# show protocols
bgp {
group core {
family inet {
unicast;
flow;
}
export p1;
peer-as 65000;
neighbor 10.12.99.5;
}
}
[edit]
user@host# show policy-options
policy-statement p1 {
term a {
from {
rib inetflow.0;
route-filter 10.13.0.0/16 orlonger;
}
then accept;
}
term b {
then reject;
}
}
[edit]
user@host# show routing-options
autonomous-system 65001;
If you are done configuring the device, enter commit from configuration mode.
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit routing-options]
user@host# set autonomous-system 65001
Results From configuration mode, confirm your configuration by entering the show protocols,
show policy-options, and show routing-options commands. If the output does not display
the intended configuration, repeat the instructions in this example to correct the
configuration.
[edit]
user@host# show protocols
bgp {
group core {
family inet {
unicast;
flow;
}
export p1;
peer-as 65000;
neighbor 10.12.99.5;
}
}
[edit]
user@host# show policy-options
policy-statement p1 {
term a {
then accept;
}
}
[edit]
user@host# show routing-options
autonomous-system 65001;
If you are done configuring the device, enter commit from configuration mode.
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit routing-options]
user@host# set autonomous-system 65001
Results From configuration mode, confirm your configuration by entering the show protocols,
show policy-options, and show routing-options commands. If the output does not display
the intended configuration, repeat the instructions in this example to correct the
configuration.
[edit]
user@host# show protocols
bgp {
group core {
family inet {
unicast;
flow;
}
export p1;
peer-as 65000;
neighbor 10.12.99.5;
}
}
[edit]
user@host# show policy-options
policy-statement p1 {
term a {
then reject;
}
}
[edit]
user@host# show routing-options
autonomous-system 65001;
If you are done configuring the device, enter commit from configuration mode.
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
1. Set an upper limit for the number of prefixes installed in inetflow.0 table.
2. Set a threshold value of 50 percent, where when 500 routes are installed, a warning
is logged in the system log.
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.
[edit]
user@host# show routing-options
rib inetflow.0 {
maximum-prefixes 1000 threshold 50;
}
If you are done configuring the device, enter commit from configuration mode.
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
set protocols bgp group x1 neighbor 10.12.99.2 family inet flow prefix-limit maximum 1000
set protocols bgp group x1 neighbor 10.12.99.2 family inet flow prefix-limit teardown 50
Step-by-Step The following example requires that you navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
Configuring a prefix limit for a specific neighbor provides more predictable control over
which peer can advertise how many flow routes.
2. Configure the neighbor session to be brought down when the maximum number of
prefixes is reached.
If you specify a percentage, as shown here, messages are logged when the number
of prefixes reaches that percentage.
After the session is brought down, the session reestablishes in a short time unless
you include the idle-timeout statement.
Results From configuration mode, confirm your configuration by entering the show protocols
command. If the output does not display the intended configuration, repeat the
instructions in this example to correct the configuration.
[edit]
user@host# show protocols
bgp {
group x1 {
neighbor 10.12.99.2 {
flow {
prefix-limit {
maximum 1000;
teardown 50;
}
}
}
}
}
}
If you are done configuring the device, enter commit from configuration mode.
Verification
Action From operational mode, run the show bgp neighbor 10.12.99.5 command. Look for inet-flow
in the output.
Active prefixes: 0
Received prefixes: 0
Suppressed due to damping: 0
Advertised prefixes: 0
Last traffic (seconds): Received 29 Sent 15 Checked 15
Input messages: Total 5549 Updates 2618 Refreshes 0 Octets 416486
Output messages: Total 2943 Updates 1 Refreshes 0 Octets 55995
Output Queue[0]: 0
Output Queue[1]: 0
Output Queue[2]: 0
Verifying Routes
Purpose Look at the flow routes. The sample output shows a flow route learned from BGP and a
statically configured flow route.
For locally configured flow routes (configured at the [edit routing-options flow] hierarchy
level), the routes are installed by the flow protocol. Therefore, you can display the flow
routes by specifying the table, as in show route table inetflow.0 or show route table
instance-name.inetflow.0, where instance-name is the routing instance name. Or, you can
display all locally configured flow routes across multiple routing instances by running
the show route protocol flow command.
If a flow route is not locally configured, but received from the router’s BGP peer, this flow
route is installed in the routing table by BGP. You can display the flow routes by specifying
the table or by running show route protocol bgp, which displays all BGP routes (flow and
non-flow).
Action From operational mode, run the show route table inetflow.0 command.
10.12.44.1,*/term:1
*[Flow/5] 00:04:22
Fictitious
*,10.12.44.1/term:2
*[Flow/5] 00:09:34
Fictitious
Meaning A flow route represents a term of a firewall filter. When you configure a flow route, you
specify the match conditions and the actions. In the match attributes, you can match a
source address, a destination address, and other qualifiers such as the port and the
protocol. For a single flow route that contains multiple match conditions, all the match
conditions are encapsulated in the prefix field of the route. When you issue the show
route command on a flow route, the prefix field of the route is displayed with all of the
match conditions. 10.12.44.1,* means that the matching condition is match destination
10.12.44.1/32. If the prefix in the output were *,10.12.44.1, this would mean that the match
condition was match source 10.12.44.1/32. If the matching conditions contain both a source
and a destination, the asterisk is replaced with the address.
The term-order numbers indicate the sequence of the terms (flow routes) being evaluated
in the firewall filter. The show route extensive command displays the actions for each
term (route).
Action From operational mode, run the show route flow validation detail command.
Purpose Display the firewall filters that are installed in the kernel.
Verifying System Logging When Exceeding the Number of Allowed Flow Routes
Purpose If you configure a limit on the number of flow routes installed, as described in “Limiting
the Number of Flow Routes Installed in a Routing Table” on page 542, view the system
log message when the threshold is reached.
Action From operational mode, run the show log <log-filename> command.
Verifying System Logging When Exceeding the Number of Prefixes Received on a BGP
Peering Session
Purpose If you configure a limit on the number of flow routes installed, as described in “Limiting
the Number of Prefixes Received on a BGP Peering Session” on page 543, view the system
log message when the threshold is reached.
Action From operational mode, run the show log <log-filename> command.
CLNS is a Layer 3 protocol similar to IP version 4 (IPv4). CLNS uses network service
access points (NSAPs) to address end systems. This allows for a seamless autonomous
system (AS) based on International Organization for Standardization (ISO) NSAPs.
A single routing domain consisting of ISO NSAP devices are considered to be CLNS
islands. CLNS islands are connected together by VPNs.
You can configure BGP to exchange ISO CLNS routes between PE routers connecting
various CLNS islands in a VPN using multiprotocol BGP extensions. These extensions
are the ISO VPN NLRIs.
Each CLNS network island is treated as a separate VPN routing and forwarding instance
(VRF) instance on the PE router.
You can configure CLNS on the global level, group level, and neighbor level.
Requirements
Before you begin, configure the network interfaces. See the Junos OS Interfaces
Configuration Guide for Security Devices.
Overview
In this example, you create the BGP group called pedge-pedge, define the BGP peer
neighbor address for the group as 10.255.245.215, and define the BGP family.
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
1. Configure the BGP group and define the BGP peer neighbor address.
[edit]
user@host# commit
Verification
Action From operational mode, run the show bgp neighbor 10.255.245.213 command. Look for
iso-vpn-unicast in the output.
A single routing domain consisting of ISO NSAP devices are considered to be CLNS
islands. CLNS islands are connected together by VPNs.
You can configure BGP to exchange ISO CLNS routes between provider edge (PE) routers
connecting various CLNS islands in a virtual private network (VPN) using multiprotocol
BGP extensions. These extensions are the ISO VPN NLRIs.
To enable multiprotocol BGP (MP-BGP) to carry CLNS VPN NLRIs, include the iso-vpn
statement:
iso-vpn {
unicast {
prefix-limit number;
rib-group group-name;
}
}
To limit the number of prefixes from a peer, include the prefix-limit statement. To specify
a routing table group, include the rib-group statement.
For a list of hierarchy levels at which you can include this statement, see the statement
summary section for this statement.
Each CLNS network island is treated as a separate VRF instance on the PE router.
You can configure CLNS on the global level, group level, and neighbor level.
On Router 1:
protocols {
bgp {
local-address 10.255.245.195;
group pe-pe {
type internal;
neighbor 10.255.245.194 {
family iso-vpn {
unicast;
}
}
}
}
}
routing-instances {
aaaa {
instance-type vrf;
interface fe-0/0/0.0;
interface so-1/1/0.0;
interface lo0.1;
route-distinguisher 10.255.245.194:1;
vrf-target target:11111:1;
protocols {
isis {
export dist-bgp;
no-ipv4-routing;
no-ipv6-routing;
clns-routing;
interface all;
}
}
}
}
On Router 2:
protocols {
bgp {
group pe-pe {
type internal;
local-address 10.255.245.198;
family route-target;
neighbor 10.255.245.194 {
family iso-vpn {
unicast;
}
}
}
}
}
routing-instances {
aaaa {
instance-type vrf;
interface lo0.1;
interface so-0/1/2.0;
interface so-0/1/3.0;
route-distinguisher 10.255.245.194:1;
vrf-target target:11111:1;
routing-options {
rib aaaa.iso.0 {
static {
iso-route 47.0005.80ff.f800.0000.bbbb.1022/104 next-hop
47.0005.80ff.f800.0000.aaaa.1000.1921.6800.4196.00;
}
}
}
protocols {
isis {
export dist-bgp;
no-ipv4-routing;
no-ipv6-routing;
clns-routing;
interface all;
}
}
}
}
On Route Reflector:
protocols {
bgp {
group pe-pe {
type internal;
local-address 10.255.245.194;
family route-target;
neighbor 10.255.245.195 {
cluster 0.0.0.1;
}
neighbor 10.255.245.198 {
cluster 0.0.0.1;
}
}
}
}
On PE Router 1:
protocols {
mpls {
interface all;
}
bgp {
group asbr {
type external;
local-address 10.245.245.3;
neighbor 10.245.245.1 {
multihop;
family iso-vpn {
unicast;
}
peer-as 200;
}
}
}
}
routing-instances {
aaaa {
instance-type vrf;
interface lo0.1;
interface t1-3/0/0.0;
interface fe-5/0/1.0;
route-distinguisher 10.245.245.1:1;
vrf-target target:11111:1;
protocols {
isis {
export dist-bgp;
no-ipv4-routing;
no-ipv6-routing;
clns-routing;
interface all;
}
}
}
}
On PE Router 2:
protocols {
bgp {
group asbr {
type external;
multihop;
family iso-vpn {
unicast;
}
neighbor 10.245.245.2 {
peer-as 300;
}
neighbor 10.245.245.3 {
peer-as 100;
}
}
}
}
routing-instances {
aaaa {
instance-type vrf;
interface lo0.1;
route-distinguisher 10.245.245.1:1;
vrf-target target:11111:1;
}
}
On PE Router 3:
protocols {
bgp {
group asbr {
type external;
multihop;
local-address 10.245.245.2;
neighbor 10.245.245.1 {
family iso-vpn {
unicast;
}
peer-as 200;
}
}
}
}
routing-instances {
aaaa {
instance-type vrf;
interface lo0.1;
interface fe-0/0/1.0;
interface t1-3/0/0.0;
route-distinguisher 10.245.245.1:1;
vrf-target target:11111:1;
protocols {
isis {
export dist-bgp;
no-ipv6-routing;
clns-routing;
interface all;
}
}
}
}
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.
Requirements
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 a valid URL.
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 hour. To modify this interval, include the statistics-timeout seconds statement. For
seconds, you can specify a value from 15 through 65,535. By default, the routing device
stops collecting BMP data when it exceeds a threshold of 10 MB. You can modify the
value of this threshold by including the memory-limit bytes statement. For bytes, specify
a value from 1,048,576 to 52,428,800. If the routing device stops collecting BMP data
after exceeding the configured memory threshold, the router waits 10 minutes before
attempting to resume the BMP session.
Figure 61 on page 558 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.
fxp0 fxp0
Configuration
CLI Quick To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
To configure BMP:
[edit routing-options]
user@PE1# set bmp station-address 192.168.64.180
[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.
Verification
Purpose Run the show bgp bmp command to display a set of statistics and the current BMP session
state on the router.
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.
• damping—Damping operations.
• open—BGP open packets. These packets are sent between peers when they are
establishing a connection.
• 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:
• 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
You can optionally specify one or more of the following flag modifiers:
• filter—Filter trace information. Applies only to route and damping tracing flags.
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.
Requirements
• You must have the view privilege for the logical system.
• Configure a network, such as the BGP network shown in “Example: Configuring Internal
BGP Peering Sessions on Logical Systems” on page 54.
Overview
• /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.
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 To quickly configure this example, copy the following commands, paste them into a text
Configuration 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.
Step-by-Step The following example requires you to navigate various levels in the configuration
Procedure hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration
Mode in the CLI User Guide.
[edit]
user@host# commit
2. In operational mode on the main router, list the log files on the logical system.
8. Halt the monitor command by pressing Enter and typing monitor stop.
[Enter]
user@host> monitor stop
9. When you are finished troubleshooting, consider deactivating trace logging to avoid
any unnecessary impact to system resources.
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;
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;
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
Purpose Make sure that events are being written to the log file.
Several statements in the [edit protocols mpls] hierarchy are valid at numerous locations
within it. To make the complete hierarchy easier to read, the repeated statements are
listed in “Common BGP Family Options” on page 567 and that section is referenced at the
appropriate locations in “Complete [edit protocols bgp] Hierarchy” on page 568.
• [edit protocols bgp family inet (any | flow | labeled-unicast | multicast | unicast)]
• [edit protocols bgp family (evpn | inet-mdt | inet-mvpn | inet6-mvpn | l2vpn) signaling]
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
damping;
loops number;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
rib-group group-name;
topology name {
community {
target identifier;
}
}
protocols {
bgp {
disable;
accept-remote-nexthop;
advertise-external <conditional>;
advertise-from-main-vpn-tables;
advertise-inactive;
(advertise-peer-as | no-advertise-peer-as);
authentication-algorithm (aes-128-cmac-96 | hmac-sha-1-96 | md5);
authentication-key key;
authentication-key-chain key-chain;
bfd-liveness-detection {
authentication {
algorithm (keyed-md5 | keyed-sha-1 | meticulous-keyed-md5 |
meticulous-keyed-sha-1 | simple-password);
key-chain key-chain-name;
loose-check;
}
detection-time {
threshold milliseconds;
}
holddown-interval milliseconds;
minimum-interval milliseconds;
minimum-receive-interval milliseconds;
multiplier number;
no-adaptation;
session-mode (automatic | multihop | single-hop);
transmit-interval {
minimum-interval milliseconds;
threshold milliseconds;
}
version (1 | automatic);
}
cluster cluster-identifier;
damping;
description text-description;
export [ policy-names ];
family family-name {
... the family subhierarchies appear after the main [edit protocols bgp] hierarchy ...
}
graceful-restart {
disable;
restart-time seconds;
stale-routes-time seconds;
}
group group-name {
... the group subhierarchy appears after the main [edit protocols bgp] hierarchy ...
}
hold-time seconds;
idle-after-switch-over (seconds | forever);
import [ policy-names ];
include-mp-next-hop;
ipsec-sa ipsec-sa;
keep (all | none);
local-address address;
local-as autonomous-system <loops number> < alias> <private>;
local-interface interface-name;
local-preference local-preference;
log-updown;
metric-out (metric | igp (delay-med-update | offset) | minimum-igp offset);
mtu-discovery;
multihop {
no-nexthop-change;
ttl ttl-value;
}
no-aggregator-id;
no-client-reflect;
out-delay seconds;
outbound-route-filter {
bgp-orf-cisco-mode;
prefix-based {
accept {
inet;
inet6;
}
}
}
passive;
path-selection {
always-compare-med;
as-path-ignore;
cisco-non-deterministic;
external-router-id;
med-plus-igp {
igp-multiplier number;
med-multiplier number;
}
}
peer-as autonomous-system;
preference preference;
remove-private;
tcp-mss segment-size;
traceoptions {
file filename <files number> <size maximum-file-size> <world-readable |
no-world-readable>;
flag flag <flag-modifier> <disable>;
}
vpn-apply-export;
}
bgp {
family inet {
(any | multicast) {
... statements in Common BGP Family Options on page 567 ...
}
flow {
... statements in Common BGP Family Options on page 567 PLUS ...
no-validate [ validation-procedure-names ];
}
labeled-unicast {
... statements in Common BGP Family Options on page 567 PLUS ...
add-path {
receive;
send {
path-count number;
prefix-policy [ policy-names ];
}
}
aggregate-label {
community community-name;
}
aigp [disable];
explicit-null connected-only;
per-group-label;
per-prefix-label;
resolve-vpn;
rib (inet.3 | inet6.3);
traffic-statistics {
file filename <files number> <size maximum-file-size> <world-readable |
no-world-readable>;
interval seconds;
}
}
unicast {
... statements in Common BGP Family Options on page 567 PLUS ...
add-path {
receive;
send {
path-count number;
prefix-policy [ policy-names ];
}
}
topology name {
community target identifier;
}
}
}
}
bgp {
family inet6 {
(any | multicast) {
... statements in Common BGP Family Options on page 567 ...
}
labeled-unicast {
... statements in Common BGP Family Options on page 567 PLUS ...
add-path {
receive;
send {
path-count number;
prefix-policy [ policy-names ];
}
}
aggregate-label {
community community-name:
}
aigp [disable];
explicit-null;
per-group-label;
traffic-statistics {
file filename <files number> <size maximum-file-size> <world-readable |
no-world-readable>;
interval seconds;
}
}
unicast {
... statements in Common BGP Family Options on page 567 PLUS ...
topology name {
community target identifier;
}
}
}
}
bgp {
family (evpn | inet-mdt | inet-mvpn | inet6-mvpn | l2vpn) {
auto-discovery-only; # for l2vpn
signaling {
... statements in Common BGP Family Options on page 567 ...
}
}
}
bgp {
family inet-vpn {
(any | multicast | unicast) {
... statements in Common BGP Family Options on page 567 PLUS ...
aggregate-label <community community-name>;
}
flow {
... statements in Common BGP Family Options on page 567 ...
}
}
}
bgp {
family inet6-vpn {
(any | multicast | unicast) {
... statements in Common BGP Family Options on page 567 PLUS ...
aggregate-label <community community-name>;
}
}
}
bgp {
family iso-vpn {
unicast {
... statements in Common BGP Family Options on page 567 PLUS ...
aggregate-label <community community-name>;
}
}
}
bgp {
family route-target {
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
advertise-default;
external-paths number;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
proxy-generate <route-target-policy route-target-policy-name>;
}
}
bgp {
group group-name {
... same statements as at the [edit protocols bgp] hierarchy level PLUS ...
allow [ all ip-prefix</prefix-length> ];
as-override;
multipath <multiple-as>;
neighbor address {
... the neighbor subhierarchy appears after the main [edit protocols bgp group
group-name] hierarchy ...
}
type (external | internal);
... BUT NOT ...
disable; # NOT valid at this level
group group-name { ... } # NOT valid at this level
path-selection { ... } # NOT valid at this level
}
group group-name {
neighbor address {
... same statements as at the [edit protocols bgp] hierarchy level PLUS ...
as-override;
multipath <multiple-as>;
... BUT NOT ...
disable; # NOT valid at this level
group group-name { ... } # NOT valid at this level
neighbor address { ... } # NOT valid at this level
path-selection { ... } # NOT valid at this level
}
}
}
}
accept-remote-nexthop
Syntax accept-remote-nexthop;
Description Specify that a single-hop EBGP peer accepts a remote next hop with which it does not
share a common subnet. Configure a separate import policy on the EBGP peer to specify
the remote next hop. You cannot configure multihop and accept-remote-nexthop
statements for the same EPBG peer.
Related • Example: Configuring Single-Hop EBGP Peers to Accept Remote Next Hops on page 350
Documentation
• Understanding Route Advertisement on page 215
accepted-prefix-limit
Syntax accepted-prefix-limit {
maximum number;
teardown <percentage-threshold> idle-timeout (forever | minutes);
}
Hierarchy Level [edit logical-systems logical-system-name protocols bgp family (inet | inet6) (any | flow |
labeled-unicast | multicast | unicast)],
[edit logical-systems logical-system-name protocols bgp family route-target],
[edit logical-systems logical-system-name protocols bgp group group-name family (inet |
inet6) (any | flow | labeled-unicast | multicast | unicast)],
[edit logical-systems logical-system-name protocols bgp group group-name family
route-target],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family (inet | inet6) (any | flow | labeled-unicast | multicast | unicast)],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family route-target],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp family (inet | inet6) (any | flow | labeled-unicast | multicast | unicast)],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp family route-target],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name family (inet | inet6) (any | flow | labeled-unicast | multicast |
unicast)],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name family route-target],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name neighbor address family (inet | inet6) (any | flow | labeled-unicast
| multicast | unicast)],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name neighbor address family route-target],
[edit protocols bgp family (inet | inet6) (any | flow | labeled-unicast | multicast | unicast)],
[edit protocols bgp family route-target],
[edit protocols bgp group group-name family (inet | inet6) (any | flow | labeled-unicast |
multicast | unicast)],
[edit protocols bgp group group-name family route-target],
[edit protocols bgp group group-name neighbor address family (inet | inet6) (any | flow |
labeled-unicast | multicast | unicast)],
[edit protocols bgp group group-name neighbor address family route-target],
[edit routing-instances routing-instance-name protocols bgp family (inet | inet6) (any | flow
| labeled-unicast | multicast | unicast)],
[edit routing-instances routing-instance-name protocols bgp family route-target],
[edit routing-instances routing-instance-name protocols bgp group group-name family (inet
| inet6) (any | flow | labeled-unicast | multicast | unicast)],
[edit routing-instances routing-instance-name protocols bgp group group-name family
route-target],
[edit routing-instances routing-instance-name protocols bgp group group-name neighbor
address family (inet | inet6) (any | flow | labeled-unicast | multicast | unicast)],
[edit routing-instances routing-instance-name protocols bgp group group-name neighbor
address family route-target]
Description Configure a limit to the number of prefixes that can be accepted on a BGP peer session.
When that limit is exceeded, a system log message is sent. You can optionally specify
to reset the BGP session when the number of accepted prefixes exceeds the specified
limit.
This statement provides the ability to log a message, reset the BGP session, or do both
when the number of prefixes received from the peer and accepted by policy exceeds a
preset limit. This functionality is identical to the prefix-limit functionality except that it
operates against accepted prefixes rather than received prefixes.
Options maximum number—When you set the maximum number of prefixes, a message is logged
when that number is exceeded.
32
Range: 1 through 4,294,967,295 (2 – 1)
add-path
Syntax add-path {
receive;
send {
path-count number;
prefix-policy [ policy-names ];
}
}
Hierarchy Level [edit logical-systems logical-system-name protocols bgp group group-name family family],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family family],
[edit protocols bgp group group-name family family],
[edit protocols bgp group group-name neighbor address family family]
Description Enable advertisement of multiple paths to a destination, instead of advertising only the
active path.
advertise-external
Description Specify BGP to advertise the best external route into an IBGP mesh group, a route reflector
cluster, or an AS confederation even if the best route is an internal route.
In general, deployed BGP implementations do not advertise the external route with the
highest local preference value to internal peers unless it is the best route. Although this
behavior was required by an earlier version of the BGP version 4 specification, RFC 1771,
it was typically not followed in order to minimize the amount of advertised information
and to prevent routing loops. However, there are scenarios in which advertising the best
external route is beneficial, in particular, situations that can result in IBGP route oscillation.
The advertise-external statement is supported at both the group and neighbor level. If
you configure the statement at the neighbor level, you must configure it for all neighbors
in a group. Otherwise, the group is automatically split into different groups.
When a routing device is configured as a route reflector for a cluster, a route advertised
by the route reflector is considered internal if it is received from an internal peer with the
same cluster identifier or if both peers have no cluster identifier configured. A route
received from an internal peer that belongs to another cluster, that is, with a different
cluster identifier, is considered external.
The conditional option causes BGP to advertise the external route only if the route
selection process reaches the point where the multiple exit discriminator (MED) metric
is evaluated. As a result, an external route with an AS path longer than that of the active
path is not advertised.
Junos OS also provides support for configuring a BGP export policy that matches on the
state of an advertised route. You can match on either active or inactive routes.
Default BGP does not advertise the external route with the highest local preference value to
internal peers unless it is the best route.
Options conditional—(Optional) Advertise the best external path only if the route selection process
reaches the point at which the multiple exit discriminator (MED) metric is evaluated.
The conditional option restricts advertisement to when the best external path and
the active path are equal until the MED step of the route selection process. This
implies that external routes with a longer AS path length than the active path, for
instance, are not advertised. The criteria used for selecting the best external path is
the same whether or not the conditional option is configured.
advertise-from-main-vpn-tables
Syntax advertise-from-main-vpn-tables;
Description Advertise VPN routes from the main VPN tables in the master routing instance (for
example, bgp.l3vpn.0, bgp.mvpn.0) instead of advertising VPN routes from the tables
in the VPN routing instances (for example, instance-name.inet.0, instance-name.mvpn.0).
When this statement is enabled, before advertising a route for a VPN prefix, the path
selection algorithm is run on all routes (local and received) that have the same route
distinguisher (RD).
NOTE: Adding or removing this statement causes all BGP sessions that have
VPN address families to be removed and then added again. On the other
hand, having this statement in the configuration prevents BGP sessions from
going down when route reflector (RR) or autonomous system border router
(ASBR) functionality is enabled or disabled on a routing device that has VPN
address families configured.
Default If you do not include this statement, VPN routes are advertised from the tables in the
VPN routing instances.
advertise-inactive
Syntax advertise-inactive;
Description Configure the routing table to export to BGP the best route learned by BGP even if Junos
OS did not select this route to be an active route.
Default By default, BGP stores the route information it receives from update messages in the
Junos OS routing table, and the routing table exports only active routes into BGP, which
BGP then advertises to its peers.
advertise-peer-as
Syntax advertise-peer-as;
If you include the advertise-peer-as statement in the configuration, BGP advertises routes
learned from one external BGP (EBGP) peer back to another EBGP peer in the same
autonomous system (AS).
Another way to disable the route suppression default behavior is with the as-override
statement. If you include both the as-override and no-advertise-peer-as statements in
the configuration, the no-advertise-peer-as statement is ignored.
Default By default, Junos OS does not advertise the routes learned from one EBGP peer back to
the same external BGP (EBGP) peer. In addition, the software does not advertise those
routes back to any EBGP peers that are in the same AS as the originating peer, regardless
of the routing instance.
aggregate-label
Syntax aggregate-label {
community community-name;
}
Hierarchy Level [edit logical-systems logical-system-name protocols bgp family inet labeled-unicast],
[edit logical-systems logical-system-name protocols bgp family inet6 labeled-unicast],
[edit logical-systems logical-system-name protocols bgp family inet-vpn unicast],
[edit logical-systems logical-system-name protocols bgp family inet-vpn6 unicast],
[edit protocols bgp family inet labeled-unicast],
[edit protocols bgp family inet6 labeled-unicast],
[edit protocols bgp family inet-vpn unicast],
[edit protocols bgp family inet6-vpn unicast]
Description Specify matching criteria (in the form of a community) such that all routes which match
are assigned the same VPN label, selected from one of the several routes in the set
defined by this criteria. This reduces the number of VPN labels that the router must
consider, and aggregates the received labels.
Options community community-name—Specify the name of the community to which to apply the
aggregate label.
aigp
Hierarchy Level [edit logical-systems logical-system-name protocols bgp family inet labeled-unicast],
[edit logical-systems logical-system-name protocols bgp family inet6 labeled-unicast],
[edit logical-systems logical-system-name protocols bgp group group-name family inet
labeled-unicast],
[edit logical-systems logical-system-name protocols bgp group group-name family inet6
labeled-unicast],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family inet labeled-unicast],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family inet6 labeled-unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp family inet labeled-unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp family inet6 labeled-unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name family inet labeled-unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name family inet6 labeled-unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name neighbor address family inet labeled-unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name neighbor address family inet6 labeled-unicast],
[edit protocols bgp family inet labeled-unicast],
[edit protocols bgp family inet6 labeled-unicast],
[edit protocols bgp group group-name family inet labeled-unicast] ,
[edit protocols bgp group group-name family inet6 labeled-unicast] ,
[edit protocols bgp group group-name neighbor address family inet labeled-unicast],
[edit protocols bgp group group-name neighbor address family inet6 labeled-unicast],
[edit routing-instances routing-instance-name protocols bgp family inet labeled-unicast],
[edit routing-instances routing-instance-name protocols bgp family inet6 labeled-unicast],
[edit routing-instances routing-instance-name protocols bgp group group-name family inet
labeled-unicast],
[edit routing-instances routing-instance-name protocols bgp group group-name family inet6
labeled-unicast],
[edit routing-instances routing-instance-name protocols bgp group group-name
neighbor address family inet labeled-unicast],
[edit routing-instances routing-instance-name protocols bgp group group-name
neighbor address family inet6 labeled-unicast]
Description Enable the accumulated interior gateway protocol (AIGP) BGP attribute on a protocol
family. Configuring AIGP on a particular family enables sending and receiving of the AIGP
attribute on that family.
The AIGP attribute enables deployments in which a single administration can run several
contiguous BGP autonomous systems (ASs). Such deployments allow BGP to make
routing decisions based on the IGP metric. With AIGP enabled, BGP can select paths
based on IGP metrics. This enables BGP to choose the shortest path between two nodes,
even though the nodes might be in different ASs. The AIGP attribute is particularly useful
in networks that use tunneling to deliver a packet to its BGP next hop. Such is the case
with MPLS label-switched paths.
Related • Example: Configuring the Accumulated IGP Attribute for BGP on page 136
Documentation
• aigp-originate on page 585
aigp-originate
Description Originate an accumulated interior gateway protocol (AIGP) BGP attribute for a given
prefix by export policy, using the aigp-originate policy action.
To originate an AIGP attribure, you need configure the policy action on only one node.
The AIGP attribute is readvertised if the neighbors are AIGP enabled with the aigp
statement in the BGP configuration.
Default If you omit the aigp-originate policy action, the node still readvertises the AIGP BGP
attribute if AIGP is enabled in the BGP configuration. However, the node does not originate
its own AIGP attribute for local prefixes.
As the route is readvertised by downstream nodes, the cost of the AIGP attribute reflects
the IGP distance to the prefix (zero + IGP distance or configured distance + IGP distance).
Options distance—(Optional) Associate an initial cost when advertising a local prefix with the
AIGP BGP attribute.
Range: 0 through 4,294,967,295
Default: The initial cost associated with the AIGP attribute for a local prefix is zero. The
distance option overrides the default zero value for the initial cost.
Related • Example: Configuring the Accumulated IGP Attribute for BGP on page 136
Documentation
• aigp on page 583
Description Configure the algorithm used to authenticate the specified BFD session.
keyed-md5—Keyed Message Digest 5 hash algorithm for sessions with transmit and
receive intervals greater than 100 ms. To authenticate the BFD session, keyed MD5
uses one or more secret keys (generated by the algorithm) and a sequence number
that is updated periodically. With this method, packets are accepted at the receiving
end of the session if one of the keys matches and the sequence number is greater
than or equal to the last sequence number received. Although more secure than a
simple password, this method is vulnerable to replay attacks. Increasing the rate at
which the sequence number is updated can reduce this risk.
keyed-sha-1—Keyed Secure Hash Algorithm I for sessions with transmit and receive
intervals greater than 100 ms. To authenticate the BFD session, keyed SHA uses one
or more secret keys (generated by the algorithm) and a sequence number that is
updated periodically. The key is not carried within the packets. With this method,
packets are accepted at the receiving end of the session if one of the keys matches
and the sequence number is greater than the last sequence number received.
allow
Description Implicitly configure BGP peers, allowing peer connections from any of the specified
networks or hosts. To configure multiple BGP peers, configure one or more networks and
hosts within a single allow statement or include multiple allow statements.
NOTE: You cannot define a BGP group with dynamic peers with BGP
authentication enabled.
NOTE: You cannot define a BGP group with dynamic peers with authentication
enabled.
as-override
Syntax as-override;
Description Compare the AS path of an incoming advertised route with the AS number of the BGP
peer under the group and replace all occurrences of the peer AS number in the AS path
with its own AS number before advertising the route to the peer.
Note that enabling the AS override feature may result in routing loops. Use this feature
only for specific applications that require this type of behavior, and in situations with
strict network control. One application is the IGP protocol between the provider edge
routing device and the customer edge routing device in a virtual private network.
Related • Example: Configuring a Layer 3 VPN with Route Reflection and AS Override on page 176
Documentation
• Junos OS VPNs Library for Routing Devices
Syntax authentication {
algorithm algorithm-name;
key-chain key-chain-name;
loose-check ;
}
Description Specify the router and route authentication to mitigate the risk of being attacked by a
machine or router that has been configured to share incorrect routing information with
another router. Router and route authentication enables routers to share information
only if they can verify that they are talking to a trusted source, based on a password (key).
In this method, a hashed key is sent along with the route being sent to another router.
The receiving router compares the sent key to its own configured key. If they are the same,
the receiving router accepts the route.
authentication-algorithm
• md5—Message digest 5.
Description Configure an MD5 authentication key (password). Neighboring routing devices use the
same password to verify the authenticity of BGP packets sent from this system.
Description Apply and enable an authentication keychain to the routing device. Note that the
referenced key chain must be defined. When configuring the authentication key update
mechanism for BGP, you cannot commit the 0.0.0.0/allow statement with authentication
keys or key chains. The CLI issues a warning and fails to commit such configurations.
• Configuring the Authentication Key Update Mechanism for BGP and LDP Routing Protocols
auto-discovery-only
Syntax auto-discovery-only;
Description Enable the router to process only the autodiscovery network layer reachability information
(NLRI) update messages for VPWS and LDP-based Layer 2 VPN and VPLS update
messages (BGP_L2VPN_AD_NLRI) (FEC 129).
The auto-discovery-only statement must be configured on all provider edge (PE) routers
in a VPLS or in a VPWS. If you configure route reflection, the auto-discovery-only statement
is also required on provider (P) routers that act as the route reflector in supporting FEC
129-related updates.
Syntax bfd-liveness-detection {
authentication {
algorithm algorithm-name;
key-chain key-chain-name;
loose-check;
}
detection-time {
threshold milliseconds;
}
hold-down-interval milliseconds;
minimum-interval milliseconds;
minimum-receive-interval milliseconds;
multiplier number;
no-adaptation;
session-mode (automatic | multihop | single-hop);
transmit-interval {
minimum-interval milliseconds;
threshold milliseconds;
}
version (1 | automatic);
}
Support for BFD on IPv6 interfaces with BGP introduced in Junos OS Release 11.2.
Statement introduced in Junos OS Release 12.1 for the QFX Series.
Description Configure bidirectional failure detection (BFD) timers and authentication for BGP.
For IBGP and multihop EBGP support, configure the bfd-liveness-detection statement
at the global [edit bgp protocols] hierarchy level. You can also configure IBGP and multihop
support for a routing instance or a logical system.
bgp
bgp-orf-cisco-mode
Syntax bgp-orf-cisco-mode;
Description Enable interoperability with routing devices that use the vendor-specific outbound route
filter compatibility code of 130 and code type of 128.
NOTE: To enable interoperability for all BGP peers configured on the routing
device, include the statement at the [edit routing-options outbound-route-filter]
hierarchy level.
Default Disabled
Related • Example: Configuring BGP Prefix-Based Outbound Route Filtering on page 219
Documentation
bmp
Syntax bmp {
memory limit bytes;
station-address (ip-address | name);
station-port port-number;
statistics-timeout seconds;
}
Description Configure the BGP Monitoring Protocol (BMP), which enables the routing device to collect
data from the BGP Adjacency-RIB-In routing tables and periodically send that data to a
monitoring station.
Options memory-limit bytes—(Optional) Specify a threshold at which to stop collecting BMP data
if the limit is exceeded.
Default: 10 MB
Range: 1,048,576 through 52,428,800
station-port port-number—Specify the port number of the monitoring station to use when
sending BMP data.
cluster
Description Specify the cluster identifier to be used by the route reflector cluster in an internal BGP
group.
CAUTION:
If you configure both route reflection and VPNs on the same routing device,
the following modifications to the route reflection configuration cause current
BGP sessions to be reset:
• Adding a cluster ID—If a BGP session shares the same AS number with the
group where you add the cluster ID, all BGP sessions are reset regardless
of whether the BGP sessions are contained in the same group.
NOTE: If you change the address family specified in the [edit protocols bgp
family] hierarchy level, all current BGP sessions on the routing device are
dropped and then reestablished.
Syntax damping;
Description Enable route flap damping. BGP route flapping describes the situation in which BGP
systems send an excessive number of update messages to advertise network reachability
information. Flap damping reduces the number of update messages sent between BGP
peers, thereby reducing the load on these peers, without adversely affecting the route
convergence time for stable routes.
You typically apply flap damping to external BGP (EBGP) routes (that is, to routes in
different ASs). You can also apply it within a confederation, between confederation
member ASs. Because routing consistency within an AS is important, do not apply flap
damping to internal BGP (IBGP) routes. (If you do, it is ignored.) The exception to this
rule is when flap damping is applied at the address family level. When you apply flap
damping at the address family level, it works for both IBGP and EBGP.
Description Provide a description of the global, group, or neighbor configuration. If the text includes
one or more spaces, enclose it in quotation marks (“ “ ). The test is displayed in the output
of the show command and has no effect on the configuration.
Syntax detection-time {
threshold milliseconds;
}
Description Enable BFD failure detection. The BFD failure detection timers are adaptive and can be
adjusted to be faster or slower. The lower the BFD failure detection timer value, the faster
the failure detection and vice versa. For example, the timers can adapt to a higher value
if the adjacency fails (that is, the timer detects failures more slowly). Or a neighbor can
negotiate a higher value for a timer than the configured value. The timers adapt to a
higher value when a BFD session flap occurs more than three times in a span of 15 seconds.
A back-off algorithm increases the receive (Rx) interval by two if the local BFD instance
is the reason for the session flap. The transmission (Tx) interval is increased by two if
the remote BFD instance is the reason for the session flap. You can use the clear bfd
adaptation command to return BFD interval timers to their configured values. The clear
bfd adaptation command is hitless, meaning that the command does not affect traffic
flow on the routing device.
Syntax disable;
Syntax disable;
Description Disable graceful restart for BGP. Graceful restart allows a routing device undergoing a
restart to inform its adjacent neighbors and peers of its condition.
NOTE: When you disable graceful restart at one level in the configuration
statement hierarchy, it is also disabled at lower levels in the same hierarchy.
For example, if you disable graceful restart at the [edit protocols bgp group
group-name] hierarchy level, it is disabled for all the peers in the group.
Therefore, if you want to enable graceful restart for some peers in a group
and disable it for others, enable graceful restart at the [edit protocols bgp
group group-name] hierarchy level and disable graceful restart for each peer
at the [edit protocols bgp group group-name neighbor address] hierarchy level.
Syntax explicit-null;
Default If you do not include the explicit-null statement in the configuration, label 3 (implicit null)
is advertised.
Description Apply one or more policies to routes being exported from the routing table into BGP.
If you specify more than one policy, they are evaluated in the order specified, from left
to right, and the first matching filter is applied to the route. If no routes match the filters,
the routing table exports into BGP only the routes that it learned from BGP. If an action
specified in one of the policies manipulates a route characteristic, the policy framework
software carries the new route characteristic forward during the evaluation of the
remaining policies. For example, if the action specified in the first policy of a chain sets
a route’s metric to 500, this route matches the criterion of metric 500 defined in the next
policy.
Syntax family {
(inet | inet6 | inet-vpn | inet6-vpn | iso-vpn) {
(any | flow | labeled-unicast | multicast | unicast) {
accepted-prefix-limit {
maximum number;
teardown <percentage-threshold> idle-timeout (forever | minutes);
}
add-path {
send {
path-count number;
prefix-policy [ policy-names ];
}
receive;
}
aigp [disable];
loops number;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
protection;
rib-group group-name;
topology name {
community {
target identifier;
}
}
flow {
no-validate policy-name;
}
labeled-unicast {
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
aggregate-label {
community community-name:
}
explicit-null {
connected-only;
}
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
resolve-vpn;
rib (inet.3 | inet6.3);
rib-group group-name;
traffic-statistics {
file filename <world-readable | no-world-readable>;
interval seconds;
}
}
}
route-target {
accepted-prefix-limit {
maximum number;
proxy-generate <route-target-policy route-target-policy-name>;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
advertise-default;
external-paths number;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
}
(evpn | inet-mdt | inet-mvpn | inet6-mvpn | l2vpn) {
signaling {
accepted-prefix-limit {
maximum number;
teardown <percentage-threshold> idle-timeout (forever | minutes);
}
add-path {
send {
path-count number;
prefix-policy [ policy-names ];
}
receive;
}
aigp [disable];
damping;
loops number;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
rib-group group-name;
}
}
}
Description Enable multiprotocol BGP (MP-BGP) by configuring BGP to carry network layer
reachability information (NLRI) for address families other than unicast IPv4, to specify
MP-BGP to carry NLRI for the IPv6 address family, or to carry NLRI for VPNs.
inet-mdt—Configure NLRI parameters for the multicast distribution tree (MDT) subaddress
family identifier (SAFI) for IPv4 traffic in Layer 3 VPNs.
l2vpn—Configure NLRI parameters for IPv4 for MPLS-based Layer 2 VPNs and VPLS.
multicast—Configure the family type to be multicast. This means that the BGP peers are
being used only to carry the unicast routes that are being used by multicast for
resolving the multicast routes.
unicast—Configure the family type to be unicast. This means that the BGP peers only
carry the unicast routes that are being used for unicast forwarding purposes. The
default family type is unicast.
• autonomous-system
Description Configure the file settings for tracing resource public key infrastructure (RPKI) BGP route
validation.
Options filename —Name of the file to receive the output of the tracing operation. Enclose the
name within quotation marks. All files are placed in the directory /var/log.
files number—(Optional) Maximum number of trace files. When a trace file named
trace-file 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 (xk to specify KB, xm to
specify MB, or xg to specify gigabytes), at which point the oldest trace file is
overwritten. If you specify a maximum number of files, you also must specify a
maximum file size with the size option.
Range: 2 through 1000 files
Default: 3 files
no-world-readable—(Optional) Restrict file access to the user who created the file.
size size—(Optional) Maximum size of each trace file, in kilobytes (KB), megabytes (MB),
or gigabytes (GB). When a trace file named trace-file 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 also must specify a maximum file size with the files
option.
Syntax: xk to specify KB, xm to specify MB, or xg to specify GB
Range: 10 KB through 1 GB
Default: 128 KB
Description Configure the flags for tracing resource public key infrastructure (RPKI) BGP route
validation.
Options flag—Tracing operation to perform. To specify more than one tracing operation, include
multiple flag statements.
• state—State transitions.
flow
Syntax flow {
no-validate policy-name;
}
Hierarchy Level [edit protocols bgp group group-name family (inet | inet-vpn)],
[edit protocols bgp group group-name neighbor address family (inet | inet-vpn)],
[edit routing-instances routing-instance-name protocols bgp group group-name family (inet
| inet-vpn)],
[edit routing-instances routing-instance-name protocols bgp group group-name
neighbor address family (inet | inet-vpn)]
NOTE: This statement is supported for the default instance, VRF instance,
and virtual-router instance only. It is configured with the instance-type
statement at the [edit routing-instance instance-name] hierarchy level. For
VPNs, this statement is supported for the default instance only.
Syntax graceful-restart {
disable;
restart-time seconds;
stale-routes-time seconds;
}
Description Enable graceful restart for BGP. Graceful restart allows a routing device undergoing a
restart to inform its adjacent neighbors and peers of its condition. Graceful restart is
disabled by default.
To configure the duration of the BGP graceful restart period, include the restart-time
statement at the [edit protocols bgp graceful-restart] hierarchy level. To set the length
of time the router waits to receive messages from restarting neighbors before declaring
them down, include the stale-routes-time statement at the [edit protocols bgp
graceful-restart] hierarchy level.
NOTE: If you configure graceful restart after a BGP session has been
established, the BGP session restarts and the peers negotiate graceful restart
capabilities.
For graceful restart to function properly, graceful restart must be enabled at the [edit
routing-instance instance-name routing-options] or [edit routing-options] hierarchy level
as well as in the protocol level.
For example:
protocols {
bgp {
group ext {
graceful-restart;
}
}
}
routing-options {
graceful-restart;
}
Graceful restart is enabled both at the [edit routing-options] hierarchy level, as well as
at the routing protocol level. If graceful restart is not configured in both sections, the peer
might have its route removed after a restart, which is not the intended behavior.
rib-group group-name;
}
}
route-target {
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
advertise-default;
external-paths number;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
}
}
hold-time seconds;
import [ policy-names ];
ipsec-sa ipsec-sa;
keep (all | none);
local-address address;
local-as autonomous-system <private>;
local-preference local-preference;
log-updown;
metric-out metric;
multihop <ttl-value>;
multipath {
multiple-as;
}
no-aggregator-id;
no-client-reflect;
out-delay seconds;
passive;
peer-as autonomous-system;
preference preference;
remove-private;
tcp-mss segment-size;
traceoptions {
file filename <files number> <size size> <world-readable | no-world-readable>;
flag flag <flag-modifier> <disable>;
}
type type;
neighbor address {
... peer-specific-options ...
}
}
Description Define a BGP peer group. BGP peer groups share a common type, peer autonomous
system (AS) number, and cluster ID, if present. To configure multiple BGP groups, include
multiple group statements.
By default, the group’s options are identical to the global BGP options. To override the
global options, include group-specific options within the group statement.
The group statement is one of the statements you must include in the configuration to
run BGP on the routing device.
If the number of sessions in a group exceeds the max-sessions value, the connections
are established in order by preference value. A numerically higher preference results in a
higher probability for session establishment. The order of session establishment is random
among sessions with equal preferences.
Description Configure an interval specifying how long a BFD session must remain up before a state
change notification is sent.
When you configure the hold-down interval for the BFD protocol for EBGP, the BFD
session is unaware of the BGP session during this time. In this case, if the BGP session
goes down during the configured hold-down interval, BFD already assumes the BGP
session is down and does not send a state change notification. The holddown-interval
statement is supported only for EBGP peers at the [edit protocols bgp group group-name
neighbor address] hierarchy level. If the BFD session goes down and then comes back up
during the configured hold-down interval, the timer is restarted. You must configure the
hold-down interval on both EBGP peers. If you configure the hold-down interval for a
multihop EBGP session, you must also configure a local IP address by including the
local-address statement at the [edit protocols bgp group group-name] hierarchy level.
Description Specify the hold-time value to use when negotiating a connection with the peer. The
hold-time value is advertised in open packets and indicates to the peer the length of time
that it should consider the sender valid. If the peer does not receive a keepalive, update,
or notification message within the specified hold time, the BGP connection to the peer
is closed and routing devices through that peer become unavailable.
The hold time is three times the interval at which keepalive messages are sent.
BGP on the local routing device uses the smaller of either the local hold-time value or
the peer’s hold-time value received in the open message as the hold time for the BGP
connection between the two peers.
Starting in Junos OS Release 12.3, the BGP hold-time value can be zero (0). This implies
that the speaker does not expect keepalive messages from its peer to maintain the BGP
session. When negotiating between two peers, if one side requests a nonzero hold time
and the other requests a zero hold time, the negotiation settles on the nonzero value and
keepalive intervals are determined accordingly. Both sides must be set to zero for keepalive
messages to stop being sent.
Description Specify the length of time in seconds that the session between the routing device and
the cache server is to be considered operational without any activity. After the hold time
expires, the session is dropped.
Reception of any protocol data unit (PDU) from the cache server resets the hold timer.
The hold time must be configured to be at least 2 x the refresh-time. If the hold time
expires, the session is considered to be down. This, in turn, triggers a session restart event.
During a session restart, the routing device attempts to start a session with the cache
server that has the numerically highest preference.
idle-after-switch-over
Description Configure the routing device so that it does not automatically reestablish BGP peer
sessions after a nonstop active routing (NSR) switchover. This feature is particularly
useful if you are using dynamic routing policies because the dynamic database is not
synchronized with the backup Routing Engine when NSR is enabled.
Options forever—Do not reestablish a BGP peer session after an non-stop routing switchover until
the clear bgp neighbor command is issued.
seconds—Do not reestablish a BGP peer session after an non-stop routing switchover
until after the specified period.
32
Range: 1 through 4,294,967,295 (2 – 1)
Related • Preventing Automatic Reestablishment of BGP Peer Sessions After NSR Switchovers
Documentation
• Routing Policy Feature Guide for Routing Devices
Description Apply one or more routing policies to routes being imported into the Junos OS routing
table from BGP.
If you specify more than one policy, they are evaluated in the order specified, from left
to right, and the first matching filter is applied to the route. If no match is found, BGP
places into the routing table only those routes that were learned from BGP routing devices.
The policy framework software evaluates the routing policies in a chain sequentially. If
an action specified in one of the policies manipulates a route characteristic, the policy
framework software carries the new route characteristic forward during the evaluation
of the remaining policies. For example, if the action specified in the first policy of a chain
sets a route’s metric to 500, this route matches the criterion of metric 500 defined in the
next policy.
It is also important to understand that in Junos OS, although an import policy (inbound
route filter) might reject a route, not use it for traffic forwarding, and not include it in an
advertisement to other peers, the router retains these routes as hidden routes. These
hidden routes are not available for policy or routing purposes. However, they do occupy
memory space on the router. A service provider filtering routes to control the amount of
information being kept in memory and processed by a router might want the router to
entirely drop the routes being rejected by the import policy.
Hidden routes can be viewed by using the show route receive-protocol bgp neighbor-address
hidden command. The hidden routes can then be retained or dropped from the routing
table by configuring the keep all | none statement at the [edit protocols bgp] or [edit
protocols bgp group group-name] hierarchy level.
• By default, all routes learned from BGP are retained, except those where the AS path
is looped. (The AS path includes the local AS.)
• By configuring the keep all statement, all routes learned from BGP are retained, even
those with the local AS in the AS path.
• By configuring the keep none statement, all routes received are discarded. When this
statement is configured and the inbound policy changes, Junos OS re-advertises all
the routes advertised by the peer.
include-mp-next-hop
Syntax include-mp-next-hop;
inet-mdt (Signaling)
Syntax signaling {
accepted-prefix-limit {
maximum number;
teardown <percentage-threshold> idle-timeout (forever | minutes);
}
add-path {
send {
path-count number;
prefix-policy [ policy-names ];
}
receive;
}
aigp [disable];
loops number;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
rib-group group-name;
}
Description For draft-rosen 7, on the provider edge router enable BGP intra-AS auto-discovery using
MDT-SAFI.
Description Specify a security association to BGP peers. You can apply the security association
globally for all BGP peers, to a group of peers, or to an individual peer.
iso-vpn
Syntax iso-vpn {
unicast {
prefix-limit number;
rib-group group-name;
}
}
Description Enable BGP to carry ISO VPN NLRI messages between PE routes connecting a VPN.
Default Disabled.
keep
Description Control whether or not Junos OS keeps in memory and hides certain routes.
If the keep none statement is used, Junos OS does not retain in memory and hide routes
that are rejected because of a BGP import policy. Nor does BGP keep in memory and
hide routes that are declared unfeasible due to BGP sanity checks. The keep none
statement causes Junos OS to discard from memory the routes that are rejected due to
BGP-specific logic or BGP evaluation. When a route is rejected because of some
non-BGP-specific reason, the keep none statement has no effect on this route. This
rejected route is retained in memory and hidden even though keep none is configured.
An example of this type of hidden route is a route for which the protocol nexthop is
unresolved.
The routing table can retain the route information learned from BGP in one of the following
ways:
• Default (omit the keep statement)—Keep all route information that was learned from
BGP, except for routes whose AS path is looped and whose loop includes the local AS.
• keep all—Keep all route information that was learned from BGP.
• keep none—Discard routes that were received from a peer and that were rejected by
import policy or other sanity checking, such as AS path or next hop. When you configure
keep none for the BGP session and the inbound policy changes, Junos OS forces
readvertisement of the full set of routes advertised by the peer.
In an AS path healing situation, routes with looped paths theoretically could become
usable during a soft reconfiguration when the AS path loop limit is changed. However,
there is a significant memory usage difference between the default and keep all.
• A peer readvertises routes back to the peer from which it learned them.
• Another vendor's routing device advertises the routes back to the sending peer.
• The Junos OS peer’s default behavior of not readvertising routes back to the sending
peer is overridden by configuring advertise-peer-as.
• A provider edge (PE) routing device discards any VPN route that does not have any of
the expected route targets.
When keep all is configured, the behavior of discarding routes received in the above
scenarios is overridden.
CAUTION: When you configure keep (all | none), the associated BGP sessions
are restarted.
Default By default, BGP retains incoming rejected routes in memory and hides them. If you do
not include the keep statement, most routes are retained in the routing table. BGP keeps
all route information that was learned from BGP, except for routes whose AS path is
looped and whose loop includes the local AS.
none—Discard routes that were received from a peer and that were rejected by import
policy or other sanity checking. When keep none is configured for the BGP session
and the inbound policy changes, Junos OS forces readvertisement of the full set of
routes advertised by the peer.
Description Associate a security key with the specified BFD session using the name of the security
keychain. Each key has a unique start time within the keychain. Keychain authentication
allows you to change the password information periodically without bringing down
peering sessions. This keychain authentication method is referred to as hitless because
the keys roll over from one to the next without resetting any peering sessions or interrupting
the routing protocol.
Options key-chain-name—Name of the authentication keychain. The keychain name must match
one of the keychains configured with the key-chain key-chain-name statement at the
[edit security authentication-key-chain] hierarchy level.
Syntax labeled-unicast {
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
aggregate-label {
community community-name;
}
explicit-null {
connected-only;
}
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
protection;
resolve-vpn;
rib (inet.3 | inet6.3);
rib-group group-name;
}
Hierarchy Level [edit logical-systems logical-system-name protocols bgp family (inet | inet6)],
[edit logical-systems logical-system-name protocols bgp group group-name family (inet |
inet6)],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family (inet | inet6)],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp family (inet | inet6)],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name family (inet | inet6)],
[edit logical-systems logical-system-name routing-instances routing-instance-name
protocols bgp group group-name neighbor address family (inet | inet6)],
[edit protocols bgp family (inet | inet6)],
[edit protocols bgp group group-name family (inet | inet6)],
[edit protocols bgp group group-name neighbor address family (inet | inet6)],
[edit routing-instances routing-instance-name protocols bgp family (inet | inet6)],
[edit routing-instances routing-instance-name protocols bgp group group-name family (inet
| inet6)],
[edit routing-instances routing-instance-name protocols bgp group group-name neighbor
address family (inet | inet6)]
Description Specify the address of the local end of a BGP session. This address is used to accept
incoming connections to the peer and to establish connections to the remote peer. When
none of the operational interfaces are configured with the specified local address, a
session with a BGP peer is placed in the idle state.
You generally configure a local address to explicitly configure the system’s IP address
from BGP’s point of view. This IP address can be either an IPv6 or IPv4 address. Typically,
an IP address is assigned to a loopback interface, and that IP address is configured here.
For internal BGP (IBGP) peering sessions, generally the loopback interface (lo0) is used
to establish connections between the IBGP peers. The loopback interface is always up
as long as the device is operating. If there is a route to the loopback address, the IBGP
peering session stays up. If a physical interface address is used instead and that interface
goes up and down, the IBGP peering session also goes up and down. Thus, the loopback
interface provides fault tolerance in case the physical interface or the link goes down, if
the device has link redundancy.
When a device peers with a remote device’s loopback interface address, the local device
expects BGP update messages to come from (be sourced by) the remote device’s
loopback interface address. The local-address statement enables you to specify the
source information in BGP update messages. If you omit the local-address statement,
the expected source of BGP update messages is based on the device’s source address
selection rules, which normally result in the egress interface address being the expected
source of update messages. When this happens, the peering session is not established
because a mismatch exists between the expected source address (the egress interface
of the peer) and the actual source (the loopback interface of the peer). To ensure that
the expected source address matches the actual source address, specify the loopback
interface address in the local-address statement.
NOTE: Although a BGP session can be established when only one of the
paired routing devices has local-address configured, we strongly recommend
that you configure local-address on both paired routing devices for IBGP and
multihop EBGP sessions. The local-address statement ensures that
deterministic fixed addresses are used for the BGP session end-points.
Default If you do not configure a local address, BGP uses the routing device’s source address
selection rules to set the local address.
Related • Example: Configuring Internal BGP Peering Sessions on Logical Systems on page 54
Documentation
• Example: Configuring Internal BGP Peer Sessions on page 43
• router-id
Description Configure a local IP address of the session. If the local cache server has inbound firewall
filtering, it might be necessary to specify a local IP address to use for this session.
Options local-ip-address—Local IP address to be used for the outgoing connection to the cache
server.
local-as
Description Specify the local autonomous system (AS) number. An AS is a set of routing devices
that are under a single technical administration and generally use a single interior gateway
protocol (IGP) and metrics to propagate routing information within the set of routing
devices.
Internet service providers (ISPs) sometimes acquire networks that belong to a different
AS. When this occur, there is no seamless method for moving the BGP peers of the
acquired network to the AS of the acquiring ISP. The process of configuring the BGP peers
with the new AS number can be time-consuming and cumbersome. In this case, it might
not be desirable to modify peer arrangements or configuration. During this kind of transition
period, it can be useful to configure BGP-enabled devices in the new AS to use the former
AS number in BGP updates. This former AS number is called a local AS.
NOTE: If you are using BGP on the routing device, you must configure an AS
number before you specify the local as number.
In Junos OS Release 9.3 and later, you can also configure a 4-byte AS number
using the AS-dot notation format of two integer values joined by a period:
<16-bit high-order value in decimal>.<16-bit low-order value in decimal>. For
Options alias—(Optional) Configure the local AS as an alias of the global AS number configured
for the router at the [edit routing-options] hierarchy level. As a result, a BGP peer
considers any local AS to which it is assigned as equivalent to the primary AS number
configured for the routing device. When you use the alias option, only the AS (global
or local) used to establish the BGP session is prepended in the AS path sent to the
BGP neighbor.
autonomous-system—AS number.
32
Range: 1 through 4,294,967,295 (2 – 1) in plain-number format
Range: 0.0 through 65535.65535 in AS-dot notation format
NOTE: If you configure the local AS values for any BGP group, the detection
of routing loops is performed using both the AS and the local AS values for
all BGP groups.
If the local AS for the EBGP or IBGP peer is the same as the current AS, do
not use the local-as statement to specify the local AS number.
When you configure the local AS within a VRF, this impacts the AS path
loop-detection mechanism. All of the local-as statements configured on the
device are part of a single AS domain. The AS path loop-detection mechanism
is based on looking for a matching AS present in the domain.
Range: 1 through 10
Default: 1
private—(Optional) Configure to use the local AS only during the establishment of the
BGP session with a BGP neighbor but to hide it in the AS path sent to external BGP
peers. Only the global AS is included in the AS path sent to external peers.
NOTE: The private and alias options are mutually exclusive. You cannot
configure both options with the same local-as statement.
• autonomous-system
local-interface (IPv6)
Description Specify the interface name of the EBGP peer that uses IPv6 link-local addresses. This
peer is link-local in scope.
Related • Example: Configuring Internal BGP Peering Sessions on Logical Systems on page 54
Documentation
• Example: Configuring Internal BGP Peer Sessions on page 43
• Example: Configuring External BGP on Logical Systems with IPv6 Interfaces on page 27
local-preference
Description Modify the value of the LOCAL_PREF path attribute, which is a metric used by BGP sessions
to indicate the degree of preference for an external route. The route with the highest local
preference value is preferred.
The LOCAL_PREF path attribute always is used in inbound routing policy and is advertised
to internal BGP peers and to neighboring confederations. It is never advertised to external
BGP peers.
Default If you omit this statement, the LOCAL_PREF path attribute, if present, is not modified.
Options local-preference—Preference to assign to routes learned from BGP or from the group or
peer.
32
Range: 0 through 4,294,967,295 (2 – 1)
Default: If the LOCAL_PREF path attribute is present, do not modify its value. If a BGP
route is received without a LOCAL_PREF attribute, the route is handled locally (it is
stored in the routing table and advertised by BGP) as if it were received with a
LOCAL_PREF value of 100. By default, non-BGP routes that are advertised by BGP
are advertised with a LOCAL_PREF value of 100.
Related • Example: Configuring the Local Preference Value for BGP Routes on page 66
Documentation
• Understanding Internal BGP Peering Sessions on page 42
Syntax log-updown;
Description Specify to generate a log a message whenever a BGP peer makes a state transition.
Messages are logged using the system logging mechanism located at the [edit system
syslog] hierarchy level.
logical-systems
Syntax logical-systems {
logical-system-name {
...logical-system-configuration...
}
}
loops
Description Globally, for the local-AS BGP attribute, or the specified address family, allow the local
device’s AS number to be in the received AS paths, and specify the number of times
detection of the local device’s AS number in the AS_PATH attribute causes the route to
be discarded or hidden. For example, if you configure loops 1, the route is hidden if the
local device’s AS number is detected in the path one or more times. This prevents routing
loops and is the default behavior. If you configure loops 2, the route is hidden if the local
device’s AS number is detected in the path two or more times.
• inet unicast
• inet-vpn multicast
• inet6 any
• l2vpn auto-discovery-only
• ...
This list is truncated for brevity. For a complete list of protocol families for which you can
specify the loops statement, enter the help apropos loops configuration command at the
[edit protcols bgp] hierarchy level on your device.
NOTE: When you configure the loops statement for a specific BGP address
family, that value is used to evaluate the AS path for routes received by a
BGP peer for the specified address family, rather than the loops value
configured for the global AS number with the loops statement at the [edit
routing-options autonomous-system as-number] hierarchy level.
Options number—Number of times detection of the AS number in the AS_PATH attribute causes
the route to be discarded or hidden.
Range: 1 through 10
Default: 1
Syntax loose-check ;
Description Specify loose authentication checking on the BFD session. Use loose authentication for
transitional periods only when authentication might not be configured at both ends of
the BFD session.
If the number of sessions in a group exceeds the max-sessions value, the connections
are established in order by preference value. A numerically higher preference results in a
higher probability for session establishment. The order of session establishment is random
among sessions with equal preferences.
Description Configure the maximum prefix-length for a route validation (RV) record. This is a required
statement.
Description Specify the metric for all routes sent using the multiple exit discriminator (MED, or
MULTI_EXIT_DISC) path attribute in update messages. This path attribute is used to
discriminate among multiple exit points to a neighboring AS. If all other factors are equal,
the exit point with the lowest metric is preferred.
You can specify a constant metric value by including the metric option. For configurations
in which a BGP peer sends third-party next hops that require the local system to perform
next-hop resolution—IBGP configurations, configurations within confederation peers, or
EBGP configurations that include the multihop command—you can specify a variable
metric by including the minimum-igp or igp option.
You can increase or decrease the variable metric calculated from the IGP metric (either
from the igp or minimum-igp statement) by specifying a value for offset. The metric is
increased by specifying a positive value for offset, and decreased by specifying a negative
value for offset.
In Junos OS Release 9.0 and later, you can specify that a BGP group or peer not advertise
updates for the MED path attributes used to calculate IGP costs for BGP next hops unless
the MED is lower. You can also configure an interval to delay when MED updates are sent
by including the med-igp-update-interval minutes statement at the [edit routing-options]
hierarchy level.
Options delay-med-update—Specify that a BGP group or peer configured with the metric-out igp
statement not advertise MED updates unless the current MED value is lower than
the previously advertised MED value, or another attribute associated with the route
has changed, or the BGP peer is responding to a refresh route request.
igp—Set the metric to the most recent metric value calculated in the IGP to get to the
BGP next hop. Routes learned from an EBGP peer usually have a next hop on a
directly connected interface and thus the IGP value is equal to zero. This is the value
advertised.
minimum-igp—Set the metric to the minimum metric value calculated in the IGP to get
to the BGP next hop. If a newly calculated metric is greater than the minimum metric
value, the metric value remains unchanged. If a newly calculated metric is lower, the
metric value is lowered to that value. When you change a neighbor’s export policy
from any configuration to a configuration that sets the minimum IGP offset on an
exported route, the advertised MED is not updated if the value would increase as a
result, even if the previous configuration does not use a minimum IGP-based MED
value. This behavior helps to prevent unnecessary route flapping when an IGP cost
changes, by not forcing a route update if the metric value increases past the previous
lowest known value.
Related • Example: Associating the MED Path Attribute with the IGP Metric and Delaying MED
Documentation Updates on page 106
• med-igp-update-interval
Description Configure the minimum interval after which the local routing device transmits hello
packets and then expects to receive a reply from a neighbor with which it has established
a BFD session. Optionally, instead of using this statement, you can specify the minimum
transmit and receive intervals separately using the minimum-interval (specified under
the transmit-interval statement) and minimum-receive-interval statements.
Options milliseconds—Specify the minimum interval value for BFD liveliness detection.
Range: 1 through 255,000
minimum-interval (transmit-interval)
Description Configure the minimum interval at which the local routing device transmits hello packets
to a neighbor with which it has established a BFD session. Optionally, instead of using
this statement at this hierarchy level, you can configure the minimum transmit interval
using the minimum-interval statement at the bfd-liveness-detection hierarchy level.
Description Configure the minimum interval after which the local routing device must receive a reply
from a neighbor with which it has established a BFD session. Optionally, instead of using
this statement, you can configure the minimum receive interval using the minimum-interval
statement.
mtu-discovery
Syntax mtu-discovery;
TCP path MTU discovery enables BGP to automatically discover the best TCP path MTU
for each BGP session. In Junos OS, TCP path MTU discovery is disabled by default for all
BGP neighbor sessions.
When MTU discovery is disabled, TCP sessions that are not directly connected transmit
packets of 512-byte maximum segment size (MSS). These small packets minimize the
chances of packet fragmentation at a device along the path to the destination. However,
because most links use an MTU of at least 1500 bytes, 512-byte packets do not result in
the most efficient use of link bandwidth. For directly connected EBGP sessions, MTU
mismatches prevent the BGP session from being established. As a workaround, enable
path MTU discovery within the EBGP group.
Path MTU discovery dynamically determines the MTU size on the network path between
the source and the destination, with the goal of avoiding IP fragmentation. Path MTU
discovery works by setting the Don’t Fragment (DF) bit in the IP headers of outgoing
packets. When a device along the path has an MTU that is smaller than the packet, the
device drops the packet. The device also sends back an ICMP Fragmentation Needed
(Type 3, Code 4) message that contains the device’s MTU, thus allowing the source to
reduce its path MTU appropriately. The process repeats until the MTU is small enough
to traverse the entire path without fragmentation.
Related • Example: Limiting TCP Segment Size for BGP on page 449
Documentation
• Configuring the Junos OS for IPv6 Path MTU Discovery
• Configuring the Junos OS for Path MTU Discovery on Outgoing GRE Tunnel Connections
multihop
Syntax multihop {
no-nexthop-change;
ttl ttl-value;
}
For Layer 3 VPNs, you configure the EBGP multihop session between the PE and CE
routing devices. This allows you to configure one or more routing devices between the
PE and CE routing devices.
If you have external BGP confederation peer-to-loopback addresses, you still need the
multihop configuration.
Default If you omit this statement, all EBGP peers are assumed to be directly connected (that
is, you are establishing a nonmultihop, or “regular,” BGP session), and the default
time-to-live (TTL) value is 1.
Syntax multipath {
multiple-as;
vpn-unequal-cost equal-external-internal;
}
Description Allow load sharing among multiple EBGP paths and multiple IBGP paths. A path is
considered a BGP equal-cost path (and will be used for forwarding) if a tie-break is
performed. The tie-break is performed after the BGP route path selection step that
chooses the next-hop path that is resolved through the IGP route with the lowest metric.
All paths with the same neighboring AS, learned by a multipath-enabled BGP neighbor,
are considered.
Options multiple-as—Disable the default check requiring that paths accepted by BGP multipath
must have the same neighboring AS.
Description Configure the number of hello packets not received by a neighbor that causes the
originating interface to be declared down.
rib-group group-name;
topology name {
community {
target identifier;
}
}
}
}
route-target {
advertise-default;
external-paths number;
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
}
signaling {
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
}
}
graceful-restart {
disable;
restart-time seconds;
stale-routes-time seconds;
}
hold-time seconds;
import [ policy-names ];
ipsec-sa ipsec-sa;
keep (all | none);
local-address address;
local-as autonomous-system <private>;
local-interface interface-name;
local-preference preference;
log-updown;
metric-out (metric | minimum-igp <offset> | igp <offset>);
mtu-discovery;
multihop <ttl-value>;
multipath {
multiple-as;
}
no-aggregator-id;
no-client-reflect;
out-delay seconds;
passive;
peer-as autonomous-system;
preference preference;
tcp-mss segment-size;
traceoptions {
file filename <files number> <size size> <world-readable | no-world-readable>;
Description Explicitly configure a neighbor (peer). To configure multiple BGP peers, include multiple
neighbor statements.
By default, the peer’s options are identical to those of the group. You can override these
options by including peer-specific option statements within the neighbor statement.
The neighbor statement is one of the statements you can include in the configuration to
define a minimal BGP configuration on the routing device. (You can include an allow all
statement in place of a neighbor statement.)
Syntax no-adaptation;
Description Configure BFD sessions not to adapt to changing network conditions. We recommend
that you do not disable BFD adaptation unless it is preferable to have BFD adaptation
disabled in your network.
no advertise-peer-as
Syntax no-advertise-peer-as;
no-aggregator-id
Syntax no-aggregator-id;
Description Prevent different routing devices within an AS from creating aggregate routes that contain
different AS paths.
Junos OS performs route aggregation, which is the process of combining the characteristics
of different routes so that only a single route is advertised. Aggregation reduces the
amount of information that BGP must store and exchange with other BGP systems. When
aggregation occurs, the local routing device adds the local AS number and the router ID
to the aggregator path attiribute. The no-aggregator-id statement causes Junos OS to
place a 0 in the router ID field and thus eliminate the possibility of having multiple
aggregate advertisements in the network, each with different path information.
Default If you omit this statement, the router ID is included in the BGP aggregator path attribute.
no-client-reflect
Syntax no-client-reflect;
Description Disable intracluster route redistribution by the system acting as the route reflector. Include
this statement when the client cluster is fully meshed to prevent the sending of redundant
route advertisements. Route reflection provides a way to decrease BGP control traffic
and minimizing the number of update messages sent within the AS.
Description Specify that the BGP next-hop value not be changed. For route advertisements, specify
the no-nexthop-self option.
If you have external BGP confederation peer-to-loopback addresses, you still need the
multihop configuration.
Default If you omit this statement, all EBGP peers are assumed to be directly connected (that
is, you are establishing a nonmultihop, or “regular,” BGP session), and the default
time-to-live (TTL) value is 1.
no-validate
Hierarchy Level [edit protocols bgp group group-name family (inet | inet flow)],
[edit protocols bgp group group-name neighbor address family (inet | inet flow)],
[edit routing-instances routing-instance-name protocols bgp group group-name family (inet
| inet flow)],
[edit routing-instances routing-instance-name protocols bgp group group-name neighbor
address family (inet | inet flow)]
Description When BGP is carrying flow-specification network layer reachability information (NLRI)
messages, the no-validate statement omits the flow route validation procedure after
packets are accepted by a policy.
The receiving BGP-enabled device accepts a flow route if it passes the following criteria:
• The originator of a flow route matches the originator of the best match unicast route
for the destination address that is embedded in the route.
• There are no more specific unicast routes, when compared to the destination address
of the flow route, for which the active route has been received from a different next-hop
autonomous system.
The first criterion ensures that the filter is being advertised by the next-hop used by
unicast forwarding for the destination address embedded in the flow route. For example,
if a flow route is given as 10.1.1.1, proto=6, port=80, the receiving BGP-enabled device
selects the more specific unicast route in the unicast routing table that matches the
destination prefix 10.1.1.1/32. On a unicast routing table containing 10.1/16 and 10.1.1/24,
the latter is chosen as the unicast route to compare against. Only the active unicast route
entry is considered. This follows the concept that a flow route is valid if advertised by
the originator of the best unicast route.
The second criterion addresses situations in which a given address block is allocated to
different entities. Flows that resolve to a best-match unicast route that is an aggregate
route are only accepted if they do not cover more specific routes that are being routed
to different next-hop autonomous systems.
You can bypass the validation process and use your own specific import policy. To disable
the validation procedure and use an import policy instead, include the no-validate
statement in the configuration.
Flow routes configured for VPNs with family inet-vpn are not automatically validated,
so the no-validate statement is not supported at the [edit protocols bgp group group-name
family inet-vpn] hierarchy level. No validation is needed if the flow routes are configured
locally between devices in a single AS.
Description Configure the legitimate originator autonomous system (AS). This is a required statement.
out-delay
Description Control how often BGP and the routing table exchange route information by specifying
how long a route must be present in the Junos OS routing table before it is exported to
BGP. Use this time delay to help bundle routing updates and to avoid sending updates
too often.
Alternatively or in addition, external BGP (EBGP) sessions can also use the route-flap
damping mechanism upon the reception of BGP messages coming from an external
neighbor.
BGP stores the route information it receives from update messages in the routing table,
and the routing table exports active routes from the routing table into BGP. BGP then
advertises the exported routes to its peers. The out-delay statement enables a form of
rate limiting. The delay is added to each update for each prefix individually. When a
routing device changes its best path to a destination prefix, the device does not inform
its peer about the change unless the route has been present in its routing table for the
specified out-delay. If you use out-delay to perform rate-limiting, you can expect a less
bursty pattern of updates. You will see a pattern in which updates arrive in a steady flow,
and two updates for the same prefix are always spaced by at least the out-delay timer
value (for example, 30 seconds). Thus, the out-delay setting is useful for limiting oscillation
(sometimes called churn) in a network. Keep in mind that, regardless of the out-delay
setting, BGP peers exchange routes immediately after neighbor establishment. The
out-delay setting is only designed to delay the exchange of routes between BGP and the
local routing table.
When configured, the out-delay value displays as Outbound Timer when using show bgp
group or show bgp group neighbor commands.
Default By default, the exchange of route information between BGP and the routing table occurs
immediately after the routes are received. This immediate exchange of route information
might cause instabilities in the network reachability information. If you omit this statement,
routes are exported to BGP immediately after they have been added to the routing table.
outbound-route-filter
Syntax outbound-route-filter {
bgp-orf-cisco-mode;
prefix-based {
accept {
(inet | inet6);
}
}
}
Description Configure a BGP peer to accept outbound route filters from a remote peer.
Options accept—Specify that outbound route filters from a BGP peer be accepted.
NOTE: You can specify that both IPv4 and IPv6 outbound route filters be
accepted.
Related • Example: Configuring BGP Prefix-Based Outbound Route Filtering on page 219
Documentation
Syntax passive;
Description Configure the routing device so that active open messages are not sent to the peer. Once
you configure the routing device to be passive, the routing device will wait for the peer
to issue an open request before a message is sent.
Default If you omit this statement, all explicitly configured peers are active, and each peer
periodically sends open requests until its peer responds.
Related • Example: Preventing BGP Session Flaps When VPN Families Are Configured on page 477
Documentation
path-count
Hierarchy Level [edit logical-systems logical-system-name protocols bgp group group-name family family
add-path send],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family family add-path send],
[edit protocols bgp group group-name family family add-path send],
[edit protocols bgp group group-name family family add-path neighbor address family family
add-path send]
Suppose a routing device has in its routing table four paths to a destination and is
configured to advertise up to three paths (add-path send path-count 3). The three paths
are chosen based on path selection criteria. That is, the three best paths are chosen in
path-selection order. The best path is the active path. This path is removed from
consideration and a new best path is chosen. This process is repeated until the specified
number of paths is reached.
path-selection
Syntax path-selection {
(always-compare-med | cisco-non-deterministic | external-router-id);
as-path-ignore;
l2vpn-use-bgp-rules;
med-plus-igp {
igp-multiplier number;
med-multiplier number;
}
}
Default If the path-selection statement is not included in the configuration, only the multiple exit
discriminators (MEDs) of routes that have the same peer ASs are compared.
Options always-compare-med—Always compare MEDs whether or not the peer ASs of the
compared routes are the same.
as-path-ignore—In the best-path algorithm, skip the step that compares the autonomous
system (AS) path lengths. By default, the best-path algorithm evaluates the length
of the AS paths and prefers the route with the shortest AS path length.
in which they were received, with the most recent path first. Ineligible paths remain
at the end of the list.
As an example, suppose you have three path advertisements for the 192.168.1.0 /24 route:
• Path 2—learned through IBGP; AS Path of 65020; MED of 150; IGP cost of 5
• Path 3—learned through IBGP; AS Path of 65010; MED of 100; IGP cost of 10
These advertisements are received in quick succession, within a second, in the order
listed. Path 3 is received most recently, so the routing device compares it against
path 2, the next most recent advertisement. The cost to the IBGP peer is better for
path 2, so the routing device eliminates path 3 from contention. When comparing
paths 1 and 2, the routing device prefers path 1 because it is received from an EBGP
peer. This allows the routing device to install path 1 as the active path for the route.
igp-multiplier number—The multiplier value for the IGP cost to a next-hop address. This
option is useful for making the MED and IGP cost comparable.
Range: 1 through 1000
Default: 1
med-multiplier number—The multiplier value for the MED calculation. This option is useful
for making the MED and IGP cost comparable.
Range: 1 through 1000
Default: 1
med-plus-igp—Add the IGP cost to the indirect next-hop destination to the MED before
comparing MED values for path selection. This statement only affects best-path
selection. It does not affect the advertised MED.
For EBGP, the peer is in another AS, so the AS number you specify in the peer-as statement
must be different from the local router’s AS number, which you specify in the
autonomous-system statement. For IBGP, the peer is in the same AS, so the two AS
numbers that you specify in the autonomous-system and peer-as statements must be
the same.
The AS numeric range in plain-number format has been extended in Junos OS Release 9.1
to provide BGP support for 4-byte AS numbers, as defined in RFC 4893, BGP Support for
Four-octet AS Number Space. RFC 4893 introduces two new optional transitive BGP
attributes, AS4_PATH and AS4_AGGREGATOR. These new attributes are used to
propagate 4-byte AS path information across BGP speakers that do not support 4-byte
AS numbers. RFC 4893 also introduces a reserved, well-known, 2-byte AS number, AS
23456. This reserved AS number is called AS_TRANS in RFC 4893. All releases of the
Junos OS support 2-byte AS numbers.
In Junos OS Release 9.2 and later, you can also configure a 4-byte AS number using the
AS-dot notation format of two integer values joined by a period: <16-bit high-order value
in decimal>.<16-bit low-order value in decimal>. For example, the 4-byte AS number
of 65,546 in plain-number format is represented as 1.10 in the AS-dot notation format.
With the introduction of 4-byte AS numbers, you might have a combination of routers
that support 4-byte AS numbers and 2-byte AS numbers. For more information about
what happens when establishing BGP peer relationships between 4-byte and 2-byte
capable routers, see the following topics:
Related
Documentation
Description Configure an alternative TCP port number to be used for the outgoing connection with
the cache server. The well-known resource public key infrastructure (RPKI) port is TCP
port 2222. For a given deployment, an RPKI cache server might listen on some other TCP
port number. If so, configure the alternative port number with this statement.
Options port-number—TCP port number to be used for the outgoing connection to the cache
server.
Default: 2222
precision-timers
Syntax precision-timers;
Description Enable BGP sessions to send frequent keepalive messages with a hold time as short as
10 seconds.
NOTE: The hold time is three times the interval at which keepalive messages
are sent, and the hold time is the maximum number of seconds allowed to
elapse between successive keepalive messages that BGP receives from a
peer. When establishing a BGP connection with the local routing device, a
peer sends an open message, which contains a hold-time value. BGP on the
local routing device uses the smaller of either the local hold-time value or
the peer’s hold-time value as the hold time for the BGP connection between
the two peers.
The default hold-time is 90 seconds, meaning that the default frequency for
keepalive messages is 30 seconds. More frequent keepalive messages and
shorter hold times might be desirable in large-scale deployments with many
active sessions (such as edge or large VPN deployments). To configure the
hold time and the frequency of keepalive messages, include the hold-time
statement at the [edit protocols bgp] hierarchy level. You can configure the
hold time at a logical system, routing instance, global, group, or neighbor
level. When you set a hold time value to less than 20 seconds, we recommend
that you also configure the BGP precision-timers statement. The
precision-timers statement ensures that if scheduler slip messages occur,
the routing device continues to send keepalive messages. When the
precision-timers statement is included, keepalive message generation is
performed in a dedicated kernel thread, which helps to prevent BGP session
flaps.
At the BGP global level, the preference statement sets the preference for routes learned
from BGP. You can override this preference in a BGP group or peer preference statement.
At the group or peer level, the preference statement sets the preference for routes learned
from the group or peer. Use this statement to override the preference set in the BGP
global preference statement when you want to favor routes from one group or peer over
those of another.
Options preference—Preference to assign to routes learned from BGP or from the group or peer.
32
Range: 0 through 4,294,967,295 (2 – 1)
Default: 170 for the primary preference
Description Each resource public key infrastructure (RPKI) cache server has a static preference.
Higher preferences are preferred. During a session start or restart, the routing device
attempts to start a session with the cache server that has the numerically highest
preference. The routing device connects to multiple cache servers in preference order.
prefix-limit
Syntax prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | minutes)>;
}
Hierarchy Level [edit logical-systems logical-system-name protocols bgp family (inet | inet6) (any | flow |
labeled-unicast | multicast | unicast)],
[edit logical-systems logical-system-name protocols bgp group group-name family (inet |
inet6) (any | flow | labeled-unicast | multicast | unicast)],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family (inet | inet6) (any | flow | labeled-unicast | multicast | unicast)],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp family (inet | inet6) (any | flow | labeled-unicast | multicast | unicast)],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name family (inet | inet6) (any | flow | labeled-unicast | multicast |
unicast)],
[edit logical-systems logical-system-name routing-instances routing-instance-name
protocols bgp group group-name neighbor address family (inet | inet6) (any | flow
| labeled-unicast | multicast | unicast)],
[edit protocols bgp family (inet | inet6) (any | flow | labeled-unicast | multicast | unicast)],
[edit protocols bgp group group-name family (inet | inet6) (any | labeled-unicast | multicast
| unicast)],
[edit protocols bgp group group-name neighbor address family (inet | inet6) (any | flow
| labeled-unicast | multicast | unicast)],
[edit routing-instances routing-instance-name protocols bgp family (inet | inet6) (any | flow
| labeled-unicast | multicast | unicast)],
[edit routing-instances routing-instance-name protocols bgp group group-name family (inet
| inet6) (any | flow | labeled-unicast | multicast | unicast)],
[edit routing-instances routing-instance-name protocols bgp group group-name
neighbor address family (inet | inet6) (any | flow | labeled-unicast | multicast | unicast)]
Description Limit the number of prefixes received on a BGP peer session and a rate-limit logging
when injected prefixes exceed a set limit.
Options maximum number—When you set the maximum number of prefixes, a message is logged
when that number is exceeded.
32
Range: 1 through 4,294,967,295 (2 – 1)
teardown <percentage>—If you include the teardown statement, the session is torn down
when the maximum number of prefixes is reached. If you specify a percentage,
messages are logged when the number of prefixes exceeds that percentage. After
the session is torn down, it is reestablished in a short time unless you include the
idle-timeout statement. Then the session can be kept down for a specified amount
of time, or forever. If you specify forever, the session is reestablished only after you
issue a clear bgp neighbor command.
Range: 1 through 100
prefix-policy
Hierarchy Level [edit logical-systems logical-system-name protocols bgp group group-name family family
add-path send],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family family add-path send],
[edit protocols bgp group group-name family family add-path send],
[edit protocols bgp group group-name family family add-path neighbor address family family
add-path send]
Options policy-names—Name of a policy (or a set of policies) configured at the [edit policy-options]
hierarchy level. The policy can match routes, but cannot change route attributes.
Syntax protection;
Hierarchy Level [edit routing-instances <instance-name> protocols bgp family inet unicast]
[edit routing-instances <instance-name> protocols bgp family inet6 unicast]
Description Configure backup path to protect the active provider edge path in a Layer 3 VPN.
Syntax protection;
Hierarchy Level [edit logical-systems logical-system-name protocols bgp group group-name family inet
labeled-unicast],
[edit protocols bgp group group-name family inet labeled-unicast]
Description Configure protection on a link between two routers in different autonomous systems.
protocols
Syntax protocols {
bgp {
... bgp-configuration ...
}
isis {
... isis-configuration ...
}
ldp {
... ldp-configuration ...
}
msdp {
... msdp-configuration ...
}
mstp {
... mstp-configuration ...
}
ospf {
domain-id domain-id;
domain-vpn-tag number;
route-type-community (iana | vendor);
... ospf-configuration ...
}
ospf3 {
domain-id domain-id;
domain-vpn-tag number;
route-type-community (iana | vendor);
... ospf3-configuration ...
}
pim {
... pim-configuration ...
}
rip {
... rip-configuration ...
}
ripng {
... ripng-configuration ...
}
rstp {
rstp-configuration;
}
vstp {
vstp configuration;
}
vpls {
vpls configuration;
}
}
Description Specify the protocol for a routing instance. You can configure multiple instances of many
protocol types. Not all protocols are supported on the switches. See the switch CLI.
msdp—Specify the Multicast Source Discovery Protocol (MSDP) for a routing instance.
mstp—Specify the Multiple Spanning Tree Protocol (MSTP) for a virtual switch routing
instance.
pim—Specify the Protocol Independent Multicast (PIM) protocol for a routing instance.
ripng—Specify RIP next generation (RIPng) as the protocol for a routing instance.
rstp—Specify the Rapid Spanning Tree Protocol (RSTP) for a virtual switch routing
instance.
vstp—Specify the VLAN Spanning Tree Protocol (VSTP) for a virtual switch routing
instance.
Syntax receive;
Hierarchy Level [edit logical-systems logical-system-name protocols bgp group group-name family family
add-path],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family family add-path],
[edit protocols bgp group group-name family family add-path],
[edit protocols bgp group group-name family family add-path neighbor address family family
add-path]
Description Enable the router to receive multiple paths to a destination. You can enable the router
to receive multiple paths from specified neighbors or from all neighbors.
Description Configure the network prefix for the route validation (RV) record.
An RV record matches any route whose prefix matches the RV prefix, whose prefix length
does not exceed the maximum-length given in the RV record, and whose origin AS equals
the origin-autonomous-system given in the RV record. RV records are received from the
cache server using the protocol defined in Internet draft draft-ietf-sidr-rpki-rtr-19, The
RPKI/Router Protocol, and can also be configured statically, as shown here.
Description Configure the amount of time that route validation (RV) records learned from a cache
server are valid. RV records expire if the session to the cache server goes down and
remains down for the record-lifetime (seconds).
Options seconds—Amount of time that an RV remains valid after the session to the cache server
goes down.
Range: 60 (one minute) through 604800 (one week)
Default: 3600 seconds (one hour)
Description Configure a liveliness check interval for a configured resource public key infrastructure
(RPKI) cache server. Every refresh-time (seconds), a serial query protocol data unit (PDU)
with the last known serial number is transmitted. The refresh-time cannot be longer than
half of the hold-time.
remove-private
Description When advertising AS paths to remote systems, have the local system strip private
AS numbers from the AS path. The numbers are stripped from the AS path starting at
the left end of the AS path (the end where AS paths have been most recently added).
The routing device stops searching for private ASs when it finds the first nonprivate AS
or a peer’s private AS. If the AS path contains the AS number of the external BGP (EBGP)
neighbor, BGP does not remove the private AS number.
The operation takes place after any confederation member ASs have already been
removed from the AS path, if applicable.
The Junos OS recognizes the set of AS numbers that is considered private, a range that
is defined in the Internet Assigned Numbers Authority (IANA) assigned numbers document.
The set of reserved AS numbers is in the range from 64,512 through 65,535.
Options all—Remove all private AS numbers from the original path. Do not stop the process of
removing private AS numbers, even if a public AS number is encountered.
nearest—When you use the all and replace options, choose the last (right-most) public
AS number encountered in the original AS path for the replacement value, as the AS
path is processed from left to right. If no public AS number is encountered, the default
replacement value is used. (See the replace option for information about the default
replacement value.)
replace—When you use the all option, instead of a removing private AS numbers, perform
a replace operation. The default replacement value for the private AS number is the
local AS number at the BGP group level for the BGP peer. If you are unsure about
the replacement value, check the local AS value displayed in the output of the show
bgp group group-name command.
resolve-vpn
Syntax resolve-vpn;
Hierarchy Level [edit logical-systems logical-system-name protocols bgp family inet labeled-unicast],
[edit logical-systems logical-system-name protocols bgp group group-name family inet
labeled-unicast],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family inet labeled-unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp family inet labeled-unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name family inet labeled-unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name
protocols bgp group group-name neighbor address family inet labeled-unicast],
[edit protocols bgp family inet labeled-unicast],
[edit protocols bgp group group-name family inet labeled-unicast],
[edit protocols bgp group group-name neighbor address family inet labeled-unicast],
[edit routing-instances routing-instance-name protocols bgp family inet labeled-unicast],
[edit routing-instances routing-instance-name protocols bgp group group-name family inet
labeled-unicast],
[edit routing-instances routing-instance-name protocols bgp group group-name neighbor
address family inet labeled-unicast]
Description Allow labeled routes to be placed in the inet.3 routing table for route resolution. These
routes are then resolved for PE router connections where the remote PE is located across
another AS. For a PE router to install a route in the VRF, the next hop must resolve to a
route stored within the inet.3 table.
Description Configure the duration of the BGP, RIP, or next-generation RIP (RIPng) graceful restart
period.
Hierarchy Level [edit logical-systems logical-system-name protocols bgp family (inet | inet6) labeled-unicast],
[edit logical-systems logical-system-name protocols bgp group group-name family (inet |
inet6) labeled-unicast],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family (inet | inet6) labeled-unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp family (inet | inet6) labeled-unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name family (inet | inet6) labeled-unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name
protocols bgp group group-name neighbor address family (inet | inet6) labeled-unicast],
[edit protocols bgp family (inet | inet6) labeled-unicast],
[edit protocols bgp group group-name family (inet | inet6) labeled-unicast],
[edit protocols bgp group group-name neighbor address family (inet | inet6) labeled-unicast],
[edit routing-instances routing-instance-name protocols bgp family (inet | inet6)
labeled-unicast],
[edit routing-instances routing-instance-name protocols bgp group group-name family (inet
| inet6) labeled-unicast],
[edit routing-instances routing-instance-name protocols bgp group group-name neighbor
address (inet | inet6) labeled-unicast]
Description You can allow both labeled and unlabeled routes to be exchanged in a single session.
The labeled routes are placed in the inet.3 or inet6.3 routing table, and both labeled and
unlabeled unicast routes can be sent or received by the router.
Hierarchy Level [edit logical-systems logical-system-name protocols bgp family inet (labeled-unicast |
unicast | multicast)],
[edit logical-systems logical-system-name protocols bgp group group-name family inet
(labeled-unicast | unicast | multicast)],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family inet (labeled-unicast | unicast | multicast)],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp family inet (labeled-unicast | unicast | multicast)],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name family inet (labeled-unicast | unicast | multicast)],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name neighbor address family inet (labeled-unicast | unicast | multicast)],
[edit protocols bgp family inet (labeled-unicast | unicast | multicast)],
[edit protocols bgp group group-name family inet (labeled-unicast | unicast | multicast)],
[edit protocols bgp group group-name neighbor address family inet (labeled-unicast | unicast
| multicast)],
[edit routing-instances routing-instance-name protocols bgp family inet (labeled-unicast |
unicast | multicast)],
[edit routing-instances routing-instance-name protocols bgp group group-name family inet
(labeled-unicast | unicast | multicast)],
[edit routing-instances routing-instance-name protocols bgp group group-name neighbor
address family inet (labeled-unicast | unicast | multicast)]
Options group-name—Name of the routing table group. The name must start with a letter and
can include letters, numbers, and hyphens. You generally specify only one routing
table group.
Related • Example: Exporting Specific Routes from One Routing Table Into Another Routing Table
Documentation
• Example: Importing Direct and Static Routes Into a Routing Instance
Syntax route-target {
accepted-prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | time-in-minutes)>;
}
advertise-default;
external-paths number;
prefix-limit {
maximum number;
teardown <percentage> <idle-timeout (forever | time-in-minutes)>;
}
}
Description Limit the number of prefixes advertised on BGP peers specifically to the peers that need
the updates.
Related • Example: Configuring an Export Policy for BGP Route Target Filtering
Documentation
• Example: Configuring Proxy BGP Route Target Filtering
Description Configure an additional routing entity for a router. You can create multiple instances of
BGP, IS-IS, OSPF, OSPFv3, and RIP for a router. You can also create multiple routing
instances for separating routing tables, routing policies, and interfaces for individual
wholesale subscribers (retailers) in a Layer 3 wholesale network.
Each routing instance has a unique name and a corresponding IP unicast table. For
example, if you configure a routing instance with the name my-instance, its corresponding
IP unicast table is my-instance.inet.0. All routes for my-instance are installed into
my-instance.inet.0.
Routes are installed into the default routing instance inet.0 by default, unless a routing
instance is specified.
In Junos OS Release 9.0 and later, you can no longer specify a routing-instance name of
master, default, or bgp or include special characters within the name of a routing instance.
In Junos OS Release 9.6 and later, you can include a slash (/) in a routing-instance name
only if a logical system is not configured. That is, you cannot include the slash character
in a routing-instance name if a logical system other than the default is explicitly configured.
Routing-instance names, further, are restricted from having the form __.*__ (beginning
and ending with underscores). The colon : character cannot be used when multitopology
routing (MTR) is enabled.
• Example: Configuring E-LINE and E-LAN Services for a PBB Network on MX Series Routers
Syntax send {
path-count number;
prefix-policy [ policy-names ];
}
Hierarchy Level [edit logical-systems logical-system-name protocols bgp group group-name family inet
unicast add-path],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family inet unicast add-path],
[edit protocols bgp group group-name family inet unicast add-path],
[edit protocols bgp group group-name family inet unicast add-path neighbor address family
inet unicast add-path]
Description Enable advertisement of multiple paths to a destination, instead of advertising only the
active path.
Description Configure a secure shell (SSH) session with a resource public key infrastructure (RPKI)
cache server. The router-to-cache transport protocol is carried using a TCP session to a
configurable port. Caches are organized in groups. The Junos OS implementation supports
up to 63 sessions per group and both IPv4 and IPv6 address families.
session-mode
Description Configure BFD session mode to be single-hop or multihop. By default, BGP uses single-hop
BFD sessions if the peer is directly connected to the router’s interface. BGP uses multihop
BFD sessions if the peer is not directly connected to the router’s interface. If the peer
session’s local-address option is configured, the directly connected check is based partly
on the source address that would be used for BGP and BFD.
For backward compatibility, you can override the default behavior by configuring the
single-hop or multihop option. Before Junos OS Release 11.1, the behavior was to assume
that IBGP peer sessions were multihop.
Options automatic—Configure BGP to use single-hop BFD sessions if the peer is directly connected
to the router’s interface, and multihop BFD sessions if the peer is not directly
connected to the router’s interface
stale-routes-time
Description Specify the maximum time that stale routes are kept during a restart. The stale-routes-time
statement allows you to set the length of time the routing device waits to receive
messages from restarting neighbors before declaring them down.
Options seconds—Time the router waits to receive messages from restarting neighbors before
declaring them down.
Range: 1 through 600 seconds
Default: 300 seconds
Syntax static {
record destination {
maximum-length prefix-length {
origin-autonomous-system as-number {
validation-state (invalid | valid);
}
}
}
}
RV records are received from the cache server using the protocol defined in Internet draft
draft-ietf-sidr-rpki-rtr-19, The RPKI/Router Protocol, and can also be configured statically,
as shown here.
Static records are useful for overwriting the information received from an RPKI cache
server.
An RV record matches any route whose prefix matches the RV prefix record, whose prefix
length does not exceed the maximum-length given in the RV record, and whose origin
AS equals the origin-autonomous-system number given in the RV record.
Description Configure the maximum segment size (MSS) for the TCP connection for BGP neighbors.
The MSS is only valid in increments of 2 KB. The value used is based on the value set, but
is rounded down to the nearest multiple of 2048.
Related • Example: Limiting TCP Segment Size for BGP on page 449
Documentation
threshold (detection-time)
Description Specify the threshold for the adaptation of the BFD session detection time. When the
detection time adapts to a value equal to or greater than the threshold, a single trap and
a single system log message are sent.
NOTE: The threshold value must be equal to or greater than the transmit
interval.
The threshold time must be equal to or greater than the value specified in
the minimum-interval or the minimum-receive-interval statement.
threshold (transmit-interval)
Description Specify the threshold for the adaptation of the BFD session transmit interval. When the
transmit interval adapts to a value greater than the threshold, a single trap and a single
system message are sent.
Hierarchy Level [edit logical-systems logical-system-name protocols bgp family (inet | inet6) unicast],
[edit logical-systems logical-system-name protocols bgp group group-name family (inet |
inet6) unicast],
[edit logical-systems logical-system-name protocols bgp group group-name neighbor address
family (inet | inet6) unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp family (inet | inet6) unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name family (inet | inet6) unicast],
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols
bgp group group-name neighbor address family (inet | inet6) unicast],
[edit protocols bgp family (inet | inet6) unicast],
[edit protocols bgp group group-name family (inet | inet6) unicast],
[edit protocols bgp group group-name neighbor address family (inet | inet6) unicast],
[edit routing-instances routing-instance-name protocols bgp family (inet | inet6) unicast],
[edit routing-instances routing-instance-name protocols bgp group group-name family (inet
| inet6) unicast],
[edit routing-instances routing-instance-name protocols bgp group group-name neighbor
address family (inet | inet6)]
Description Enable a topology for BGP multitopology routing. You must first configure one or more
topologies under the [edit routing-options] hierarchy level.
Apply the community tags to identify the application topologies by configuring a routing
topology name and BGP community value.
In Junos OS, multitopology support for BGP is based on the community value in a BGP
route. This configuration determines the association between a topology and one or
more community values and populates the topology routing tables. Arriving BGP updates
that have a matching community value are replicated in the associated topology routing
table. You decide which BGP community values are associated with a given topology.
For example, you can create a configuration that causes BGP updates that are received
with community value target:40:40 to be added into topology routing table :voice.inet.0
(in addition to the default routing table inet.0). Likewise, you configuration can specify
that updates that are received with community value target:50:50 are added into topology
routing table :video.inet.0 (in addition to the default routing table inet.0).
Options name—Name of a topology you configured at the [edit routing-options] hierarchy level
to create a topology for a specific type of traffic, such as voice or video.
Syntax traceoptions {
file filename <files number> <size size> <world-readable | no-world-readable>;
flag flag <flag-modifier> <disable>;
}
Description Configure BGP protocol-level tracing options. To specify more than one tracing operation,
include multiple flag statements.
Default The default BGP protocol-level tracing options are inherited from the routing protocols
traceoptions statement included at the [edit routing-options] hierarchy level. The default
group-level trace options are inherited from the BGP protocol-level traceoptions
statement. The default peer-level trace options are inherited from the group-level
traceoptions statement.
Options disable—(Optional) Disable the tracing operation. You can use this option to disable a
single operation when you have defined a broad group of tracing operations, such
as all.
file name—Name of the file to receive the output of the tracing operation. Enclose the
name within quotation marks. All files are placed in the directory /var/log. We
recommend that you place BGP tracing output in the file bgp-log.
files number—(Optional) Maximum number of trace files. When a trace file named
trace-file 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.
Range: 2 through 1000 files
Default: 10 files
flag—Tracing operation to perform. To specify more than one tracing operation, include
multiple flag statements.
• 4byte-as—4-byte AS events.
• damping—Damping operations.
• keepalive—BGP keepalive messages. If you enable the the BGP update flag only, received
keepalive messages do not generate a trace message.
• open—Open packets. These packets are sent between peers when they are establishing
a connection.
Default: If you do not specify this option, only unusual or abnormal operations are traced.
• state—State transitions
flag-modifier—(Optional) Modifier for the tracing flag. You can specify one or more of
these modifiers:
• filter—Provide filter trace information. Applies only to route, damping, and update
tracing flags.
size size—(Optional) Maximum size of each trace file, 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.
Syntax: xk to specify KB, xm to specify MB, or xg to specify GB
Range: 10 KB through the maximum file size supported on your system
Default: 128 KB
Required Privilege routing and trace—To view this statement in the configuration.
Level routing-control and trace-control—To add this statement to the configuration.
Syntax traceoptions {
file filename <files number> <size size> <world-readable | no-world-readable>;
flag flag;
}
Description Configure tracing operations for resource public key infrastructure (RPKI) BGP route
validation.
Syntax traffic-statistics {
file filename <world-readable | no-world-readable>;
interval seconds;
}
Hierarchy Level [edit logical-systems logical-system-name protocols bgp family (inet | inet6) labeled-unicast],
[edit logical-systems logical-system-name protocols bgp group group-name family (inet |
inet6) labeled-unicast],
[edit protocols bgp family (inet | inet6) labeled-unicast],
[edit protocols bgp group group-name family (inet | inet6) labeled-unicast]
Description Enable the collection of traffic statistics for interprovider or carrier-of-carriers VPNs.
Options file filename—Specify a filename for the BGP labeled–unicast traffic statistics file. If you
do not specify a filename, statistics are still collected but can only be viewed by using
the show bgp group traffic statistics group-name command.
interval seconds—Specify how often BGP labeled-unicast traffic statistics are collected.
Syntax transmit-interval {
minimum-interval milliseconds;
threshold milliseconds;
}
Description Specify the transmit interval for the bfd-liveness-detection statement. The negotiated
transmit interval for a peer is the interval between the sending of BFD packets to peers.
The receive interval for a peer is the minimum time that it requires between packets sent
from its peer; the receive interval is not negotiated between peers. To determine the
transmit interval, each peer compares its configured minimum transmit interval with its
peer's minimum receive interval. The larger of the two numbers is accepted as the transmit
interval for that peer.
Description Configure the maximum time-to-live (TTL) value for the TTL in the IP header of BGP
packets.
When configuring a BGP group, you can indicate whether the group is an IBGP group or
an EBGP group. All peers in an IBGP group are in the same AS, while peers in an EBGP
group are in different ASs and normally share a subnet.
Syntax validation {
group group-name {
max-sessions number;
session address {
hold-time seconds;
local-address local-ip-address;
port port-number;
preference number;
record-lifetime seconds;
refresh-time seconds;
}
}
static {
record destination {
maximum-length prefix-length {
origin-autonomous-system as-number {
validation-state (invalid | valid);
}
}
}
}
traceoptions {
file filename <files number> <size size> <world-readable | no-world-readable>;
flag flag;
}
Description Configure resource public key infrastructure (RPKI) BGP route validation.
Options invalid—A negative (invalid) validation state. Indicates that the prefix is found, but either
the corresponding AS received from the EBGP peer is not the AS that appears in the
database, or the prefix length in the BGP update message is longer than the maximum
length permitted in the database.
valid—A positive (valid) validation state. Indicates that the prefix and AS pair are found
in the database.
Description Specify the BFD version for detection. You can explicitly configure BFD version 0, version
1, or the routing device can automatically detect the BFD version. By default, the routing
device automatically detects the BFD version, which is either 0 or 1.
Options Configure the BFD version to detect: 0 (BFD version 0), 1 (BFD version 1), or automatic
(autodetect the BFD version)
Default: automatic
vpn-apply-export
Syntax vpn-apply-export;
Description Apply both the VRF export and BGP group or neighbor export policies (VRF first, then
BGP) before routes from the vrf or l2vpn routing tables are advertised to other PE routers.
Administration
• BGP Operational Commands on page 741
prefix—(Optional) Clear route flap damping information for only the specified destination
prefix.
Output Fields When you enter this command, you are provided feedback on the status of your request.
Sample Output
• Change the state of one or more BGP neighbors to IDLE. For neighbors in the
ESTABLISHED state, this command drops the TCP connection to the neighbors and
then reestablishes the connection.
neighbor—(Optional) IP address of a BGP peer. Apply this command only to the specified
neighbor.
soft—(Optional) Reapply any export policies and send refresh updates to neighbors
without clearing the state.
Output Fields When you enter this command, you are provided feedback on the status of your request.
Sample Output
Additional Information In some cases, a prefix limit is associated with a routing table for a VPN instance. When
this limit is exceeded (for example, because of a network misconfiguration), some routes
might not be inserted in the table. Such routes need to be added to the table after the
network issue is resolved. Use the clear bgp table command to request that BGP refresh
routes in a VPN instance table.
Sample Output
clear bgp table inet.6 user@host> clear bgp table inet.6 logical-system all
logical-system all
clear bgp table user@host> clear bgp table private.inet.6 logical-system ls1
private.inet.6
logical-system ls1
clear bgp table user@host> clear bgp table logical-system all inet.0
logical-system all
inet.0
clear bgp table user@host> clear bgp table logical-system ls2 private.inet.0
logical-system ls2
private.inet.0
Options none—Clear the route validation database for all routing instances.
instance instance-name—(Optional) Clear the route validation database for the specified
instance.
Sample Output
Options none—Clear all route validation sessions for all routing instances.
instance instance-name—(Optional) Clear the route validation session for the specified
instance.
soft-inbound—(Optional) Rather than flapping the session to the cache server and
removing its contents from the database, refresh the session information without
removing the database entries.
Sample Output
Options none—Clear the route validation statistics for all routing instances.
instance instance-name—(Optional) Clear the route validation statistics for the specified
instance.
Sample Output
Description When BGP origin validation is configured, manually request a route validation record
policy to be reevaluated. This command causes dependent route validation records to
be reevaluated. Dependent route validation records are exactly matching and more
specific records.
Output Fields When you enter this command, you are provided feedback on the status of your request.
Sample Output
restart
Syntax restart
<adaptive-services |ancpd-service | application-identification |audit-process |
auto-configuration |captive-portal-content-delivery |ce-l2tp-service |chassis-control |
class-of-service |clksyncd-service |database-replication|datapath-trace-service
|dhcp-service | diameter-service | disk-monitoring | dynamic-flow-capture |
ecc-error-logging | ethernet-connectivity-fault-management
|ethernet-link-fault-management |event-processing | firewall
|general-authentication-service | gracefully | iccp-service |idp-policy | immediately
|interface-control | ipsec-key-management | kernel-replication | l2-learning | l2cpd-service
| l2tp-service | l2tp-universal-edge | lacp | license-service |link-management
|local-policy-decision-function |mac-validation |mib-process | mobile-ip | mountd-service
|mpls-traceroute |mspd | multicast-snooping |named-service | nfsd-service |
packet-triggered-subscribers |peer-selection-service |pgcp-service | pgm |
pic-services-logging | pki-service |ppp | ppp-service |pppoe |
protected-system-domain-service | redundancy-interface-process | remote-operations |
root-system-domain-service | routing <logical-system logical-system-name> | sampling
| sbc-configuration-process | sdk-service |service-deployment | services | services pgcp
gateway gateway-name | snmp |soft |static-subscribers |statistics-service|
subscriber-management | subscriber-management-helper | tunnel-oamd |usb-control|
vrrp |web-management>
<gracefully | immediately | soft>
• sfc and all-sfc for the TX Matrix Router in Junos OS Release 9.6.
all-chassis—(TX Matrix and TX Matrix Plus routers only) (Optional) Restart the software
process on all chassis.
all-lcc—(TX Matrix and TX Matrix Plus routers only) (Optional) For a TX Matrix router,
restart the software process on all T640 routers connected to the TX Matrix router.
For a TX Matrix Plus router, restart the software process on all T1600 routers
connected to the TX Matrix Plus router.
all-members—(MX Series routers only) (Optional) Restart the software process for all
members of the Virtual Chassis configuration.
all-sfc—(TX Matrix Plus routers only) (Optional) For a TX Matrix Plus router, restart the
software processes for the TX Matrix Plus router (or switch-fabric chassis).
ce-l2tp-service—(M10, M10i, M7i, and MX Series routers only) (Optional) Restart the
Universal Edge Layer 2 Tunneling Protocol (L2TP) process, which establishes L2TP
tunnels and Point-to-Point Protocol (PPP) sessions through L2TP tunnels.
dhcp—(J Series routers and EX Series switches only) (Optional) Restart the software
process for a Dynamic Host Configuration Protocol (DHCP) server. A DHCP server
allocates network IP addresses and delivers configuration settings to client hosts
without user intervention.
dialer-services—(J Series routers and EX Series switches only) (Optional) Restart the
ISDN dial-out process.
disk-monitoring—(Optional) Restart disk monitoring, which checks the health of the hard
disk drive on the Routing Engine.
dlsw—(J Series routers and QFX Series only) (Optional) Restart the data link switching
(DLSw) service.
isdn-signaling—(J Series routers and QFX Series only) (Optional) Restart the ISDN
signaling process, which initiates ISDN connections.
l2tp-service— (M10, M10i, M7i, and MX Series routers only) (Optional) Restart the Layer 2
Tunneling Protocol (L2TP) process, which sets up client services for establishing
Point-to-Point Protocol (PPP) tunnels across a network and negotiating Multilink
PPP if it is implemented.
l2tp-universal-edge—(MX Series routers only) (Optional) Restart the L2TP process, which
establishes L2TP tunnels and PPP sessions through L2TP tunnels.
lacp—(Optional) Restart the Link Aggregation Control Protocol (LACP) process. LACP
provides a standardized means for exchanging information between partner systems
on a link to allow their link aggregation control instances to reach agreement on the
identity of the LAG to which the link belongs, and then to move the link to that LAG,
and to enable the transmission and reception processes for the link to function in
an orderly manner.
lcc number—(TX Matrix and TX Matrix Plus routers only) (Optional) For a TX Matrix router,
restart the software process for a specific T640 router that is connected to the TX
Matrix router. For a TX Matrix Plus router, restart the software process for a specific
router that is connected to the TX Matrix Plus router.
Replace number with the following values depending on the LCC configuration:
• 0 through 7, when T1600 routers are connected to a TX Matrix Plus router with 3D
SIBs in a routing matrix.
link-management— (TX Matrix and TX Matrix Plus routers and EX Series switches only)
(Optional) Restart the Link Management Protocol (LMP) process, which establishes
and maintains LMP control channels.
lldpd-service—(EX Series switches only) (Optional) Restart the Link Layer Discovery
Protocol (LLDP) process.
local—(MX Series routers only) (Optional) Restart the software process for the local
Virtual Chassis member.
mac-validation— (Optional) Restart the Media Access Control (MAC) validation process,
which configures MAC address validation for subscriber interfaces created on demux
interfaces in dynamic profiles on MX Series routers.
member member-id—(MX Series routers only) (Optional) Restart the software process
for a specific member of the Virtual Chassis configuration. Replace member-id with
a value of 0 or 1.
mountd-service—(EX Series switches and MX Series routers only) (Optional) Restart the
service for NFS mount requests.
network-access-service—(J Series routers and QFX Series only) (Optional) Restart the
network access process, which provides the router's Challenge Handshake
Authentication Protocol (CHAP) authentication service.
nfsd-service—(Optional) Restart the Remote NFS Server process, which provides remote
file access for applications that need NFS-based transport.
pgm—(Optional) Restart the process that implements the Pragmatic General Multicast
(PGM) protocol for assisting in the reliable delivery of multicast packets.
pic-services-logging—(Optional) Restart the logging process for some PICs. With this
process, also known as fsad (the file system access daemon), PICs send special
logging information to the Routing Engine for archiving on the hard disk.
routing—(ACX Series routers, QFX Series, EX Series switches, and MX Series routers only)
(Optional) Restart the routing protocol process.
scc—(TX Matrix routers only) (Optional) Restart the software process on the TX Matrix
router (or switch-card chassis).
sdk-service—(Optional) Restart the SDK Service process, which runs on the Routing
Engine and is responsible for communications between the SDK application and
Junos OS. Although the SDK Service process is present on the router, it is turned off
by default.
sfc number—(TX Matrix Plus routers only) (Optional) Restart the software process on
the TX Matrix Plus router (or switch-fabric chassis). Replace number with 0.
services pgcp gateway gateway-name—(Optional) Restart the pgcpd process for a specific
border gateway function (BGF) running on an MS-PIC. This option does not restart
the pgcpd process running on the Routing Engine. To restart the pgcpd process on
the Routing Engine, use the pgcp-service option.
sflow-service—(EX Series switches only) (Optional) Restart the flow sampling (sFlow
technology) process.
snmp—(Optional) Restart the SNMP process, which enables the monitoring of network
devices from a central location and provides the router's or switch’s SNMP master
agent.
tunnel-oamd—(Optional) Restart the Tunnel OAM process, which enables the Operations,
Administration, and Maintenance of Layer 2 tunneled networks. Layer 2 protocol
tunneling (L2PT) allows service providers to send Layer 2 PDUs across the provider’s
cloud and deliver them to Juniper Networks EX Series Ethernet Switches that are
not part of the local broadcast domain.
usb-control—(J Series routers and MX Series routers only) (Optional) Restart the USB
control process.
vrrp—(ACX Series routers, EX Series switches, and MX Series routers only) (Optional)
Restart the Virtual Router Redundancy Protocol (VRRP) process, which enables
hosts on a LAN to make use of redundant routing platforms on that LAN without
requiring more than the static configuration of a single default route on the hosts.
Output Fields When you enter this command, you are provided feedback on the status of your request.
Sample Output
Output Fields Table 9 on page 761 lists the output fields for the show bgp bmp command. Output fields
are listed in the approximate order in which they appear.
BMP station address/port IP address and port number of the monitoring station to which BGP
Monitoring Protocol (BMP) statistics are sent.
Memory limit Threshold, in bytes, at which the routing device stops collecting
BMP data.
Memory-connect retry Amount of time, in seconds, after which the routing device attempts
timeout to resume a BMP session that was ended after the configured
memory threshold was exceeded.
Sample Output
instance instance-name—(Optional) Display information about BGP groups for all routing
instances whose name begins with this string (for example, cust1, cust11, and cust111
are all displayed when you run the show bgp group instance cust1 command). The
instance name can be master for the main instance, or any valid configured instance
name or its prefix.
Output Fields Table 10 on page 763 describes the output fields for the show bgp group command. Output
fields are listed in the approximate order in which they appear.
Group Type or Group Type of BGP group: Internal or External. All levels
group-index Index number for the BGP peer group. The index number rtf detail
differentiates between groups when a single BGP group is split
because of different configuration options at the group and peer
levels.
AS AS number of the peer. For internal BGP (IBGP), this number is the brief detail
same as Local AS. none
Flags Flags associated with the BGP group. This field is used by Juniper brief detail
Networks customer support. none
Remove-private options Options associated with the remove-private statement. brief detail
none
Holdtime Maximum number of seconds allowed to elapse between successive brief detail
keepalive or update messages that BGP receives from a peer in the none
BGP group, after which the connection to the peer is closed and
routing devices through that peer become unavailable.
Export Export policies configured for the BGP group with the export brief detail
statement. none
MED tracks IGP metric update delay Time, in seconds, that updates to multiple exit discriminator (MED) All levels
are delayed. Also displays the time remaining before the interval is
set to expire
Traffic Statistics Interval Time between sample periods for labeled-unicast traffic statistics, brief detail
in seconds. none
Established Number of peers in the group that are in the established state. All levels
Active/Received/Accepted/Damped Multipurpose field that displays information about BGP peer summary
sessions. The field’s contents depend upon whether a session is
established and whether it was established in the main routing device
or in a routing instance.
• If a peer is not established, the field shows the state of the peer
session: Active, Connect, or Idle.
• If a BGP session is established in the main routing device, the field
shows the number of active, received, accepted, and damped
routes that are received from a neighbor and appear in the inet.0
(main) and inet.2 (multicast) routing tables. For example,
8/10/10/2 and 2/4/4/0 indicate the following:
• 8 active routes, 10 received routes, 10 accepted routes, and 2
damped routes from a BGP peer appear in the inet.0 routing
table.
• 2 active routes, 4 received routes, 4 accepted routes, and no
damped routes from a BGP peer appear in the inet.2 routing
table.
ip-addresses List of peers who are members of the group. The address is followed All levels
by the peer’s port number.
Route Queue Timer Number of seconds until queued routes are sent. If this time has detail
already elapsed, this field displays the number of seconds by which
the updates are delayed.
Route Queue Number of prefixes that are queued up for sending to the peers in detail
the group.
inet.number Number of active, received, accepted, and damped routes in the none
routing table. For example, inet.0: 7/10/9/0 indicates the following:
Suppressed Number of routes currently inactive because of damping or other brief, none
reasons. These routes do not appear in the forwarding table and are
not exported by routing protocols.
History Number of withdrawn routes stored locally to keep track of damping brief, none
history.
Damp State Number of active routes with a figure of merit greater than zero, but brief, none
lower than the threshold at which suppression occurs.
Pending Routes being processed by the BGP import policy. brief, none
Receive mask Mask of the received target included in the advertised route. detail
Mask Mask which specifies that the peer receive routes with the given detail
route target.
Sample Output
inet.0
0 0 0 0 0 0
bgp.l3vpn.0
0 0 0 0 0 0
bgp.rtarget.0
2 0 0 0 0 0
inet.0
0 0 0 0 0 0
bgp.l3vpn.0
0 0 0 0 0 0
bgp.rtarget.0
2 0 0 0 0 0
Externals suppressed: 0
Received internal prefixes: 0
Active internal prefixes: 0
Internals suppressed: 0
RIB State: BGP restart is complete
RIB State: VPN restart is complete
Table VPN-A.inet.0
Received prefixes: 0
Accepted prefixes: 0
Active prefixes: 0
Suppressed due to damping: 0
Received external prefixes: 0
Active external prefixes: 0
Externals suppressed: 0
Received internal prefixes: 0
Active internal prefixes: 0
Internals suppressed: 0
RIB State: BGP restart is complete
RIB State: VPN restart is complete
Table VPN-A.mdt.0
Received prefixes: 0
Accepted prefixes: 0
Active prefixes: 0
Suppressed due to damping: 0
Received external prefixes: 0
Active external prefixes: 0
Externals suppressed: 0
Received internal prefixes: 0
Active internal prefixes: 0
Internals suppressed: 0
RIB State: BGP restart is complete
RIB State: VPN restart is complete
show bgp group rtf user@host> show bgp group rtf detail
detail Group: internal (group-index: 0)
Receive mask: 00000002
Table: bgp.rtarget.0 Entries: 2
Target Mask
100:100/64 00000002
200:201/64 (Group)
Group: internal (group-index: 1)
Table: bgp.rtarget.0 Entries: 1
Target Mask
200:201/64 (Group)
Description Display the traffic statistics for configured Border Gateway Protocol (BGP) groups.
group-name—(Optional) Display BGP traffic statistics for only the specified group.
List of Sample Output show bgp group traffic-statistics (Per-Group-Label Not Configured) on page 770
show bgp group traffic-statistics (Per-Group-Label Configured) on page 770
Output Fields Table 11 on page 769 describes the output fields for the show bgp group traffic-statistics
command. Output fields are listed in the approximate order in which they appear.
NLRI Network layer reachability information (NLRI) indicating the source of the traffic
statistics for the BGP group.
FEC Forwarding equivalence classes (FECs) associated with the BGP group.
Sample Output
instance instance-name—(Optional) Display information about BGP peers for all routing
instances whose name begins with this string (for example, cust1, cust11, and cust111
are all displayed when you run the show bgp neighbor instance cust1 command).
neighbor-address—(Optional) Display information for only the BGP peer at the specified
IP address.
Additional Information For information about the local-address, nlri, hold-time, and preference statements, see
the Junos OS Routing Protocols Library for Routing Devices.
Output Fields Table 12 on page 772 describes the output fields for the show bgp neighbor command.
Output fields are listed in the approximate order in which they appear.
Peer Address of the BGP neighbor. The address is followed by the neighbor port number.
Local Address of the local routing device. The address is followed by the peer port number.
• Aggregate Label—BGP has aggregated a set of incoming labels (labels received from the peer) into
a single forwarding label.
• CleanUp—The peer session is being shut down.
• Delete—This peer has been deleted.
• Idled—This peer has been permanently idled.
• ImportEval—At the last commit operation, this peer was identified as needing to reevaluate all
received routes.
• Initializing—The peer session is initializing.
• SendRtn—Messages are being sent to the peer.
• Sync—This peer is synchronized with the rest of the peer group.
• TryConnect—Another attempt is being made to connect to the peer.
• Unconfigured—This peer is not configured.
• WriteFailed—An attempt to write to this peer failed.
• Cease—An error occurred, such as a version mismatch, that caused the session to close.
• Finite State Machine Error—In setting up the session, BGP received a message that it did not
understand.
• Hold Time Expired—The session's hold time expired.
• Message Header Error—The header of a BGP message was malformed.
• Open Message Error—A BGP open message contained an error.
• None—No errors occurred in the BGP session.
• Update Message Error—A BGP update message contained an error.
Path-attributes Path attribute codes that are dropped from neighbor updates.
dropped
Path-attributes ignored Path attribute codes that are ignored during neighbor updates.
Authentication key (appears only if the authentication-keychain statement has been configured) Name of the
change authentication keychain enabled.
Authentication (appears only if the authentication-algorithm statement has been configured) Type of authentication
algorithm algorithm enabled: hmac or md5.
Holdtime Hold time configured with the hold-time statement. The hold time is three times the interval at which
keepalive messages are sent.
Traffic Statistics Time between sample periods for labeled-unicast traffic statistics, in seconds.
Interval
Outbound Timer Time for which the route is available in Junos OS routing table before it is exported to BGP. This field
is displayed in the output only if the out-delay parameter is configured to a non-zero value.
Number of flaps Number of times the BGP session has gone down and then come back up.
Group index Index number for the BGP peer group. The index number differentiates between groups when a single
BGP group is split because of different configuration options at the group and peer levels.
Peer index Index that is unique within the BGP group to which the peer belongs.
Active holdtime Hold time that the local routing device negotiated with the peer.
Local Address Name of directly connected interface over which direct EBGP peering is established.
NLRI advertised by peer Address families supported by the peer: unicast or multicast.
NLRI for this session Address families being used for this session.
Peer supports Refresh Remote peer’s ability to send and request full route table readvertisement (route refresh capability).
capability For more information, see RFC 2918, Route Refresh Capability for BGP-4.
Restart time configured Configured time allowed for restart on the neighbor.
on peer
Stale routes from peer When graceful restart is negotiated, the maximum time allowed to hold routes from neighbors after
are kept for the BGP session has gone down.
Peer does not support Graceful restart restarter-mode is disabled on the peer.
Restarter functionality
Peer does not support Graceful restart helper-mode is disabled on the peer.
Receiver functionality
Restart time requested Restart time requested by this neighbor during capability negotiation.
by this peer
Restart flag received When this field appears, the BGP speaker has restarted (Restarting), and this peer should not wait
from the peer for the end-of-rib marker from the speaker before advertising routing information to the speaker.
NLRI that peer supports Neighbor supports graceful restart for this address family.
restart for
NLRI peer can save Neighbor supporting this address family saves all forwarding states.
forwarding state
NLRI that peer saved Neighbor saves all forwarding states for this address family.
forwarding for
NLRI that restart is Router supports graceful restart for this address family.
negotiated for
NLRI of received Address families for which end-of-routing-table markers are received from the neighbor.
end-of-rib markers
NLRI of all end-of-rib Address families for which end-of-routing-table markers are sent to the neighbor.
markers sent
Peer supports 4 byte AS Peer understands 4-byte AS numbers in BGP messages. The peer is running Junos OS Release 9.1 or
extension (peer-as 1) later.
NLRIs for which peer Appears in the command output of the local router if the downstream peer is configured to receive
can receive multiple multiple BGP routes to a single destination, instead of only receiving the active route.
paths
Possible value is inet-unicast.
NLRIs for which peer Appears in the command output of the local router if the upstream peer is configured to send multiple
can send multiple BGP routes to a single destination, instead of only sending the active route.
paths: inet-unicast
Possible value is inet-unicast.
• RIB State—BGP is in the graceful restart process for this routing table: restart is complete or restart
in progress.
• Bit—Number that represents the entry in the routing table for this peer.
• Send state—State of the BGP group: in sync, not in sync, or not advertising.
• Active prefixes—Number of prefixes received from the peer that are active in the routing table.
• Received prefixes—Total number of prefixes from the peer, both active and inactive, that are in the
routing table.
• Accepted prefixes—Total number of prefixes from the peer that have been accepted by a routing
policy.
• Suppressed due to damping—Number of routes currently inactive because of damping or other
reasons. These routes do not appear in the forwarding table and are not exported by routing
protocols.
Last traffic (seconds) Last time any traffic was received from the peer or sent to the peer, and the last time the local routing
device checked.
Input messages Messages that BGP has received from the receive socket buffer, showing the total number of messages,
number of update messages, number of times a policy is changed and refreshed, and the buffer size
in octets. The buffer size is 16 KB.
Output messages Messages that BGP has written to the transmit socket buffer, showing the total number of messages,
number of update messages, number of times a policy is changed and refreshed, and the buffer size
in octets. The buffer size is 16 KB.
Output queue Number of BGP packets that are queued to be transmitted to a particular neighbor for a particular
routing table. Output queue 0 is for unicast NLRIs, and queue 1 is for multicast NLRIs.
Trace file Name of the file to receive the output of the tracing operation.
Filter Updates recv (orf option only) Number of outbound-route filters received for each configured address family.
NOTE: The counter is cumulative. For example, the counter is increased after the remote peer either
resends or clears the outbound route filtering prefix list.
Immediate (orf option only) Number of route updates received with the immediate flag set. The immediate flag
indicates that the BGP peer should readvertise the updated routes.
NOTE: The counter is cumulative. For example, the counter is increased after the remote peer either
resends or clears the outbound route filtering prefix list.
Filter (orf option only) Type of prefix filter received: prefix-based or extended-community.
Received filter entries (orf option only) List of received filters displayed.
seq (orf option only) Numerical order assigned to this prefix entry among all the received outbound route
filter prefix entries.
prefix (orf option only) Address for the prefix entry that matches the filter.
minlength (orf option only) Minimum prefix length, in bits, required to match this prefix.
maxlength (orf option only) Maximum prefix length, in bits, required to match this prefix.
match (orf option only) For this prefix match, whether to permit or deny route updates.
Sample Output
Active prefixes: 1
Received prefixes: 1
Suppressed due to damping: 0
Table L2VPN.l2vpn.0 Bit: 90000
RIB State: BGP restart is complete
RIB State: VPN restart in progress
Send state: in sync
Active prefixes: 1
Received prefixes: 1
Suppressed due to damping: 0
Last traffic (seconds): Received 0 Sent 0 Checked 0
Input messages: Total 14 Updates 13 Refreshes 0 Octets 1053
Output messages: Total 3 Updates 0 Refreshes 0 Octets 105
Output Queue[0]: 0
Output Queue[1]: 0
Output Queue[2]: 0
Output Queue[3]: 0
Output Queue[4]: 0
Output Queue[5]: 0
Output Queue[6]: 0
Output Queue[7]: 0
Output Queue[8]: 0
show bgp neighbor orf user@host > show bgp neighbor orf 192.168.165.56 detail
neighbor-address Peer: 192.168.165.56+179 Type: External
detail Group: ext1
inet-unicast
Filter updates recv: 1 Immediate: 1
Filter: prefix-based receive
Received filter entries:
seq 1: prefix 2.2.2.2/32: minlen 32: maxlen 32: match deny:
inet6-unicast
Filter updates recv: 0 Immediate: 1
Filter: prefix-based receive
Received filter entries:
*:*
Description Displays the status of BGP state replication between the master and backup Routing
Engines on devices that have nonstop active routing configured on them.
List of Sample Output show bgp replication (for Master) on page 786
show bgp replication (for Backup) on page 786
Output Fields Table 13 on page 785 lists the output fields for the show bgp replication command. Output
fields are listed in the approximate order in which they appear.
session state State of the current internal BGP state replication session, Up or Down, and the duration for which
the session has been in the indicated state.
protocol state Current state of the protocol operation, Active, Connect, Idle, and the duration for which the protocol
has been in the indicated state.
synchronization state Synchronization state at the time of executing the command. The states can be:
• Idle
• Neighbor—Indicates that the neighbor state synchronization is in progress.
• AckWait—Indicates that the request processing is over.
• ORF—Indicates that the outbound routing filter synchronization is in progress.
• RIB—Indicates that the routing table synchronization is in progress.
• Complete
number of peers waiting Total number of peers waiting for various messages:
messages sent Number of various types of messages that have been sent since internal replication session became
active:
Sample Output
List of Sample Output show bgp summary (When a Peer Is Not Established) on page 790
show bgp summary (When a Peer Is Established) on page 790
show bgp summary (CLNS) on page 790
show bgp summary (Layer 2 VPN) on page 790
show bgp summary (Layer 3 VPN) on page 791
Output Fields Table 14 on page 787 describes the output fields for the show bgp summary command.
Output fields are listed in the approximate order in which they appear.
Suppressed Number of routes currently inactive because of damping or other reasons. These routes do not appear
in the forwarding table and are not exported by routing protocols.
History Number of withdrawn routes stored locally to keep track of damping history.
Damp State Number of routes with a figure of merit greater than zero, but still active because the value has not
reached the threshold at which suppression occurs.
Peer Address of each BGP peer. Each peer has one line of output.
AS Peer's AS number.
OutQ Number of BGP packets that are queued to be transmitted to a particular neighbor. It normally is 0
because the queue usually is emptied quickly.
Flaps Number of times the BGP session has gone down and then come back up.
Last Up/Down Last time since the neighbor transitioned to or from the established state.
State|#Active Multipurpose field that displays information about BGP peer sessions. The field’s contents depend
/Received/Accepted upon whether a session is established and whether it was established on the main routing device or
/Damped in a routing instance.
• If a peer is not established, the field shows the state of the peer session: Active, Connect, or Idle.
In general, the Idle state is the first stage of a connection. BGP is waiting for a Start event. A session
can be idle for other reasons as well. The reason that a session is idle is sometimes displayed. For
example: Idle (Removal in progress) or Idle (LicenseFailure).
• If a BGP session is established on the main routing device, the field shows the number of active,
received, accepted, and damped routes that are received from a neighbor and appear in the inet.0
(main) and inet.2 (multicast) routing tables. For example, 8/10/10/2 and 2/4/4/0 indicate the
following:
• 8 active routes, 10 received routes, 10 accepted routes, and 2 damped routes from a BGP peer
appear in the inet.0 routing table.
• 2 active routes, 4 received routes, 4 accepted routes, and no damped routes from a BGP peer
appear in the inet.2 routing table.
• If a BGP session is established in a routing instance, the field indicates the established (Establ)
state, identifies the specific routing table that receives BGP updates, and shows the number of
active, received, and damped routes that are received from a neighbor. For example, Establ
VPN-AB.inet.0: 2/4/0 indicates the following:
• The BGP session is established.
• Routes are received in the VPN-AB.inet.0 routing table.
• The local routing device has two active routes, four received routes, and no damped routes from
a BGP peer.
When a BGP session is established, the peers are exchanging update messages.
Sample Output
0/0/0
10.0.0.4 65002 90 91 0 1 42:54 0/2/0
0/0/0
10.0.0.6 65002 87 90 0 3 3 Active
10.1.12.1 65001 89 89 0 1 42:54 4/4/0
0/0/0
0/0/0
10.0.0.3 65002 54528 54532 0 1 2w4d22h 0/0/0
0/0/0
10.0.0.4 65002 51597 51584 0 0 2w3d22h 2/2/0
0/0/0
inet.0: 0/0/0
10.255.245.39 65299 138 168 0 6 53:48 Establ
bgp.l2vpn.0: 0/0/0
frame-vpn.l2vpn.0: 0/0/0
10.255.245.69 65299 134 140 0 6 53:42 Establ
inet.0: 0/0/0
Additional Information In the output from this command, figure-of-merit values correlate with the probability
of future instability of a routing device. Routes with higher figure-of-merit values are
suppressed for longer periods of time. The figure-of-merit value decays exponentially
over time. A figure-of-merit value of zero is assigned to each new route. The value is
increased each time the route is withdrawn or readvertised, or when one of its path
attributes changes.
Related • “Configuring BGP Flap Damping Parameters” in the Routing Policy Feature Guide for
Documentation Routing Devices
Output Fields Table 15 on page 792 describes the output fields for the show policy damping command.
Output fields are listed in the approximate order in which they appear.
Halflife Decay half-life, in minutes. The value represents the period during which the accumulated
figure-of-merit value is reduced by half if the route remains stable. If a route has flapped, but then
becomes stable, the figure-of-merit value for the route decays exponentially. For example, for a route
with a figure-of-merit value of 1500, if no incidents occur, its figure-of-merit value is reduced to 750
after 15 minutes and to 375 after another 15 minutes.
Reuse merit Figure-of-merit value below which a suppressed route can be used again. A suppressed route becomes
reusable when its figure-of-merit value decays to a value below a reuse threshold, and the route once
again is considered usable and can be installed in the forwarding table and exported from the routing
table.
Suppress/cutoff merit Figure-of-merit value above which a route is suppressed for use or inclusion in advertisements. When
a route's figure-of-merit value reaches a particular level, called the cutoff or suppression threshold,
the route is suppressed. When a route is suppressed, the routing table no longer installs the route into
the forwarding table and no longer exports this route to any of the routing protocols.
Maximum suppress Maximum hold-down time, in minutes. The value represents the maximum time that a route can be
time suppressed no matter how unstable it has been before this period of stability.
Computed values • Merit ceiling—Maximum merit that a flapping route can collect.
• Maximum decay—Maximum decay half-life, in minutes.
Sample Output
show policy
Output Fields Table 16 on page 794 lists the output fields for the show policy command. Output fields
are listed in the approximate order in which they appear.
Sample Output
Description Display all the configured conditions as well as the routing tables with which the
configuration manager is interacting. If the detail keyword is included, the output also
displays dependent routes for each condition.
Output Fields Table 17 on page 796 lists the output fields for the show policy conditions command. Output
fields are listed in the approximate order in which they appear.
event Condition type. If the if-route-exists option is configured, the event type is: All levels
Existence of a route in a specific routing table.
Dependent routes List of routes dependent on the condition, along with the latest generation detail
number.
Condition tables List of routing tables associated with the condition, along with the latest All levels
generation number and number of dependencies.
If-route-exists List of conditions configured to look for a route in the specified table. All levels
conditions
Sample Output
Condition tables:
Table mpls.0, generation 0, dependencies 0, If-route-exists conditions: primary
(static) standby (static)
Table l3vpn.inet.0, generation 633, dependencies 2
Additional Information In the output from this command, figure-of-merit values correlate with the probability
of future instability of a routing device. Routes with higher figure-of-merit values are
suppressed for longer periods of time. The figure-of-merit value decays exponentially
over time. A figure-of-merit value of zero is assigned to each new route. The value is
increased each time the route is withdrawn or readvertised, or when one of its path
attributes changes.
Related • “Configuring BGP Flap Damping Parameters” in the Routing Policy Feature Guide for
Documentation Routing Devices
Output Fields Table 15 on page 792 describes the output fields for the show policy damping command.
Output fields are listed in the approximate order in which they appear.
Halflife Decay half-life, in minutes. The value represents the period during which the accumulated
figure-of-merit value is reduced by half if the route remains stable. If a route has flapped, but then
becomes stable, the figure-of-merit value for the route decays exponentially. For example, for a route
with a figure-of-merit value of 1500, if no incidents occur, its figure-of-merit value is reduced to 750
after 15 minutes and to 375 after another 15 minutes.
Reuse merit Figure-of-merit value below which a suppressed route can be used again. A suppressed route becomes
reusable when its figure-of-merit value decays to a value below a reuse threshold, and the route once
again is considered usable and can be installed in the forwarding table and exported from the routing
table.
Suppress/cutoff merit Figure-of-merit value above which a route is suppressed for use or inclusion in advertisements. When
a route's figure-of-merit value reaches a particular level, called the cutoff or suppression threshold,
the route is suppressed. When a route is suppressed, the routing table no longer installs the route into
the forwarding table and no longer exports this route to any of the routing protocols.
Maximum suppress Maximum hold-down time, in minutes. The value represents the maximum time that a route can be
time suppressed no matter how unstable it has been before this period of stability.
Computed values • Merit ceiling—Maximum merit that a flapping route can collect.
• Maximum decay—Maximum decay half-life, in minutes.
Sample Output
show route
Options none—Display brief information about all active entries in the routing tables.
all—(Optional) Display information about all routing tables, including private, or internal,
routing tables.
private—(Optional) Display information only about all private, or internal, routing tables.
Output Fields Table 19 on page 801 describes the output fields for the show route command. Output
fields are listed in the approximate order in which they appear.
number destinations Number of destinations for which there are routes in the routing table.
number routes Number of routes in the routing table and total number of routes in the following states:
destination-prefix Route destination (for example:10.0.0.1/24). Sometimes the route information is presented in another
format, such as:
[ protocol, preference ] Protocol from which the route was learned and the preference value for the route.
• +—A plus sign indicates the active route, which is the route installed from the routing table into the
forwarding table.
• - —A hyphen indicates the last active route.
• *—An asterisk indicates that the route is both the active and the last active route. An asterisk before
a to line indicates the best subpath to the route.
In every routing metric except for the BGP LocalPref attribute, a lesser value is preferred. In order to
use common comparison routines, Junos OS stores the 1's complement of the LocalPref value in the
Preference2 field. For example, if the LocalPref value for Route 1 is 100, the Preference2 value is -101.
If the LocalPref value for Route 2 is 155, the Preference2 value is -156. Route 2 is preferred because it
has a higher LocalPref value and a lower Preference2 value.
weeks:days How long the route been known (for example, 2w4d 13:11:14, or 2 weeks, 4 days, 13 hours, 11 minutes,
hours:minutes:seconds and 14 seconds).
metric Cost value of the indicated route. For routes within an AS, the cost is determined by the IGP and the
individual protocol metrics. For external routes, destinations, or routing domains, the cost is determined
by a preference value.
AS path AS path through which the route was learned. The letters at the end of the AS path indicate the path
origin, providing an indication of the state of the route at the point at which the AS path originated:
• I—IGP.
• E—EGP.
• ?—Incomplete; typically, the AS path was aggregated.
When AS path numbers are included in the route, the format is as follows:
• [ ]—Brackets enclose the local AS number associated with the AS path if more than one AS number
is configured on the routing device, or if AS path prepending is configured.
• { }—Braces enclose AS sets, which are groups of AS numbers in which the order does not matter.
A set commonly results from route aggregation. The numbers in each AS set are displayed in
ascending order.
• ( )—Parentheses enclose a confederation.
• ( [ ] )—Parentheses and brackets enclose a confederation set.
NOTE: In Junos OS Release 10.3 and later, the AS path field displays an unrecognized attribute and
associated hexadecimal value if BGP receives attribute 128 (attribute set) and you have not configured
an independent domain in any routing instance.
• Invalid—Indicates that the prefix is found, but either the corresponding AS received from the EBGP
peer is not the AS that appears in the database, or the prefix length in the BGP update message is
longer than the maximum length permitted in the database.
• Unknown—Indicates that the prefix is not among the prefixes or prefix ranges in the database.
• Valid—Indicates that the prefix and autonomous system pair are found in the database.
to Next hop to the destination. An angle bracket (>) indicates that the route is the selected route.
via Interface used to reach the next hop. If there is more than one interface available to the next hop, the
interface that is actually used is followed by the word Selected. This field can also contain the following
information:
• Weight—Value used to distinguish primary, secondary, and fast reroute backup routes. Weight
information is available when MPLS label-switched path (LSP) link protection, node-link protection,
or fast reroute is enabled, or when the standby state is enabled for secondary paths. A lower weight
value is preferred. Among routes with the same weight value, load balancing is possible.
• Balance—Balance coefficient indicating how traffic of unequal cost is distributed among next hops
when a routing device is performing unequal-cost load balancing. This information is available
when you enable BGP multipath load balancing.
• lsp-path-name—Name of the LSP used to reach the next hop.
• label-action—MPLS label and operation occurring at the next hop. The operation can be pop (where
a label is removed from the top of the stack), push (where another label is added to the label stack),
or swap (where a label is replaced by another label). For VPNs, expect to see multiple push
operations, corresponding to the inner and outer labels required for VPN routes (in the case of a
direct PE-to-PE connection, the VPN route would have the inner label push only).
Sample Output
1:65500:1:10.0.0.20/240
*[MVPN/70] 19:53:41, metric2 1
Indirect
1:65500:1:10.0.0.40/240
*[BGP/170] 19:53:29, localpref 100, from 10.0.0.30
AS path: I
> to 10.0.24.4 via lt-0/3/0.24, label-switched-path toD
[BGP/170] 19:53:26, localpref 100, from 10.0.0.33
AS path: I
> to 10.0.24.4 via lt-0/3/0.24, label-switched-path toD
1:65500:1:10.0.0.60/240
*[BGP/170] 19:53:29, localpref 100, from 10.0.0.30
AS path: I
> to 10.0.28.8 via lt-0/3/0.28, label-switched-path toF
[BGP/170] 19:53:25, localpref 100, from 10.0.0.33
AS path: I
> to 10.0.28.8 via lt-0/3/0.28, label-switched-path toF
show route The following sample output shows a VPN route with composite next hops enabled. The
first Push operation corresponds to the outer label. The second Push operation
corresponds to the inner label.
Description Display all active routes for destinations. An active route is a route that is selected as the
best path. Inactive routes are not displayed.
brief | detail | extensive | terse—(Optional) Display the specified level of output. If you do
not specify a level of output, the system defaults to brief.
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or the
show route terse command.
Sample Output
show route active-path The output for the show route active-path brief command is identical to that for the show
brief route active-path command. For sample output, see show route active-path on page 807.
AS path: I
AS path: I
AS path: I
AS path: I
*Local Preference: 0
Next hop type: Local
Next-hop reference count: 11
Interface: fxp0.0
State: ‹Active NoReadvrt Int›
Local AS: 200
Age: 21:39:47
Task: IF
Announcement bits (2): 5-Resolve tree 2 6-Resolve tree 3
AS path: I
Description Display the routing information as it has been prepared for advertisement to a particular
neighbor of a particular dynamic routing protocol.
Options brief | detail | extensive | terse—(Optional) Display the specified level of output.
Additional Information Routes displayed are routes that the routing table has exported into the routing protocol
and that have been filtered by the associated protocol's export routing policy statements.
List of Sample Output show route advertising-protocol bgp (Layer 3 VPN) on page 814
show route advertising-protocol bgp detail on page 814
show route advertising-protocol bgp detail (Layer 2 VPN) on page 814
show route advertising-protocol bgp detail (Layer 3 VPN) on page 814
show route advertising-protocol bgp extensive all (Next Hop Self with RIB-out IP
Address) on page 815
Output Fields Table 20 on page 812 lists the output fields for the show route advertising-protocol
command. Output fields are listed in the approximate order in which they appear.
number Number of destinations for which there are routes in the routing table. All levels
destinations
number routes Number of routes in the routing table and total number of routes in the following All levels
states:
destination-prefix Destination prefix. The entry value is the number of routes for this destination, detail extensive
(entry , announced) and the announced value is the number of routes being announced for this
destination.
BGP group and type BGP group name and type (Internal or External). detail extensive
Route Distinguisher Unique 64-bit prefix augmenting each IP subnet. detail extensive
Advertised Label Incoming label advertised by the LDP. When an IP packet enters a label-switched detail extensive
path (LSP), the ingress router examines the packet and assigns it a label based
on its destination, placing the label in the packet's header. The label transforms
the packet from one that is forwarded based on its IP routing information to
one that is forwarded based on information associated with the label.
Label-Base, range First label in a block of labels and label block size. A remote PE router uses this detail extensive
first label when sending traffic toward the advertising PE router.
VPN Label Virtual private network (VPN) label. Packets are sent between CE and PE routers detail extensive
by advertising VPN labels. VPN labels transit over either an RSVP or an LDP
LSP tunnel.
Nexthop Next hop to the destination. An angle bracket (>) indicates that the route is the All levels
selected route.
If the next-hop advertisement to the peer is Self, and the RIB-out next hop is a
specific IP address, the RIB-out IP address is included in the extensive output.
See show route advertising-protocol bgp extensive all (Next Hop Self with RIB-out
IP Address) on page 815.
Lclpref or Localpref Local preference value included in the route. All levels
AS path AS path through which the route was learned. The letters at the end of the AS All levels
path indicate the path origin, providing an indication of the state of the route at
the point at which the AS path originated:
• I—IGP.
• E—EGP.
• ?—Incomplete; typically, the AS path was aggregated.
When AS path numbers are included in the route, the format is as follows:
NOTE: In Junos OS Release 10.3 and later, the AS path field displays an
unrecognized attribute and associated hexadecimal value if BGP receives
attribute 128 (attribute set) and you have not configured an independent domain
in any routing instance.
Communities Community path attribute for the route. See the output field table for the show detail extensive
route detail command for all possible values for this field.
AIGP Accumulated interior gateway protocol (AIGP) BGP attribute. detail extensive
Attrset AS Number, local preference, and path of the autonomous system (AS) that detail extensive
originated the route. These values are stored in the Attrset attribute at the
originating router.
mtu Maximum transmission unit (MTU) of the Layer 2 circuit. detail extensive
Sample Output
show route user@host> show route advertising-protocol bgp 200.0.0.2 170.0.1.0/24 extensive all
advertising-protocol inet.0: 13 destinations, 19 routes (13 active, 0 holddown, 6 hidden)
bgp extensive all (Next 170.0.1.0/24 (2 entries, 1 announced)
Hop Self with RIB-out BGP group eBGP-INTEROP type External
IP Address) Nexthop: Self (rib-out 10.100.3.2)
AS path: [4713] 200 I
...
Description Display information about all routes in all routing tables, including private, or internal,
tables.
Options none—Display information about all routes in all routing tables, including private, or
internal, tables.
Output Fields In Junos OS Release 9.5 and later, only the output fields for the show route all command
display all routing tables, including private, or hidden, routing tables. The output field
table of the show route command does not display entries for private, or hidden, routing
tables in Junos OS Release 9.5 and later.
Sample Output
show route all The following example displays a snippet of output from the show route command and
then displays the same snippet of output from the show route all command:
Description Display the entries in the routing table that match the specified autonomous system
(AS) path regular expression.
• An individual AS number
You also can include the operators described in the table of AS path regular expression
operators in the Junos Policy Framework Configuration Guide. The following list summarizes
these operators:
When you specify more than one AS number or path term, or when you include an
operator in the regular expression, enclose the entire regular expression in quotation
marks. For example, to match any path that contains AS number 234, specify the
following command:
List of Sample Output show route aspath-regex (Matching a Specific AS Number) on page 819
show route aspath-regex (Matching Any Path with Two AS Numbers) on page 819
Output Fields For information about output fields, see the output field table for the show route
command.
Sample Output
show route user@host> show route aspath-regex ?.* 234 3561 .*?
aspath-regex
(Matching Any Path inet.0: 46351 destinations, 46351 routes (46349 active, 0 holddown, 2 hidden)
with Two AS Numbers) + = Active Route, - = Last Active, * = Both
Description Display the route in the routing table that is the best route to the specified address or
range of addresses. The best route is the longest matching route.
Options brief | detail | extensive | terse—(Optional) Display the specified level of output. If you do
not specify a level of output, the system defaults to brief.
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or the
show route terse command.
Sample Output
show route best detail user@host> show route best 10.255.70.103 detail
inet.0: 24 destinations, 25 routes (23 active, 0 holddown, 1 hidden)
Restart Complete
10.255.70.103/32 (1 entry, 1 announced)
*OSPF Preference: 10
Next-hop reference count: 9
Next hop: 10.31.1.6 via ge-3/1/0.0, selected
Next hop: via so-0/3/0.0
State: <Active Int>
Local AS: 69
Age: 1d 13:20:06 Metric: 2
Area: 0.0.0.0
Task: OSPF
Announcement bits (2): 0-KRT 3-Resolve tree 2
AS path: I
show route best The output for the show route best extensive command is identical to that for the show
extensive route best detail command. For sample output, see show route best detail on page 821.
show route best terse user@host> show route best 10.255.70.103 terse
inet.0: 24 destinations, 25 routes (23 active, 0 holddown, 1 hidden)
Restart Complete
+ = Active Route, - = Last Active, * = Both
Description Display brief information about the active entries in the routing tables.
Output Fields For information about output fields, see the Output Field table of the show route
command.
Sample Output
Description Display the route entries in each routing table that are members of a Border Gateway
Protocol (BGP) community.
Additional Information Specifying the community option displays all routes matching the community found
within the routing table. The community option does not limit the output to only the
routes being advertised to the neighbor after any egress routing policy.
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or
the show route terse command.
Sample Output
Description Display the route entries in each routing table that are members of a Border Gateway
Protocol (BGP) community, specified by a community name.
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or
the show route terse command.
Sample Output
10.255.245.204:10:10.255.245.212/32
*[BGP/170] 00:06:40, localpref 100, from 10.255.245.204
AS path: 300 I
> to 100.1.2.2 via ge-1/1/0.0, label-switched-path to_fix
10.255.245.204:10:20.20.20.20/32
*[BGP/170] 00:36:02, localpref 100, from 10.255.245.204
AS path: I
> to 100.1.2.2 via ge-1/1/0.0, label-switched-path to_fix
10.255.245.204:10:100.1.4.0/24
*[BGP/170] 00:36:02, localpref 100, from 10.255.245.204
AS path: I
> to 100.1.2.2 via ge-1/1/0.0, label-switched-path to_fix
Description Display the BGP routes for which updates might have been reduced because of route
flap damping.
Options brief | detail | extensive | terse—(Optional) Display the specified level of output. If you do
not specify a level of output, the system defaults to brief.
decayed—Display route damping entries that might no longer be valid, but are not
suppressed.
history—Display entries that have already been withdrawn, but have been logged.
suppressed—Display entries that have been suppressed and are no longer being installed
into the forwarding table or exported by routing protocols.
List of Sample Output show route damping decayed detail on page 833
show route damping history on page 833
show route damping history detail on page 833
Output Fields Table 21 on page 829 lists the output fields for the show route damping command. Output
fields are listed in the approximate order in which they appear.
destinations Number of destinations for which there are routes in the routing table. All levels
number routes Number of routes in the routing table and total number of routes in the following All levels
states:
• active
• holddown (routes that are in a pending state before being declared inactive)
• hidden (the routes are not used because of a routing policy)
destination-prefix Destination prefix. The entry value is the number of routes for this destination, detail extensive
(entry, announced) and the announced value is the number of routes being announced for this
destination.
[protocol, Protocol from which the route was learned and the preference value for the All levels
preference] route.
• +—A plus sign indicates the active route, which is the route installed from the
routing table into the forwarding table.
• - —A hyphen indicates the last active route.
• *—An asterisk indicates that the route is both the active and the last active
route. An asterisk before a to line indicates the best subpath to the route.
In every routing metric except for the BGP LocalPref attribute, a lesser value is
preferred. In order to use common comparison routines, Junos OS stores the 1's
complement of the LocalPref value in the Preference2 field. For example, if the
LocalPref value for Route 1 is 100, the Preference2 value is -101. If the LocalPref
value for Route 2 is 155, the Preference2 value is -156. Route 2 is preferred
because it has a higher LocalPref value and a lower Preference2 value.
Next-hop reference Number of references made to the next hop. detail extensive
count
Next hop Network layer address of the directly reachable neighboring system. detail extensive
via Interface used to reach the next hop. If there is more than one interface available detail extensive
to the next hop, the interface that is actually used is followed by the word
Selected.
Protocol next hop Network layer address of the remote routing device that advertised the prefix. detail extensive
This address is used to derive a forwarding next hop.
Indirect next hop Index designation used to specify the mapping between protocol next hops, detail extensive
tags, kernel export policy, and the forwarding next hops.
State Flags for this route. For a description of possible values for this field, see the detail extensive
output field table for the show route detail command.
Age How long the route has been known. detail extensive
Task Name of the protocol that has added the route. detail extensive
Announcement bits List of protocols that announce this route. n-Resolve inet indicates that the route detail extensive
is used for route resolution for next hops found in the routing table. n is an index
used by Juniper Networks customer support only.
AS path AS path through which the route was learned. The letters at the end of the AS All levels
path indicate the path origin, providing an indication of the state of the route at
the point at which the AS path originated:
• I—IGP.
• E—EGP.
• ?—Incomplete; typically, the AS path was aggregated.
When AS path numbers are included in the route, the format is as follows:
NOTE: In Junos OS Release 10.3 and later, the AS path field displays an
unrecognized attribute and associated hexadecimal value if BGP receives
attribute 128 (attribute set) and you have not configured an independent domain
in any routing instance.
to Next hop to the destination. An angle bracket (>) indicates that the route is the brief none
selected route.
via Interface used to reach the next hop. If there is more than one interface available brief none
to the next hop, the interface that is actually used is followed by the word
Selected.
Communities Community path attribute for the route. See the output field table for the show detail extensive
route detail command.
Router ID BGP router ID as advertised by the neighbor in the open message. detail extensive
Merit (last Last updated and current figure-of-merit value. detail extensive
update/now)
damping-parameters Name that identifies the damping parameters used, which is defined in the detail extensive
damping statement at the [edit policy-options] hierarchy level.
Last update Time of most recent change in path attributes. detail extensive
First update Time of first change in path attributes, which started the route damping process. detail extensive
Flaps Number of times the route has gone up or down or its path attributes have detail extensive
changed.
Suppressed (suppressed keyword only) This route is currently suppressed. A suppressed All levels
route does not appear in the forwarding table and routing protocols do not
export it.
Reusable in (suppressed keyword only) Time when a suppressed route will again be available. All levels
Preference will be (suppressed keyword only) Preference value that will be applied to the route All levels
when it is again active.
Sample Output
Description Display detailed information about the active entries in the routing tables.
Options none—Display all active entries in the routing table on all systems.
Output Fields Table 22 on page 835 describes the output fields for the show route detail command.
Output fields are listed in the approximate order in which they appear.
number destinations Number of destinations for which there are routes in the routing table.
number routes Number of routes in the routing table and total number of routes in the following states:
route-destination Route destination (for example:10.0.0.1/24). The entry value is the number of routes for this destination,
(entry, announced) and the announced value is the number of routes being announced for this destination. Sometimes
the route destination is presented in another format, such as:
label stacking (Next-to-the-last-hop routing device for MPLS only) Depth of the MPLS label stack, where the
label-popping operation is needed to remove one or more labels from the top of the stack. A pair of
routes is displayed, because the pop operation is performed only when the stack depth is two or more
labels.
• S=0 route indicates that a packet with an incoming label stack depth of 2 or more exits this routing
device with one fewer label (the label-popping operation is performed).
• If there is no S= information, the route is a normal MPLS route, which has a stack depth of 1 (the
label-popping operation is not performed).
[protocol, preference] Protocol from which the route was learned and the preference value for the route.
• +—A plus sign indicates the active route, which is the route installed from the routing table into the
forwarding table.
• - —A hyphen indicates the last active route.
• *—An asterisk indicates that the route is both the active and the last active route. An asterisk before
a to line indicates the best subpath to the route.
In every routing metric except for the BGP LocalPref attribute, a lesser value is preferred. In order to
use common comparison routines, Junos OS stores the 1's complement of the LocalPref value in the
Preference2 field. For example, if the LocalPref value for Route 1 is 100, the Preference2 value is -101.
If the LocalPref value for Route 2 is 155, the Preference2 value is -156. Route 2 is preferred because it
has a higher LocalPref value and a lower Preference2 value.
Level (IS-IS only). In IS-IS, a single AS can be divided into smaller groups called areas. Routing between
areas is organized hierarchically, allowing a domain to be administratively divided into smaller areas.
This organization is accomplished by configuring Level 1 and Level 2 intermediate systems. Level 1
systems route within an area. When the destination is outside an area, they route toward a Level 2
system. Level 2 intermediate systems route between areas and toward other ASs.
Next-hop type Type of next hop. For a description of possible values for this field, see Table 23 on page 839.
Flood nexthop branches Indicates that the number of flood next-hop branches exceeded the system limit of 32 branches, and
exceed maximum only a subset of the flood next-hop branches were installed in the kernel.
message
Next hop Network layer address of the directly reachable neighboring system.
via Interface used to reach the next hop. If there is more than one interface available to the next hop, the
name of the interface that is actually used is followed by the word Selected. This field can also contain
the following information:
• Weight—Value used to distinguish primary, secondary, and fast reroute backup routes. Weight
information is available when MPLS label-switched path (LSP) link protection, node-link protection,
or fast reroute is enabled, or when the standby state is enabled for secondary paths. A lower weight
value is preferred. Among routes with the same weight value, load balancing is possible.
• Balance—Balance coefficient indicating how traffic of unequal cost is distributed among next hops
when a routing device is performing unequal-cost load balancing. This information is available
when you enable BGP multipath load balancing.
Label operation MPLS label and operation occurring at this routing device. The operation can be pop (where a label
is removed from the top of the stack), push (where another label is added to the label stack), or swap
(where a label is replaced by another label).
Protocol next hop Network layer address of the remote routing device that advertised the prefix. This address is used
to derive a forwarding next hop.
Indirect next hop Index designation used to specify the mapping between protocol next hops, tags, kernel export policy,
and the forwarding next hops.
State State of the route (a route can be in more than one state). See Table 24 on page 841.
Metricn Cost value of the indicated route. For routes within an AS, the cost is determined by IGP and the
individual protocol metrics. For external routes, destinations, or routing domains, the cost is determined
by a preference value.
MED-plus-IGP Metric value for BGP path selection to which the IGP cost to the next-hop destination has been added.
TTL-Action For MPLS LSPs, state of the TTL propagation attribute. Can be enabled or disabled for all
RSVP-signaled and LDP-signaled LSPs or for specific VRF routing instances.
Announcement bits List of protocols that announce this route. n-Resolve inet indicates that the route is used for route
resolution for next hops found in the routing table. n is an index used by Juniper Networks customer
support only.
AS path AS path through which the route was learned. The letters at the end of the AS path indicate the path
origin, providing an indication of the state of the route at the point at which the AS path originated:
• I—IGP.
• E—EGP.
• Recorded—The AS path is recorded by the sample process (sampled).
• ?—Incomplete; typically, the AS path was aggregated.
When AS path numbers are included in the route, the format is as follows:
• [ ]—Brackets enclose the number that precedes the AS path. This number represents the number
of ASs present in the AS path, when calculated as defined in RFC 4271. This value is used in the
AS-path merge process, as defined in RFC 4893.
• [ ]—If more than one AS number is configured on the routing device, or if AS path prepending is
configured, brackets enclose the local AS number associated with the AS path.
• { }—Braces enclose AS sets, which are groups of AS numbers in which the order does not matter.
A set commonly results from route aggregation. The numbers in each AS set are displayed in
ascending order.
• ( )—Parentheses enclose a confederation.
• ( [ ] )—Parentheses and brackets enclose a confederation set.
NOTE: In Junos OS Release 10.3 and later, the AS path field displays an unrecognized attribute and
associated hexadecimal value if BGP receives attribute 128 (attribute set) and you have not configured
an independent domain in any routing instance.
FECs bound to route Point-to-multipoint root address, multicast source address, and multicast group address when
multipoint LDP (M-LDP) inband signaling is configured.
Prefixes bound to route Forwarding equivalent class (FEC) bound to this route. Applicable only to routes installed by LDP.
Communities Community path attribute for the route. See Table 25 on page 843 for all possible values for this field.
Label-Base, range First label in a block of labels and label block size. A remote PE routing device uses this first label
when sending traffic toward the advertising PE routing device.
status vector Layer 2 VPN and VPLS network layer reachability information (NLRI).
Primary Routing Table In a routing table group, the name of the primary routing table in which the route resides.
Secondary Tables In a routing table group, the name of one or more secondary tables in which the route resides.
Table 23 on page 839 describes all possible values for the Next-hop Types output field.
Indirect (indr) Used with applications that have a protocol next hop
address that is remote. You are likely to see this next-hop
type for internal BGP (IBGP) routes when the BGP next
hop is a BGP neighbor that is not directly connected.
Unilist (ulst) List of unicast next hops. A packet sent to this next hop
goes to any next hop in the list.
Table 24 on page 841 describes all possible values for the State output field. A route can
be in more than one state (for example, <Active NoReadvrt Int Ext>).
Always Compare MED Path with a lower multiple exit discriminator (MED) is
available.
Cisco Non-deterministic MED Cisco nondeterministic MED is enabled, and a path with a
selection lower MED is available.
Cluster list length Length of cluster list sent by the route reflector.
Ex Exterior route.
IGP metric Path through next hop with lower IGP metric is available.
Inactive reason Flags for this route, which was not selected as best for a
particular destination.
Int Ext BGP route received from an internal BGP peer or a BGP
confederation peer.
Interior > Exterior > Exterior via Direct, static, IGP, or EBGP path is available.
Interior
Next hop address Path with lower metric next hop is available.
NotBest Route not chosen because it does not have the lowest MED.
Not Best in its group Incoming BGP AS is not the best of a group (only one AS can
be the best).
Route Metric or MED comparison Route with a lower metric or MED is available.
Unusable path Path is not usable because of one of the following conditions:
Table 25 on page 843 describes the possible values for the Communities output field.
area-number 4 bytes, encoding a 32-bit area number. For AS-external routes, the value is 0. A nonzero value
identifies the route as internal to the OSPF domain, and as within the identified area. Area
numbers are relative to a particular OSPF domain.
bandwidth: local AS Link-bandwidth community value used for unequal-cost load balancing. When BGP has
number:link-bandwidth-number several candidate paths available for multipath purposes, it does not perform unequal-cost
load balancing according to the link-bandwidth community unless all candidate paths have
this attribute.
domain-id-vendor Unique configurable number that further identifies the OSPF domain.
options 1 byte. Currently this is only used if the route type is 5 or 7. Setting the least significant bit in
the field indicates that the route carries a type 2 metric.
origin (Used with VPNs) Identifies where the route came from.
ospf-route-type 1 byte, encoded as 1 or 2 for intra-area routes (depending on whether the route came from a
type 1 or a type 2 LSA); 3 for summary routes; 5 for external routes (area number must be0);
7 for NSSA routes; or 129 for sham link endpoint addresses.
route-type-vendor Displays the area number, OSPF route type, and option of the route. This is configured using
the BGP extended community attribute 0x8000. The format is
area-number:ospf-route-type:options.
rte-type Displays the area number, OSPF route type, and option of the route. This is configured using
the BGP extended community attribute 0x0306. The format is
area-number:ospf-route-type:options.
target Defines which VPN the route participates in; target has the format 32-bit IP address:16-bit
number. For example, 10.19.0.0:100.
unknown IANA Incoming IANA codes with a value between 0x1 and 0x7fff. This code of the BGP extended
community attribute is accepted, but it is not recognized.
unknown OSPF vendor Incoming IANA codes with a value above 0x8000. This code of the BGP extended community
community attribute is accepted, but it is not recognized.
Sample Output
...
Area: 0.0.0.0
Task: OSPF
Announcement bits (2): 0-KRT 3-Resolve tree 2
AS path: I
...
...
...
AS path: I
Communities: target:11111:1 Layer2-info: encaps:VPLS,
control flags:, mtu: 0
*Direct Preference: 0
Next hop type: Interface
Next-hop reference count: 1
Next hop: via lo0.16385, selected
State: <Active NoReadvrt Int>
Age: 1:31:44
Task: IF
AS path: I
...
show route label detail user@host> show route label 299872 detail
(Multipoint LDP Inband mpls.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)
Signaling for 299872 (1 entry, 1 announced)
*LDP Preference: 9
Description Display only the routes that exactly match the specified address or range of addresses.
Options brief | detail | extensive | terse—(Optional) Display the specified level of output. If you do
not specify a level of output, the system defaults to brief.
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or the
show route terse command.
Sample Output
show route exact detail user@host> show route exact 207.17.136.0/24 detail
show route exact terse user@host> show route exact 207.17.136.0/24 terse
Description Display policy-based route export information. Policy-based export simplifies the process
of exchanging route information between routing instances.
Options none—(Same as brief.) Display standard information about policy-based export for all
instances and routing tables on all systems.
Output Fields Table 26 on page 853 lists the output fields for the show route export command. Output
fields are listed in the approximate order in which they appear.
Table or table-name Name of the routing tables that either import or export routes. All levels
Routes Number of routes exported from this table into other tables. If a particular route brief none
is exported to different tables, the counter will only increment by one.
Export Whether the table is currently exporting routes to other tables: Y or N (Yes or No). brief none
Import Tables currently importing routes from the originator table. (Not displayed for detail
tables that are not exporting any routes.)
Flags (instance keyword only) Flags for this feature on this instance: detail
• config auto-policy—The policy was deduced from the configured IGP export
policies.
• cleanup—Configuration information for this instance is no longer valid.
• config—The instance was explicitly configured.
Options (instance keyword only) Configured option displays the type of routing tables the detail
feature handles:
• unicast—Indicates instance.inet.0.
• multicast—Indicates instance.inet.2.
• unicast multicast—Indicates instance.inet.0 and instance.inet.2.
Import policy (instance keyword only) Policy that route export uses to construct the import-export detail
matrix. Not displayed if the instance type is vrf.
Type (instance keyword only) Type of routing instance: forwarding, non-forwarding, or detail
vrf.
Sample Output
Description Display extensive information about the active entries in the routing tables.
Output Fields Table 27 on page 855 describes the output fields for the show route extensive command.
Output fields are listed in the approximate order in which they appear.
number destinations Number of destinations for which there are routes in the routing table.
number routes Number of routes in the routing table and total number of routes in the following states:
route-destination Route destination (for example: 10.0.0.1/24). The entry value is the number of route for this destination,
(entry, announced) and the announced value is the number of routes being announced for this destination. Sometimes
the route destination is presented in another format, such as:
label stacking (Next-to-the-last-hop routing device for MPLS only) Depth of the MPLS label stack, where the
label-popping operation is needed to remove one or more labels from the top of the stack. A pair of
routes is displayed, because the pop operation is performed only when the stack depth is two or more
labels.
• S=0 route indicates that a packet with an incoming label stack depth of two or more exits this router
with one fewer label (the label-popping operation is performed).
• If there is no S= information, the route is a normal MPLS route, which has a stack depth of 1 (the
label-popping operation is not performed).
[protocol, preference] Protocol from which the route was learned and the preference value for the route.
• +—A plus sign indicates the active route, which is the route installed from the routing table into the
forwarding table.
• - —A hyphen indicates the last active route.
• *—An asterisk indicates that the route is both the active and the last active route. An asterisk before
a to line indicates the best subpath to the route.
In every routing metric except for the BGP LocalPref attribute, a lesser value is preferred. In order to
use common comparison routines, Junos OS stores the 1's complement of the LocalPref value in the
Preference2 field. For example, if the LocalPref value for Route 1 is 100, the Preference2 value is -101.
If the LocalPref value for Route 2 is 155, the Preference2 value is -156. Route 2 is preferred because it
has a higher LocalPref value and a lower Preference2 value.
Level (IS-IS only). In IS-IS, a single autonomous system (AS) can be divided into smaller groups called
areas. Routing between areas is organized hierarchically, allowing a domain to be administratively
divided into smaller areas. This organization is accomplished by configuring Level 1 and Level 2
intermediate systems. Level 1 systems route within an area. When the destination is outside an area,
they route toward a Level 2 system. Level 2 intermediate systems route between areas and toward
other ASs.
Next-hop type Type of next hop. For a description of possible values for this field, see the Output Field table in the
show route detail command.
Flood nexthop branches Indicates that the number of flood next-hop branches exceeded the system limit of 32 branches, and
exceed maximum only a subset of the flood next-hop branches were installed in the kernel.
message
Next hop Network layer address of the directly reachable neighboring system.
via Interface used to reach the next hop. If there is more than one interface available to the next hop, the
name of the interface that is actually used is followed by the word Selected. This field can also contain
the following information:
• Weight—Value used to distinguish primary, secondary, and fast reroute backup routes. Weight
information is available when MPLS label-switched path (LSP) link protection, node-link protection,
or fast reroute is enabled, or when the standby state is enabled for secondary paths. A lower weight
value is preferred. Among routes with the same weight value, load balancing is possible.
• Balance—Balance coefficient indicating how traffic of unequal cost is distributed among next hops
when a routing device is performing unequal-cost load balancing. This information is available
when you enable BGP multipath load balancing.
Label operation MPLS label and operation occurring at this routing device. The operation can be pop (where a label
is removed from the top of the stack), push (where another label is added to the label stack), or swap
(where a label is replaced by another label).
Offset Whether the metric has been increased or decreased by an offset value.
Protocol next hop Network layer address of the remote routing device that advertised the prefix. This address is used
to recursively derive a forwarding next hop.
label-operation MPLS label and operation occurring at this routing device. The operation can be pop (where a label
is removed from the top of the stack), push (where another label is added to the label stack), or swap
(where a label is replaced by another label).
Indirect next hops When present, a list of nodes that are used to resolve the path to the next-hop destination, in the
order that they are resolved.
When BGP PIC Edge is enabled, the output lines that contain Indirect next hop: weight follow next
hops that the software can use to repair paths where a link failure occurs. The next-hop weight has
one of the following values:
State State of the route (a route can be in more than one state). See the Output Field table in the show
route detail command.
Session ID The BFD session ID number that represents the protection using MPLS fast reroute (FRR) and loop-free
alternate (LFA).
Weight Weight for the backup path. If the weight of an indirect next hop is larger than zero, the weight value
is shown.
Inactive reason If the route is inactive, the reason for its current state is indicated. Typical reasons include:
Metric Cost value of the indicated route. For routes within an AS, the cost is determined by IGP and the
individual protocol metrics. For external routes, destinations, or routing domains, the cost is determined
by a preference value.
MED-plus-IGP Metric value for BGP path selection to which the IGP cost to the next-hop destination has been added.
TTL-Action For MPLS LSPs, state of the TTL propagation attribute. Can be enabled or disabled for all
RSVP-signaled and LDP-signaled LSPs or for specific VRF routing instances.
Announcement bits List of protocols that announce this route. n-Resolve inet indicates that the route is used for route
resolution for next hops found in the routing table. n is an index used by Juniper Networks customer
support only.
AS path AS path through which the route was learned. The letters at the end of the AS path indicate the path
origin, providing an indication of the state of the route at the point at which the AS path originated:
• I—IGP.
• E—EGP.
• Recorded—The AS path is recorded by the sample process (sampled).
• ?—Incomplete; typically, the AS path was aggregated.
When AS path numbers are included in the route, the format is as follows:
• [ ]—Brackets enclose the local AS number associated with the AS path if more than one AS number
is configured on the routing device, or if AS path prepending is configured.
• { }—Braces enclose AS sets, which are groups of AS numbers in which the order does not matter.
A set commonly results from route aggregation. The numbers in each AS set are displayed in
ascending order.
• ( )—Parentheses enclose a confederation.
• ( [ ] )—Parentheses and brackets enclose a confederation set.
NOTE: In Junos OS Release 10.3 and later, the AS path field displays an unrecognized attribute and
associated hexadecimal value if BGP receives attribute 128 (attribute set) and you have not configured
an independent domain in any routing instance.
FECs bound to route Point-to-multipoint root address, multicast source address, and multicast group address when
multipoint LDP (M-LDP) inband signaling is configured.
AS path: I <Originator> (For route reflected output only) Originator ID attribute set by the route reflector.
Cluster list (For route reflected output only) Cluster ID sent by the route reflector.
Originator ID (For route reflected output only) Address of router that originally sent the route to the route reflector.
Prefixes bound to route Forwarding equivalent class (FEC) bound to this route. Applicable only to routes installed by LDP.
Communities Community path attribute for the route. See the Output Field table in the show route detail command
for all possible values for this field.
Label-Base, range First label in a block of labels and label block size. A remote PE routing device uses this first label
when sending traffic toward the advertising PE routing device.
status vector Layer 2 VPN and VPLS network layer reachability information (NLRI).
Primary Routing Table In a routing table group, the name of the primary routing table in which the route resides.
Secondary Tables In a routing table group, the name of one or more secondary tables in which the route resides.
Originating RIB Name of the routing table whose active route was used to determine the forwarding next-hop entry
in the resolution database. For example, in the case of inet.0 resolving through inet.0 and inet.3, this
field indicates which routing table, inet.0 or inet.3, provided the best path for a particular prefix.
Forwarding nexthops Number of forwarding next hops. The forwarding next hop is the network layer address of the directly
reachable neighboring system (if applicable) and the interface used to reach it.
Sample Output
...
...
...
Task: RSVP
Announcement bits (2): 1-Resolve tree 1 2-Resolve tree 2
AS path: I
...
0 (1 entry, 1 announced)
TSI:
KRT in-kernel 0 /36 -> {}
*MPLS Preference: 0
Next hop type: Receive
Next-hop reference count: 6
State: <Active Int>
Local AS: 69
Age: 1:34:08 Metric: 1
Task: MPLS
Announcement bits (1): 0-KRT
AS path: I
...
TSI:
KRT in-kernel 800010 /36 -> {vt-3/2/0.32769}
*VPLS Preference: 7
Next-hop reference count: 2
Next hop: via vt-3/2/0.32769, selected
Label operation: Pop
State: <Active Int>
Age: 1:31:53
Task: Common L2 VC
Announcement bits (1): 0-KRT
AS path: I
Local AS: 69
Age: 1:34:08
Task: PIM Recv6
Announcement bits (1): 0-KRT
AS path: I
...
TSI:
Address: 0x925c208
Next-hop reference count: 2
Source: 10.0.0.9
Next hop: 10.0.0.9 via ge-1/2/0.15, selected
Label operation: Push 300112
Label TTL action: prop-ttl
State: <Active Ext>
Local AS: 7019 Peer AS: 13979
Age: 1w0d 23:06:56
AIGP: 25
Task: BGP_13979.10.0.0.9+56732
Announcement bits (1): 0-KRT
AS path: 13979 7018 I
Accepted
Route Label: 300112
Localpref: 100
Router ID: 10.9.9.1
Age: 25 Metric2: 15
Validation State: unverified
Task: RT
Announcement bits (1): 0-KRT
AS path: 3 I
Communities: target:2:1
TSI:
KRT in-kernel 1.0.0.0/8 -> {indirect(40)}
*BGP Preference: 170/-101
Source: 192.168.4.214
Protocol next hop: 207.17.136.192 Indirect next hop: 84ac908 40
State: <Active Int Ext>
Local AS: 10458 Peer AS: 10458
Age: 3:09 Metric: 0 Metric2: 0
Task: BGP_10458.192.168.4.214+1033
Announcement bits (2): 0-KRT 4-Resolve inet.0
show route label detail user@host> show route label 299872 detail
(Multipoint LDP Inband mpls.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)
Signaling for 299872 (1 entry, 1 announced)
Point-to-Multipoint *LDP Preference: 9
LSPs) Next hop type: Flood
Next-hop reference count: 3
Address: 0x9097d90
Next hop: via vt-0/1/0.1
Next-hop index: 661
Label operation: Pop
Address: 0x9172130
Next hop: via so-0/0/3.0
Next-hop index: 654
Label operation: Swap 299872
State: **Active Int>
Local AS: 1001
Age: 8:20 Metric: 1
Task: LDP
Announcement bits (1): 0-KRT
AS path: I
FECs bound to route: P2MP root-addr 10.255.72.166, grp 232.1.1.1,
src 192.168.142.2
brief | detail—(Optional) Display the specified level of output. If you do not specify a level
of output, the system defaults to brief.
table table-name—(Optional) Display flow route information for all routing tables whose
name begins with this string (for example, inet.0 and inet6.0 are both displayed
when you run the show route flow validation inet command).
Output Fields Table 28 on page 871 lists the output fields for the show route flow validation command.
Output fields are listed in the approximate order in which they appear.
routing-table-name Name of the routing table (for example, inet.0). All levels
Dependent flow Number of flows for which there are routes in the routing table. All levels
destinations
Flow destination Number of entries and number of destinations that match the route flow. All levels
Unicast best Destination that is the best match for the route flow. All levels
match
Sample Output
Description Display the Routing Engine's forwarding table, including the network-layer prefixes and
their next hops. This command is used to help verify that the routing protocol process
has relayed the correction information to the forwarding table. The Routing Engine
constructs and maintains one or more routing tables. From the routing tables, the Routing
Engine derives a table of active routes, called the forwarding table.
NOTE: The Routing Engine copies the forwarding table to the Packet
Forwarding Engine, the part of the router that is responsible for forwarding
packets. To display the entries in the Packet Forwarding Engine's forwarding
table, use the show pfe route command.
Options none—Display the routes in the forwarding tables. By default, the show route
forwarding-table command does not display information about private, or internal,
forwarding tables.
all—(Optional) Display routing table entries for all forwarding tables, including private,
or internal, tables.
ccc interface-name—(Optional) Display route entries for the specified circuit cross-connect
interface.
family family—(Optional) Display routing table entries for the specified family:
fibre-channel, fmembers, inet, inet6, iso, mpls, tnp, unix, vpls, or vlan-classification.
lcc number—(TX Matrix and TX matrix Plus routers only) (Optional) On a routing matrix
composed of a TX Matrix router and T640 routers, display information for the
specified T640 router (or line-card chassis) connected to the TX Matrix router. On
a routing matrix composed of the TX Matrix Plus router and T1600 or T4000 routers,
display information for the specified router (line-card chassis) connected to the TX
Matrix Plus router.
Replace number with the following values depending on the LCC configuration:
• 0 through 7, when T1600 routers are connected to a TX Matrix Plus router with 3D
SIBs in a routing matrix.
matching matching—(Optional) Display routing table entries matching the specified prefix
or prefix length.
vlan (all | vlan-name)—(Optional) Display information for all VLANs or for the specified
VLAN.
Output Fields Table 29 on page 876 lists the output fields for the show route forwarding-table command.
Output fields are listed in the approximate order in which they appear. Field names might
be abbreviated (as shown in parentheses) when no level of output is specified, or when
the detail keyword is used instead of the extensive keyword.
Logical system Name of the logical system. This field is displayed if you specify the table All levels
logical-system-name/routing-instance-name option on a device that is configured
for and supports logical systems.
Routing table Name of the routing table (for example, inet, inet6, mpls). All levels
Address family Address family (for example, IP, IPv6, ISO, MPLS, and VPLS). All levels
Route Type (Type) How the route was placed into the forwarding table. When the detail keyword All levels
is used, the route type might be abbreviated (as shown in parentheses):
Next hop IP address of the next hop to the destination. detail extensive
Next hop Type Next-hop type. When the detail keyword is used, the next-hop type might be detail extensive
(Type) abbreviated (as indicated in parentheses):
• broadcast (bcst)—Broadcast.
• deny—Deny.
• discard (dscd) —Discard.
• hold—Next hop is waiting to be resolved into a unicast or multicast type.
• indexed (idxd)—Indexed next hop.
• indirect (indr)—Indirect next hop.
• local (locl)—Local address on an interface.
• routed multicast (mcrt)—Regular multicast next hop.
• multicast (mcst)—Wire multicast next hop (limited to the LAN).
• multicast discard (mdsc)—Multicast discard.
• multicast group (mgrp)—Multicast group member.
• receive (recv)—Receive.
• reject (rjct)—Discard. An ICMP unreachable message was sent.
• resolve (rslv)—Resolving the next hop.
• unicast (ucst)—Unicast.
• unilist (ulst)—List of unicast next hops. A packet sent to this next hop goes
to any next hop in the list.
Index Software index of the next hop that is used to route the traffic for a given prefix. detail extensive none
Route Logical interface index from which the route is learned. For example, for interface extensive
interface-index routes, this is the logical interface index of the route itself. For static routes, this
field is zero. For routes learned through routing protocols, this is the logical
interface index from which the route is learned.
Reference (NhRef) Number of routes that refer to this next hop. detail extensive none
Next-hop interface Interface used to reach the next hop. detail extensive none
(Netif)
Weight Value used to distinguish primary, secondary, and fast reroute backup routes. extensive
Weight information is available when MPLS label-switched path (LSP) link
protection, node-link protection, or fast reroute is enabled, or when the standby
state is enabled for secondary paths. A lower weight value is preferred. Among
routes with the same weight value, load balancing is possible (see the Balance
field description).
Balance Balance coefficient indicating how traffic of unequal cost is distributed among extensive
next hops when a router is performing unequal-cost load balancing. This
information is available when you enable BGP multipath load balancing.
RPF interface List of interfaces from which the prefix can be accepted. Reverse path forwarding extensive
(RPF) information is displayed only when rpf-check is configured on the interface.
Sample Output
...
...
...
...
Destination: default
Route type: user
Route reference: 2 Route interface-index: 0
Flags: sent to PFE
Nexthop: 0:90:69:8e:b1:1b
Next-hop type: unicast Index: 132 Reference: 4
Next-hop interface: fxp0.0
Destination: default
Route type: permanent
Route reference: 0 Route interface-index: 0
Flags: none
Next-hop type: reject Index: 14 Reference: 1
Destination: 127.0.0.1/32
Route type: interface
Route reference: 0 Route interface-index: 0
Flags: sent to PFE
Nexthop: 127.0.0.1
Next-hop type: local Index: 320 Reference: 1
...
Destination: default
Route type: permanent
Route reference: 0 Route interface-index: 0
Flags: sent to PFE
Next-hop type: reject Index: 46 Reference: 1
Destination: 10.0.0.0/8
Route type: interface
Route reference: 0 Route interface-index: 3
Flags: sent to PFE
Next-hop type: resolve Index: 136 Reference: 1
Next-hop interface: fxp1.0
...
Destination: default
Destination: default
Route type: permanent
Route reference: 0 Route interface-index: 0
Flags: sent to PFE
Next-hop type: reject Index: 22 Reference: 1
Destination: ff00::/8
Route type: permanent
Route reference: 0 Route interface-index: 0
Flags: sent to PFE
Next-hop type: multicast discard Index: 21 Reference: 1
...
Destination: default
Route type: permanent
Route reference: 0 Route interface-index: 0
Flags: sent to PFE
Next-hop type: reject Index: 54 Reference: 1
Destination: fe80::2a0:a5ff:fe3d:375/128
Route type: interface
Route reference: 0 Route interface-index: 0
Flags: sent to PFE
Nexthop: fe80::2a0:a5ff:fe3d:375
Next-hop type: local Index: 75 Reference: 1
...
show route The next example is based on the following configuration, which enables an RPF check
forwarding-table on all routes that are learned from this interface, including the interface route:
extensive (RPF)
so-1/1/0 {
unit 0 {
family inet {
rpf-check;
address 15.95.1.2/30;
}
}
}
vt-0/3/0.32770 (VPLS)
user 0 indr 351 4
Push 800000, Push 100002(top)
so-0/0/0.0
Destination: default
Route type: dynamic
Route reference: 0 Route interface-index: 72
Flags: sent to PFE
Next-hop type: flood Index: 289 Reference: 1
Next-hop type: unicast Index: 291 Reference: 3
Next-hop interface: fe-0/1/3.0
Next-hop type: unicast Index: 290 Reference: 3
Next-hop interface: fe-0/1/2.0
Destination: default
Route type: permanent
Route reference: 0 Route interface-index: 0
Flags: none
Next-hop type: discard Index: 341 Reference: 1
Destination: fe-0/1/2.0
Route type: dynamic
Route reference: 0 Route interface-index: 69
Flags: sent to PFE
Next-hop type: flood Index: 293 Reference: 1
Next-hop type: indirect Index: 363 Reference: 4
Next-hop type: Push 800016
Destination: fe-0/1/3.0
Route type: dynamic
Route reference: 0 Route interface-index: 70
Flags: sent to PFE
Next-hop type: flood Index: 292 Reference: 1
Next-hop type: indirect Index: 363 Reference: 4
Next-hop type: Push 800016
Next-hop interface: at-1/0/1.0
Next-hop type: indirect Index: 301 Reference: 5
Next hop: 10.31.3.2
Next-hop type: Push 800000
Next-hop interface: fe-0/1/1.0
Next-hop type: unicast Index: 290 Reference: 3
Next-hop interface: fe-0/1/2.0
Destination: 10:00:00:01:01:01/48
Route type: dynamic
Route reference: 0 Route interface-index: 70
Flags: sent to PFE, prefix load balance
Next-hop type: unicast Index: 291 Reference: 3
Next-hop interface: fe-0/1/3.0
Route used as destination:
Packet count: 6640 Byte count: 675786
Route used as source
Packet count: 6894 Byte count: 696424
Destination: 10:00:00:01:01:04/48
Route type: dynamic
Route reference: 0 Route interface-index: 69
Flags: sent to PFE, prefix load balance
Next-hop type: unicast Index: 290 Reference: 3
Next-hop interface: fe-0/1/2.0
Route used as destination:
Packet count: 96 Byte count: 8079
Route used as source:
Packet count: 296 Byte count: 24955
Destination: 10:00:00:01:03:05/48
Route type: dynamic
Route reference: 0 Route interface-index: 74
Flags: sent to PFE, prefix load balance
Next-hop type: indirect Index: 301 Reference: 5
Next hop: 10.31.3.2
Next-hop type: Push 800000
Next-hop interface: fe-0/1/1.0
...
Logical system: R4
Routing table: vpn-red.iso
ISO:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 rjct 608 1
Logical system: R4
Routing table: vpn-red.inet6
Internet6:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 rjct 708 1
::/128 perm 0 dscd 706 1
ff00::/8 perm 0 mdsc 707 1
ff02::1/128 perm 0 ff02::1 mcst 704 1
Logical system: R4
Routing table: vpn-red.mpls
MPLS:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 dscd 638
Description Display only hidden route information. A hidden route is unusable, even if it is the best
path.
Options brief | detail | extensive | terse—(Optional) Display the specified level of output. If you do
not specify a level of output, the system defaults to brief.
Output Fields For information about output fields, see the output field table for the show route
command, the show route detail command, the show route extensive command, or the
show route terse command.
Sample Output
...
show route hidden The output for the show route hidden extensive command is identical to that of the show
extensive route hidden detail command. For sample output, see show route hidden detail on
page 888.
Description Display routes for destinations that have no active route. An inactive route is a route that
was not selected as the best path.
brief | detail | extensive | terse—(Optional) Display the specified level of output. If you do
not specify a level of output, the system defaults to brief.
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or the
show route terse command.
Sample Output
Direct Preference: 0
Next hop type: Interface
Next-hop reference count: 1
Next hop: via fxp1.0, selected
State: <NotBest Int>
Inactive reason: No difference
Age: 4:40:52
Task: IF
AS path: I
show route The output for the show route inactive-path extensive command is identical to that of
inactive-path the show route inactive-path detail command. For sample output, see show route
extensive
inactive-path detail on page 891.
brief | detail | extensive | terse—(Optional) Display the specified level of output. If you do
not specify a level of output, the system defaults to brief.
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or
the show route terse command.
Sample Output
show route The output for the show route inactive-prefix extensive command is identical to that of
inactive-prefix the show route inactive-path detail command. For sample output, see show route
extensive
inactive-prefix detail on page 895.
Options none—(Same as brief) Display standard information about all routing instances.
brief | detail | summary—(Optional) Display the specified level of output. If you do not
specify a level of output, the system defaults to brief. (These options are not available
with the operational keyword.)
Output Fields Table 30 on page 896 lists the output fields for the show route instance command. Output
fields are listed in the approximate order in which they appear.
Operational Routing Instances (operational keyword only) Names of all operational routing —
instances.
Type Type of routing instance: forwarding, l2vpn, no-forwarding, vpls, All levels
virtual-router, or vrf.
State State of the routing instance: active or inactive. brief detail none
Interfaces Name of interfaces belonging to this routing instance. brief detail none
Restart State Status of graceful restart for this instance: Pending or Complete. detail
Path selection timeout Maximum amount of time, in seconds, remaining until graceful restart detail
is declared complete. The default is 300.
Tables Tables (and number of routes) associated with this routing instance. brief detail none
Route-distinguisher Unique route distinguisher associated with this routing instance. detail
Vrf-import VPN routing and forwarding instance import policy name. detail
Vrf-export VPN routing and forwarding instance export policy name. detail
Vrf-import-target VPN routing and forwarding instance import target community name. detail
Vrf-export-target VPN routing and forwarding instance export target community name. detail
Fast-reroute-priority Fast reroute priority setting for a VPLS routing instance: high, medium, detail
or low. The default is low.
Primary rib Primary table for this routing instance. brief none summary
Sample Output
LDP:
Router ID: 10.69.105.1
Type: vrf State: Active
Restart State: Pending Path selection timeout: 300
Interfaces:
t3-0/0/0.105
Route-distinguisher: 10.255.14.176:105
Vrf-import: [ LDP-import ]
Vrf-export: [ LDP-export ]
Tables:
LDP.inet.0 : 5 routes (4 active, 1 holddown, 0 hidden)
Restart Pending: OSPF LDP VPN
OSPF:
Router ID: 10.69.101.1
Type: vrf State: Active
Restart State: Pending Path selection timeout: 300
Interfaces:
t3-0/0/0.101
Route-distinguisher: 10.255.14.176:101
Vrf-import: [ OSPF-import ]
Vrf-export: [ OSPF-export ]
Tables:
OSPF.inet.0 : 8 routes (7 active, 1 holddown, 0 hidden)
Restart Pending: OSPF VPN
RIP:
Router ID: 10.69.102.1
Type: vrf State: Active
Restart State: Pending Path selection timeout: 300
Interfaces:
t3-0/0/0.102
Route-distinguisher: 10.255.14.176:102
Vrf-import: [ RIP-import ]
Vrf-export: [ RIP-export ]
Tables:
RIP.inet.0 : 8 routes (6 active, 2 holddown, 0 hidden)
Restart Pending: RIP VPN
STATIC:
Router ID: 10.69.100.1
Type: vrf State: Active
Restart State: Pending Path selection timeout: 300
Interfaces:
t3-0/0/0.100
Route-distinguisher: 10.255.14.176:100
Vrf-import: [ STATIC-import ]
Vrf-export: [ STATIC-export ]
Tables:
STATIC.inet.0 : 4 routes (4 active, 0 holddown, 0 hidden)
Restart Pending: VPN
Vrf-export-target: [ target:300:1 ]
Fast-reroute-priority: high
Tables:
test-vpls.l2vpn.0 : 3 routes (3 active, 0 holddown, 0 hidden)
master
default
Description Display the entries in the routing table that are being sent to the specified next-hop
address.
Options brief | detail | extensive | terse—(Optional) Display the specified level of ouput.
next-hop—Next-hop address.
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or the
show route terse command.
Sample Output
Local AS: 1
Age: 6:27:41
Task: RT
Announcement bits (3): 0-KRT 3-Resolve tree 1 5-Resolve tree 2
AS path: I
*Static Preference: 5
Next-hop reference count: 22
Next hop: 192.168.71.254 via fxp0.0, selected
State: <Active NoReadvrt Int Ext>
Local AS: 69
Age: 2:02:28
Task: RT
Announcement bits (1): 0-KRT
AS path: I
Description Display the route entries in each routing table that are not associated with any community.
Options none—(Same as brief) Display the route entries in each routing table that are not
associated with any community.
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or
the show route terse command.
Sample Output
show route
no-community inet.0: 18 destinations, 18 routes (17 active, 0 holddown, 1 hidden)
extensive 10.10.0.0/16 (1 entry, 1 announced)
TSI:
KRT in-kernel 10.10.0.0/16 -> {192.168.71.254}
*Static Preference: 5
Next-hop reference count: 22
Next hop: 192.168.71.254 via fxp0.0, selected
State: <Active NoReadvrt Int Ext>
Local AS: 69
Age: 2:03:33
Task: RT
Announcement bits (1): 0-KRT
AS path: I
Syntax (EX Series show route output (address ip-address | interface interface-name)
Switches) <brief | detail | extensive | terse>
Description Display the entries in the routing table learned through static routes and interior gateway
protocols that are to be sent out the interface with either the specified IP address or
specified name.
To view routes advertised to a neighbor or received from a neighbor for the BGP protocol,
use the show route advertising-protocol bgp and show route receive-protocol bgp
commands instead.
Options address ip-address—Display entries in the routing table that are to be sent out the interface
with the specified IP address.
brief | detail | extensive | terse—(Optional) Display the specified level of output. If you do
not specify a level of output, the system defaults to brief.
interface interface-name—Display entries in the routing table that are to be sent out the
interface with the specified name.
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or
the show route terse command.
Sample Output
show route output user@host> show route output address 36.1.1.1 detail
address detail
inet.0: 28 destinations, 30 routes (27 active, 0 holddown, 1 hidden)
36.1.1.0/24 (2 entries, 0 announced)
*Direct Preference: 0
Next hop type: Interface
Next-hop reference count: 1
Next hop: via so-0/1/2.0, selected
State: <Active Int>
Age: 23:00
Task: IF
AS path: I
OSPF Preference: 10
Next-hop reference count: 1
Next hop: via so-0/1/2.0, selected
State: <Int>
Inactive reason: Route Preference
Age: 22:59 Metric: 1
Area: 0.0.0.0
Task: OSPF
AS path: I
show route output The output for the show route output address extensive command is identical to that of
address extensive the show route output address detail command. For sample output, see show route
output address detail on page 913.
show route output user@host> show route output address 36.1.1.1 terse
address terse
inet.0: 28 destinations, 30 routes (27 active, 0 holddown, 1 hidden)
+ = Active Route, - = Last Active, * = Both
show route output user@host> show route output interface so-0/1/2.0 detail
interface detail
inet.0: 28 destinations, 30 routes (27 active, 0 holddown, 1 hidden)
10.255.71.240/32 (1 entry, 1 announced)
*OSPF Preference: 10
Next-hop reference count: 2
Next hop: via so-0/1/2.0
Next hop: via so-0/3/2.0, selected
State: <Active Int>
Age: 14:52 Metric: 2
Area: 0.0.0.0
Task: OSPF
Announcement bits (1): 0-KRT
AS path: I
show route output The output for the show route output interface extensive command is identical to that of
interface extensive the show route output interface detail command. For sample output, see show route
output interface detail on page 914.
show route output user@host> show route output interface so-0/1/2.0 terse
interface terse
inet.0: 28 destinations, 30 routes (27 active, 0 holddown, 1 hidden)
+ = Active Route, - = Last Active, * = Both
Description Display the route entries in the routing table that were learned from a particular protocol.
Options brief | detail | extensive | terse—(Optional) Display the specified level of output. If you do
not specify a level of output, the system defaults to brief.
• ccc—Circuit cross-connect
• frr—Precomputed protection route or backup route used when a link goes down
• l2circuit—Layer 2 circuit
• local—Local address
• tunnel—Dynamic tunnel
NOTE: EX Series switches run a subset of these protocols. See the switch
CLI for details.
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or
the show route terse command.
Sample Output
show route protocol user@host> show route protocol access-internal 13.160.0.19 extensive
access-internal inet.0: 100020 destinations, 100022 routes (100019 active, 0 holddown, 1 hidden)
extensive 13.160.0.19/32 (1 entry, 1 announced)
TSI:
KRT in-kernel 13.160.0.19/32 -> {13.160.0.2}
*Access-internal Preference: 12
Next-hop reference count: 200000
Next hop: 13.160.0.2 via fe-0/0/0.0, selected
State: <Active Int>
Age: 36
Task: RPD Unix Domain Server./var/run/rpd_serv.local
Announcement bits (1): 0-KRT
AS path: I
show route protocol user@host> show route protocol bgp 66.117.63.0/24 detail
bgp detail inet.0: 335805 destinations, 335806 routes (335356 active, 0 holddown, 450 hidden)
66.117.63.0/24 (1 entry, 1 announced)
*BGP Preference: 170/-101
Next hop type: Indirect
Next-hop reference count: 1006436
Source: 192.168.69.71
Next hop type: Router, Next hop index: 324
Next hop: 192.168.167.254 via fxp0.0, selected
Protocol next hop: 192.168.69.71
Indirect next hop: 8e166c0 342
State: <Active Ext>
Local AS: 69 Peer AS: 10458
Age: 6d 10:42:42 Metric2: 0
Task: BGP_10458.192.168.69.71+179
Announcement bits (3): 0-KRT 2-BGP RT Background 3-Resolve tree
1
AS path: 10458 14203 2914 4788 4788 I
Communities: 2914:410 2914:2403 2914:3400
Accepted
Localpref: 100
Router ID: 207.17.136.192
show route protocol user@host> show route protocol bgp 192.168.64.0/21 extensive
bgp extensive
inet.0: 335827 destinations, 335828 routes (335378 active, 0 holddown, 450 hidden)
192.168.64.0/21 (1 entry, 1 announced)
TSI:
KRT in-kernel 1.9.0.0/16 -> {indirect(342)}
Page 0 idx 1 Type 1 val db31a80
Nexthop: Self
AS path: [69] 10458 14203 2914 4788 4788 I
Communities: 2914:410 2914:2403 2914:3400
Path 1.9.0.0 from 192.168.69.71 Vector len 4. Val: 1
*BGP Preference: 170/-101
Next hop type: Indirect
Next-hop reference count: 1006502
Source: 192.168.69.71
Next hop type: Router, Next hop index: 324
Next hop: 192.168.167.254 via fxp0.0, selected
Protocol next hop: 192.168.69.71
Indirect next hop: 8e166c0 342
State: <Active Ext>
Local AS: 69 Peer AS: 10458
Age: 6d 10:44:45 Metric2: 0
Task: BGP_10458.192.168.69.71+179
Announcement bits (3): 0-KRT 2-BGP RT Background 3-Resolve tree
1
AS path: 10458 14203 2914 4788 4788 I
Communities: 2914:410 2914:2403 2914:3400
Accepted
Localpref: 100
Router ID: 207.17.136.192
Indirect next hops: 1
Protocol next hop: 192.168.69.71
Indirect next hop: 8e166c0 342
Indirect path forwarding next hops: 1
Next hop type: Router
Next hop: 192.168.167.254 via fxp0.0
192.168.0.0/16 Originating RIB: inet.0
Node path count: 1
Forwarding nexthops: 1
Nexthop: 192.168.167.254 via fxp0.0
show route protocol user@host> show route protocol bgp 192.168.64.0/21 terse
bgp terse
inet.0: 24 destinations, 32 routes (23 active, 0 holddown, 1 hidden)
+ = Active Route, - = Last Active, * = Both
47.0005.80ff.f800.0000.0108.0001.0102.5516.5001/152
*[Direct/0] 25w4d 04:13:21
> via lo0.0
abcd::10:255:165:1/128
*[Direct/0] 25w4d 04:13:21
> via lo0.0
fe80::2a0:a5ff:fe12:ad7/128
*[Direct/0] 25w4d 04:13:21
> via lo0.0
AS path: I
Communities: Route-Type:0.0.0.0:1:0
...
show route protocol rip user@host> show route protocol rip detail
detail inet.0: 26 destinations, 27 routes (25 active, 0 holddown, 1 hidden)
+ = Active Route, - = Last Active, * = Both
show route protocol user@host> show route protocol ripng table inet6
ripng table inet6 inet6.0: 4215 destinations, 4215 routes (4214 active, 0 holddown, 1 hidden)
+ = Active Route, - = Last Active, * = Both
Description Display the routing information as it was received through a particular neighbor using a
particular dynamic routing protocol.
Options brief | detail | extensive | terse—(Optional) Display the specified level of output.
protocol neighbor-address—Protocol transmitting the route (bgp, dvmrp, msdp, pim, rip,
or ripng) and address of the neighboring router from which the route entry was
received.
Additional Information The output displays the selected routes and the attributes with which they were received,
but does not show the effects of import policy on the routing attributes.
Output Fields Table 31 on page 928 describes the output fields for the show route receive-protocol
command. Output fields are listed in the approximate order in which they appear.
number Number of destinations for which there are routes in the routing table. All levels
destinations
number routes Number of routes in the routing table and total number of routes in the following All levels
states:
• active
• holddown (routes that are in pending state before being declared inactive)
• hidden (routes that are not used because of a routing policy)
MED Multiple exit discriminator value included in the route. none brief
destination-prefix Destination prefix. The entry value is the number of routes for this destination, detail extensive
(entry, announced) and the announced value is the number of routes being announced for this
destination.
Route Distinguisher 64-bit prefix added to IP subnets to make them unique. detail extensive
Label-Base, range First label in a block of labels and label block size. A remote PE routing device detail extensive
uses this first label when sending traffic toward the advertising PE routing device.
VPN Label Virtual private network (VPN) label. Packets are sent between CE and PE routing detail extensive
devices by advertising VPN labels. VPN labels transit over either an RSVP or an
LDP label-switched path (LSP) tunnel.
Next hop Next hop to the destination. An angle bracket (>) indicates that the route is the All levels
selected route.
AS path Autonomous system (AS) path through which the route was learned. The letters All levels
at the end of the AS path indicate the path origin, providing an indication of the
state of the route at the point at which the AS path originated:
• I—IGP.
• E—EGP.
• ?—Incomplete; typically, the AS path was aggregated.
When AS path numbers are included in the route, the format is as follows:
• [ ]—Brackets enclose the number that precedes the AS path. This number
represents the number of ASs present in the AS path, when calculated as
defined in RFC 4271. This value is used the AS-path merge process, as defined
in RFC 4893.
• [ ]—If more than one AS number is configured on the router, or if AS path
prepending is configured, brackets enclose the local AS number associated
with the AS path.
• { }—Braces enclose AS sets, which are groups of AS numbers in which the
order does not matter. A set commonly results from route aggregation. The
numbers in each AS set are displayed in ascending order.
• ( )—Parentheses enclose a confederation.
• ( [ ] )—Parentheses and brackets enclose a confederation set.
NOTE: In Junos OS Release 10.3 and later, the AS path field displays an
unrecognized attribute and associated hexadecimal value if BGP receives
attribute 128 (attribute set) and you have not configured an independent domain
in any routing instance.
Cluster list (For route reflected output only) Cluster ID sent by the route reflector. detail extensive
Originator ID (For route reflected output only) Address of routing device that originally sent detail extensive
the route to the route reflector.
Communities Community path attribute for the route. See the Output Field table in the show detail extensive
route detail command for all possible values for this field.
AIGP Accumulated interior gateway protocol (AIGP) BGP attribute. detail extensive
Attrset AS Number, local preference, and path of the AS that originated the route. These detail extensive
values are stored in the Attrset attribute at the originating routing device.
mtu Maximum transmission unit (MTU) of the Layer 2 circuit. detail extensive
Sample Output
show route user@host> show route receive-protocol bgp 207.17.136.192 table inet.0 66.117.68.0/24 extensive
receive-protocol bgp inet.0: 227315 destinations, 227316 routes (227302 active, 0 holddown, 13 hidden)
table extensive * 66.117.63.0/24 (1 entry, 1 announced)
Nexthop: 207.17.136.29
Localpref: 100
AS path: AS2 PA[6]: 14203 2914 3356 29748 33437 AS_TRANS
AS path: AS4 PA[2]: 33437 393219
AS path: Merged[6]: 14203 2914 3356 29748 33437 393219 I
Communities: 2914:420
show route user@host> show route receive-protocol bgp 10.0.0.9 logical-system PE4 extensive
receive-protocol bgp inet.0: 12 destinations, 13 routes (12 active, 0 holddown, 0 hidden)
* 10.0.0.0/30 (1 entry, 1 announced)
logical-system Accepted
extensive Route Label: 3
Nexthop: 10.0.0.9
AS path: 13979 I
Nexthop: 10.255.14.174
Localpref: 100
AS path: I
Communities: target:200:100
AttrSet AS: 100
Localpref: 100
AS path: I
* 10.255.14.172/32 (1 entry, 1 announced)
Route Distinguisher: 10.255.14.176:2
VPN Label: 101280
Nexthop: 10.255.14.174
Localpref: 100
AS path: I
Communities: target:200:100
AttrSet AS: 100
Localpref: 100
AS path: I
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
mpls.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
bgp.l3vpn.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
* 10.255.14.174:2:10.49.0.0/30 (1 entry, 0 announced)
Route Distinguisher: 10.255.14.174:2
VPN Label: 101264
Nexthop: 10.255.14.174
Localpref: 100
AS path: I
Communities: target:200:100
AttrSet AS: 100
Localpref: 100
AS path: I
* 10.255.14.174:2:10.255.14.172/32 (1 entry, 0 announced)
Route Distinguisher: 10.255.14.174:2
VPN Label: 101280
Nexthop: 10.255.14.174
Localpref: 100
AS path: I
Communities: target:200:100
AttrSet AS: 100
Localpref: 100
AS path: I
inet6.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
Options brief | detail | extensive | terse—(Optional) Display the specified level of output.
routing-table-name—Display route entries for all routing tables whose name begins with
this string (for example, inet.0 and inet6.0 are both displayed when you run the show
route table inet command).
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or the
show route terse command.
Sample Output
192.168.24.1:1:4:1/96
*[BGP/170] 01:08:58, localpref 100, from 192.168.24.1
AS path: I
> to 10.0.16.2 via fe-0/0/1.0, label-switched-path am
10.255.71.15:100:10.255.71.17/32
*[BGP/170] 00:03:59, MED 1, localpref 100, from
10.255.71.15
AS path: I
> via so-2/1/0.0, Push 100020, Push 100011(top)
10.255.71.15:200:10.255.71.18/32
*[BGP/170] 00:03:59, MED 1, localpref 100, from
10.255.71.15
AS path: I
> via so-2/1/0.0, Push 100021, Push 100011(top)
6496 I
Communities: 2914:410 target:12:34 target:11111:1 origin:12:34
VPN Label: 182465
Localpref: 100
Router ID: 10.255.245.12
6496 I
Communities: 2914:410 target:12:34 target:11111:1 origin:12:34
VPN Label: 182465
Localpref: 100
::10.255.245.195/128
*[LDP/9] 00:00:22, metric 1
> via so-1/0/0.0
::10.255.245.196/128
*[LDP/9] 00:00:08, metric 1
> via so-1/0/0.0, Push 100008
10.1.1.195:NoCtrlWord:1:1:Local/96
*[L2CKT/7] 00:50:47
> via so-0/1/2.0, Push 100049
via so-0/1/3.0, Push 100049
10.1.1.195:NoCtrlWord:1:1:Remote/96
*[LDP/9] 00:50:14
Discard
10.1.1.195:CtrlWord:1:2:Local/96
*[L2CKT/7] 00:50:47
> via so-0/1/2.0, Push 100049
via so-0/1/3.0, Push 100049
10.1.1.195:CtrlWord:1:2:Remote/96
*[LDP/9] 00:50:14
Discard
show route table mpls user@host> show route table mpls extensive
extensive 100000 (1 entry, 1 announced)
TSI:
KRT in-kernel 100000 /36 -> {so-1/0/0.0}
*LDP Preference: 9
Next hop: via so-1/0/0.0, selected
Pop
State: <Active Int>
Age: 29:50 Metric: 1
Task: LDP
Announcement bits (1): 0-KRT
AS path: I
Prefixes bound to route: 10.0.0.194/32
show route table vpls_1 user@host> show route table vpls_1 detail
detail vpls_1.l2vpn.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
Restart Complete
1:1:0:10.255.14.216:232.1.1.1/144
*[MVPN/70] 01:23:05, metric2 1
Indirect
1:1:1:10.255.14.218:232.1.1.1/144
*[BGP/170] 00:57:49, localpref 100, from 10.255.14.218
AS path: I
> via so-0/0/0.0, label-switched-path r0e-to-r1
1:1:2:10.255.14.217:232.1.1.1/144
*[BGP/170] 00:57:49, localpref 100, from 10.255.14.217
AS path: I
> via so-0/0/1.0, label-switched-path r0-to-r2
1:10.255.2.202:65535:10.255.2.202/432
user@PE1> show route table green.l2vpn.0 (VPLS Multihoming with FEC 129)
green.l2vpn.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
1.1.1.2:100:1.1.1.2/96 AD
*[VPLS/170] 1d 03:11:03, metric2 1
Indirect
1.1.1.4:100:1.1.1.4/96 AD
*[BGP/170] 1d 03:11:02, localpref 100, from 1.1.1.4
AS path: I, validation-state: unverified
> via ge-1/2/1.5
1.1.1.2:100:1:0/96 MH
*[VPLS/170] 1d 03:11:03, metric2 1
Indirect
1.1.1.4:100:1:0/96 MH
*[BGP/170] 1d 03:11:02, localpref 100, from 1.1.1.4
AS path: I, validation-state: unverified
> via ge-1/2/1.5
1.1.1.4:NoCtrlWord:5:100:100:1.1.1.2:1.1.1.4/176
*[VPLS/7] 1d 03:11:02, metric2 1
> via ge-1/2/1.5
1.1.1.4:NoCtrlWord:5:100:100:1.1.1.4:1.1.1.2/176
*[LDP/9] 1d 03:11:02
Discard
Nexthop: Self
AS path: [2] I
Communities: target:2:1
Path 22.0.0.0 from 2.3.0.0 Vector len 4. Val: 1
@BGP Preference: 170/-1
Route Distinguisher: 2:1
Next hop type: Indirect
Address: 0x258059e4
Next-hop reference count: 2
Source: 2.2.0.0
Next hop type: Router
Next hop: 10.1.1.1 via ge-1/1/9.0, selected
NOTE: For BGP routes, the show route terse command displays the local
preference attribute and MED instead of the metric1 and metric2 values. This
is mostly due to historical reasons.
To display the metric1 and metric2 value of a BGP route, use the show route
extensive command.
Output Fields Table 32 on page 950 describes the output fields for the show route terse command. Output
fields are listed in the approximate order in which they appear.
number destinations Number of destinations for which there are routes in the routing table.
number routes Number of routes in the routing table and total number of routes in the following states:
• +—A plus sign indicates the active route, which is the route installed from the routing table into the
forwarding table.
• - —A hyphen indicates the last active route.
• *—An asterisk indicates that the route is both the active and the last active route. An asterisk before
a to line indicates the best subpath to the route.
• ?—Not evaluated. Indicates that the route was not learned through BGP.
• I—Invalid. Indicates that the prefix is found, but either the corresponding AS received from the EBGP
peer is not the AS that appears in the database, or the prefix length in the BGP update message is
longer than the maximum length permitted in the database.
• N—Unknown. Indicates that the prefix is not among the prefixes or prefix ranges in the database.
• V—Valid. Indicates that the prefix and autonomous system pair are found in the database.
• A—Aggregate
• B—BGP
• C—CCC
• D—Direct
• G—GMPLS
• I—IS-IS
• L—L2CKT, L2VPN, LDP, Local
• K—Kernel
• M—MPLS, MSDP
• O—OSPF
• P—PIM
• R—RIP, RIPng
• S—Static
• T—Tunnel
Prf Preference value of the route. In every routing metric except for the BGP LocalPref attribute, a lesser
value is preferred. In order to use common comparison routines, Junos OS stores the 1's complement
of the LocalPref value in the Preference2 field. For example, if the LocalPref value for Route 1 is 100,
the Preference2 value is -101. If the LocalPref value for Route 2 is 155, the Preference2 value is -156.
Route 2 is preferred because it has a higher LocalPref value and a lower Preference2 value.
Metric 1 First metric value in the route. For routes learned from BGP, this is the MED metric.
Metric 2 Second metric value in the route. For routes learned from BGP, this is the IGP metric.
Next hop Next hop to the destination. An angle bracket (>) indicates that the route is the selected route.
AS path AS path through which the route was learned. The letters at the end of the AS path indicate the path
origin, providing an indication of the state of the route at the point at which the AS path originated:
• I—IGP.
• E—EGP.
• ?—Incomplete; typically, the AS path was aggregated.
Sample Output
Description Display information about the route validation database when resource public key
infrastructure (RPKI) BGP route validation is configured. You can query all route validation
records that match a given prefix or origin-autonomous-system. In addition, you can filter
the output by a specific RPKI cache session.
record ip-prefix—(Optional) Filter the output by route validation records that match a
given prefix.
Output Fields Table 33 on page 954 describes the output fields for the show validation database
command. Output fields are listed in the approximate order in which they appear.
RV records are received from the cache server and can also be
configured statically at the [edit routing-options validation static]
hierarchy level .
State State of the route validation records. The state can be valid, invalid All levels
or unknown.
Sample Output
IPv4 records: 14
IPv6 records: 0
Output Fields Table 34 on page 955 describes the output fields for the show validation group command.
Output fields are listed in the approximate order in which they appear.
Maximum sessions Number of concurrent sessions for each group. The default is 2. The number
is configurable with the max-sessions statement.
State State of the connection between the routing device and the cache server. Up
means that the connection is established. Connect means that the connection
is not established.
Preference Each cache server has a preference. Higher preferences are preferred. During
a session start or restart, the routing device attempts to start a session with
the cache server that has the numerically highest preference. The routing
device connects to multiple cache servers in preference order.
Sample Output
Description Display the state of the nonstop active routing (NSR) records. The output is the same
as the output of the show validation database command, except for the Mismatch column.
record ip-prefix—(Optional) Filter the output by route validation records that match a
given prefix.
Output Fields Table 35 on page 958 describes the output fields for the show validation replication
database command. Output fields are listed in the approximate order in which they
appear.
RV records are received from the cache server and can also be
configured statically at the [edit routing-options validation static]
hierarchy level.
State State of the route validation records. The state can be valid or invalid. All levels
Sample Output
IPv4 records: 14
IPv6 records: 0
Description Display information about all sessions or a specific session with a resource public key
infrastructure (RPKI) cache server.
Output Fields Table 36 on page 959 describes the output fields for the show validation session command.
Output fields are listed in the approximate order in which they appear.
State State of the connection between the routing device and the cache All levels
server. Up means that the connection is established. Connect means
that the connection is not established.
Uptime Length of time that the session has remained establshed. None and
brief
#IPv4/IPv6 records Number of IPv4 and IPv6 route validation records. None and
brief
Preference Each cache server has a preference. Higher preferences are preferred. detail
During a session start or restart, the routing device attempts to start
a session with the cache server that has the numerically highest
preference. The routing device connects to multiple cache servers
in preference order.
Port TCP port number for the outgoing connection with the cache server. detail
The well-known RPKI port is TCP port 2222. For a given deployment,
an RPKI cache server might listen on some other TCP port number.
If so, you can configure the alternative port number with the port
statement.
Refresh time Liveliness check interval for an RPKI cache server. Everyrefresh-time detail
(seconds), a serial query protocol data unit (PDU) with the last
known serial number is transmitted. The hold-time must be at least
2 x the refresh-time.
Hold time Length of time in seconds that the session between the routing detail
device and the cache server is considered operational without any
activity. After the hold time expires, the session is dropped.
Reception of any PDU from the cache server resets the hold timer.
The hold-time is 600 seconds, by default, and must be least 2 x the
refresh-time. If the hold time expires, the session is considered to be
down. This, in turn, triggers a session restart event. During a session
restart, the routing device attempts to start a session with the cache
server that has the numerically highest preference.
Record Life time Amount of time that route validation (RV) records learned from a detail
cache server are valid. RV records expire if the session to the cache
server goes down and remains down for the record-lifetime
(seconds).
Session uptime Length of time that the session has remained establshed. detail
Last PDU received Time when the most recent PDU was received. detail
Sample Output
Output Fields Table 37 on page 962 describes the output fields for the show validation statistics
command. Output fields are listed in the approximate order in which they appear.
Total Replication RV records Number of concurrent sessions for each group. The default is 2. The number
is configurable with the max-sessions statement.
Prefix entries Resource public key infrastructure (RPKI) cache session IP address.
Origin-AS entries State of the connection between the routing device and the cache server. Up
means that the connection is up. Connect means that the connection is not
up.
Memory utilization Each cache server has a preference. Higher preferences are preferred. During
a session start or restart, the routing device attempts to start a session with
the cache server that has the numerically highest preference. The routing
device connects to multiple cache servers in preference order.
Policy origin-validation requests Number of queries for validation state of a given instance and prefix.
Unknown Number of unknown prefixes reported by the validation query. This means
that the prefix is not found in the database.
BGP import policy reevaluation notifications A change, addition, or deletion of a route validation record triggers a BGP
import reevaluation for all exact matching and more specific prefixes.
inet.0 Number of IPv4 route validation records that have been added, deleted, or
changed.
inet6.0 Number of IPv6 route validation records that have been added, deleted, or
changed.
Sample Output
test policy
Description Test a policy configuration to determine which prefixes match routes in the routing table.
NOTE: If you are using the test policy command on a logical system, you must
first set the CLI to the logical system context. For example, if you want to test
a routing policy that is configured on logical system R2, first run the set cli
logical-system R2 command.
Additional Information All prefixes in the default unicast routing table (inet.0) that match prefixes that are the
same as or longer than the specific prefix are processed by the from clause in the specified
policy. All prefixes accepted by the policy are displayed. The test policy command
evaluates a policy differently from the BGP import process. When testing a policy that
contains an interface match condition in the from clause, the test policy command uses
the match condition. In contrast, BGP does not use the interface match condition when
evaluating the policy against routes learned from internal BGP (IBGP) or external BGP
(EGBP) multihop peers.
Output Fields For information about output fields, see the output field tables for the show route
command, the show route detail command, the show route extensive command, or
the show route terse command.
Sample Output
Troubleshooting
• BGP Troubleshooting on page 969
• Routing Protocol Process Memory FAQs on page 1023
BGP Troubleshooting
Hidden routes are routes that the device cannot use for reasons such as an invalid next
hop or a routing policy that rejects the routes.
NOTE: If a route is completely invalid, the route is not placed into the routing
table as a candidate route and does not even appear as hidden.
Following are some useful commands for viewing and troubleshooting hidden routes:
• The next hop cannot be resolved using the current indirect next hop resolution rule.
Because routing protocols such as internal BGP (IBGP) can send routing information
about indirectly connected routes, Junos OS relies on routes from intra-AS routing
protocols (OSPF, IS-IS, RIP, and static) to resolve the best directly connected next
hop. The Routing Engine performs route resolution to determine the best directly
connected next hop and installs the route to the Packet Forwarding Engine.
• The route reflector cluster ID is looped. If a BGP router that receives a route from an
IBGP neighbor is configured to operate as a route reflector and in the incoming update
detects the presence of its own cluster ID in the cluster-list attribute, it will reject the
update.
• The originator ID is looped. If a BGP router that receives a route from an IBGP neighbor
in the incoming update detects the presence of its own router ID in the originator ID
attribute, it will reject the update.
• The next hop address is the address of the local routing device.
• The AS path is empty. This only applies to EBGP. For IBGP, an empty AS path is normal.
Action
Table 38: Checklist for Verifying the BGP Protocol and Peers
Tasks Command or Action
2. Verify That a Neighbor is Advertising a Particular Route show route advertising-protocol bgp neighbor-address
3. Verify That a Particular BGP Route Is Received on Your Router show route receive-protocol bgp neighbor-address
on page 1011
2. Examine the Multiple Exit Discriminator Route Selection on show route destination-prefix < detail >
page 1003
3. Examine the EBGP over IBGP Selection on page 1003 show route destination-prefix < detail >
4. Examine the IGP Cost Selection on page 1005 show route destination-prefix < detail >
“Examine Routes in the Forwarding Table” on page 1006 show route forwarding-table
5. Verify Received BGP Routes on page 984 show route receive protocol bgp neighbor-address
6. Take Appropriate Action on page 985 The following sequence of commands addresses the
specific problem described in this topic:
[edit]
edit protocols bgp
7. Check That BGP Traffic Is Using the LSP Again on page 986 traceroute hostname
Figure 62 on page 973 illustrates the BGP layer of the layered MPLS model.
When you check the BGP layer, you verify that the route is present and active, and more
importantly, you ensure that the next hop is the LSP. There is no point in checking the
BGP layer unless the LSP is established, because BGP uses the MPLS LSP to forward
traffic. If the network is not functioning at the BGP layer, the LSP does not work as
configured.
Figure 63 on page 974 illustrates the MPLS network used in this topic.
The network shown in Figure 63 on page 974 is a fully meshed configuration where every
directly connected interface can receive and send packets to every other similar interface.
The LSP in this network is configured to run from ingress router R1, through transit router
R3, to egress router R6. In addition, a reverse LSP is configured to run from R6 through
R3 to R1, creating bidirectional traffic.
The cross shown in Figure 63 on page 974 indicates where BGP is not being used to forward
traffic through the LSP. Possible reasons for the LSP not working correctly are that the
destination IP address of the LSP does not equal the BGP next hop or that BGP is not
configured properly.
7. Check That BGP Traffic Is Using the LSP Again on page 986
Action To verify that BGP traffic is using the LSP, enter the following Junos OS command-line
interface (CLI) operational mode command from the ingress router:
Sample Output
user@R1> traceroute 100.100.6.1
traceroute to 100.100.6.1 (100.100.6.1), 30 hops max, 40 byte packets
1 10.1.13.2 (10.1.13.2) 0.653 ms 0.590 ms 0.543 ms
2 10.1.36.2 (10.1.36.2) 0.553 ms !N 0.552 ms !N 0.537 ms !N
Meaning The sample output shows that BGP traffic is not using the LSP, consequently MPLS
labels do not appear in the output. Instead of using the LSP, BGP traffic is using the
interior gateway protocol (IGP) to reach the BGP next-hop LSP egress address for R6
and R1. The Junos OS default is to use LSPs for BGP traffic when the BGP next hop equals
the LSP egress address.
Action To check that BGP sessions are up, enter the following Junos OS CLI operational mode
command from the ingress router:
Sample Output 1
user@R1> show bgp summary
Groups: 1 Peers: 6 Down peers: 1
Table Tot Paths Act Paths Suppressed History Damp State Pending
inet.0 1 1 0 0 0 0
Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn
State|#Active/Received/Damped...
10.0.0.2 65432 11257 11259 0 0 3d 21:49:57 0/0/0
0/0/0
10.0.0.3 65432 11257 11259 0 0 3d 21:49:57 0/0/0
0/0/0
10.0.0.4 65432 11257 11259 0 0 3d 21:49:57 0/0/0
0/0/0
10.0.0.5 65432 11257 11260 0 0 3d 21:49:57 0/0/0
0/0/0
10.0.0.6 65432 4 4572 0 1 3d 21:46:59 Active
10.1.36.2 65432 11252 11257 0 0 3d 21:46:49 1/1/0
0/0/0
Sample Output 2
user@R1> show bgp summary
Groups: 1 Peers: 5 Down peers: 0
Table Tot Paths Act Paths Suppressed History Damp State Pending
inet.0 1 1 0 0 0 0
Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn
State|#Active/Received/Damped...
10.0.0.2 65432 64 68 0 0 32:18 0/0/0
0/0/0
10.0.0.3 65432 64 67 0 0 32:02 0/0/0
0/0/0
10.0.0.4 65432 64 67 0 0 32:10 0/0/0
0/0/0
10.0.0.5 65432 64 67 0 0 32:14 0/0/0
0/0/0
10.0.0.6 65432 38 39 0 1 18:02 1/1/0
0/0/0
Meaning Sample Output 1 shows that one peer (egress router 10.0.0.6 ) is not established, as
indicated by the Down Peers: 1 field. The last column (State|#Active/Received/Damped)
shows that peer 10.0.0.6 is active, indicating that is it not established. All other peers are
established as indicated by the number of active, received, and damped routes. For
example, 0/0/0 for peer 10.0.0.2 indicates that no BGP routes were active or received in
the routing table, and no BGP routes were damped; 1/1/0 for peer 10.1.36.2 indicates that
one BGP route was active and received in the routing table, and no BGP routes were
damped.
If the output of the show bgp summary command of an ingress router shows that a
neighbor is down, check the BGP configuration. For information on checking the BGP
configuration, see “Verify the BGP Configuration” on page 977.
Sample Output 2 shows output from ingress router R1 after the BGP configurations on
R1 and R6 were corrected in “Take Appropriate Action” on page 985. All BGP peers are
established and one route is active and received. No BGP routes were damped.
If the output of the show bgp summary command shows that a neighbor is up but packets
are not being forwarded, check for received routes from the egress router. For information
on checking the egress router for received routes, see “Verify Received BGP Routes” on
page 984.
Action To verify the BGP configuration, enter the following Junos OS CLI operational mode
command:
Sample Output 1
user@R1> show configuration
[...Output truncated...]
interfaces {
so-0/0/0 {
unit 0 {
family inet {
address 10.1.12.1/30;
}
family iso;
family mpls;
}
}
so-0/0/1 {
unit 0 {
family inet {
address 10.1.15.1/30;
}
family iso;
family mpls;
}
}
so-0/0/2 {
unit 0 {
family inet {
address 10.1.13.1/30;
}
family iso;
family mpls;
}
}
fxp0 {
unit 0 {
family inet {
address 192.168.70.143/21;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.0.0.1/32;
}
family iso {
address 49.0004.1000.0000.0001.00;
}
}
}
}
routing-options {
[...Output truncated...]
route 100.100.1.0/24 reject;
}
router-id 10.0.0.1;
autonomous-system 65432;
}
protocols {
rsvp {
interface so-0/0/0.0;
interface so-0/0/1.0;
interface so-0/0/2.0;
interface fxp0.0 {
disable;
}
}
mpls {
label-switched-path R1-to-R6 {
to 10.0.0.6; <<< destination address of the LSP
}
inactive: interface so-0/0/0.0;
inactive: interface so-0/0/1.0;
interface so-0/0/2.0;
interface fxp0.0 {
disable;
}
}
bgp {
export send-statics; <<< missing local-address statement
group internal {
type internal;
neighbor 10.0.0.2;
neighbor 10.0.0.5;
neighbor 10.0.0.4;
neighbor 10.0.0.6;
neighbor 10.0.0.3;
neighbor 10.1.36.2; <<< incorrect interface address
}
}
isis {
level 1 disable;
interface so-0/0/0.0;
interface so-0/0/1.0;
interface so-0/0/2.0;
interface all {
level 2 metric 10;
}
interface fxp0.0 {
disable;
}
interface lo0.0 {
passive;
}
}
ospf {
traffic-engineering;
area 0.0.0.0 {
interface so-0/0/0.0;
interface so-0/0/1.0;
interface so-0/0/2.0;
interface lo0.0; {
passive
}
}
}
}
policy-options {
policy-statement send-statics {
term statics {
from {
route-filter 100.100.1.0/24 exact;
}
then accept;
}
}
}
Sample Output 2
user@R6> show configuration
[...Output truncated...]
interfaces {
so-0/0/0 {
unit 0 {
family inet {
address 10.1.56.2/30;
}
family iso;
family mpls;
}
}
so-0/0/1 {
unit 0 {
family inet {
address 10.1.46.2/30;
}
family iso;
family mpls;
}
}
so-0/0/2 {
unit 0 {
family inet {
address 10.1.26.2/30;
}
family iso;
family mpls;
}
}
so-0/0/3 {
unit 0 {
family inet {
address 10.1.36.2/30;
}
family iso;
family mpls;
}
}
fxp0 {
unit 0 {
family inet {
address 192.168.70.148/21;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.0.0.6/32;
address 127.0.0.1/32;
}
family iso {
address 49.0004.1000.0000.0006.00;
}
}
}
}
routing-options {
[...Output truncated...]
route 100.100.6.0/24 reject;
}
router-id 10.0.0.6;
autonomous-system 65432;
}
protocols {
rsvp {
interface so-0/0/0.0;
interface so-0/0/1.0;
interface so-0/0/2.0;
interface so-0/0/3.0;
interface fxp0.0 {
disable;
}
}
mpls {
label-switched-path R6-to-R1 {
to 10.0.0.1; <<< destination address of the reverse LSP
}
inactive: interface so-0/0/0.0;
inactive: interface so-0/0/1.0;
inactive: interface so-0/0/2.0;
interface so-0/0/3.0;
}
bgp {
group internal {
type internal;
export send-statics; <<< missing local-address statement
neighbor 10.0.0.2;
neighbor 10.0.0.3;
neighbor 10.0.0.4;
neighbor 10.0.0.5;
neighbor 10.0.0.1;
neighbor 10.1.13.1; <<< incorrect interface address
}
}
isis {
level 1 disable;
interface all {
level 2 metric 10;
}
interface fxp0.0 {
disable;
}
interface lo0.0 {
passive;
}
}
ospf {
traffic-engineering;
area 0.0.0.0 {
interface so-0/0/0.0;
interface so-0/0/1.0;
interface so-0/0/2.0;
interface so-0/0/3.0;
interface lo0.0 {
passive;
}
}
}
}
policy-options {
policy-statement send-statics {
term statics {
from {
route-filter 100.100.6.0/24 exact;
}
then accept;
}
}
}
Meaning The sample output shows the BGP configurations on ingress router R1 and egress router
R6. Both configurations show the local AS (65432), one group (internal), and six peers
configured. The underlying interior gateway protocol is IS-IS, and the relevant interfaces
are configured to run IS-IS.
Sample output for ingress router R1 and egress router R6 shows that the BGP protocol
configuration is missing the local-address statement for the internal group. When the
local-address statement is configured, BGP packets are forwarded from the local router
loopback (lo0) interface address, which is the address to which BGP peers are peering.
If the local-address statement is not configured, BGP packets are forwarded from the
outgoing interface address, which does not match the address to which BGP peers are
peering, and BGP does not come up.
On the ingress router, the IP address (10.0.0.1) in the local-address statement should be
the same as the address configured for the LSP on the egress router (R6) in the to
statement at the [edit protocols mpls label-switched-path lsp-path-name ] hierarchy
level. BGP uses this address, which is identical to the LSP address, to forward BGP traffic
through the LSP.
In addition, the BGP configuration on R1 includes two IP addresses for R6, an interface
address (10.1.36.2) and a loopback (lo0) interface address (10.0.0.6), resulting in the
LSP destination address (10.0.0.6) not matching the BGP next-hop address (10.1.36.2).
The BGP configuration on R6 also includes two IP addresses for R1, an interface address
(10.1.13.1) and a loopback (lo0) interface address, resulting in the reverse LSP destination
address (10.0.0.1) not matching the BGP next-hop address (10.1.13.1).
In this instance, because the local-address statement is missing in the BGP configurations
of both routers and the LSP destination address does not match the BGP next-hop
address, BGP is not using the LSP to forward traffic.
Action To examine BGP routes and route selection, enter the following Junos OS CLI operational
mode command:
Sample Output 1
user@R6> show route 100.100.1.1 detail
inet.0: 30 destinations, 46 routes (29 active, 0 holddown, 1 hidden)
100.100.1.0/24 (1 entry, 1 announced)
*BGP Preference: 170/-101
Source: 10.1.13.1
Next hop: via so-0/0/3.0, selected
Protocol next hop: 10.1.13.1 Indirect next hop: 8671594 304
State: <Active Int Ext>
Local AS: 65432 Peer AS: 65432
Age: 4d 5:15:39 Metric2: 2
Task: BGP_65432.10.1.13.1+3048
Announcement bits (2): 0-KRT 4-Resolve inet.0
AS path: I
Localpref: 100
Router ID: 10.0.0.1
Sample Output 2
user@R6> show route 100.100.1.1 detail
inet.0: 30 destinations, 46 routes (29 active, 0 holddown, 1 hidden)
100.100.1.0/24 (1 entry, 1 announced)
*BGP Preference: 170/-101
Source: 10.0.0.1
Next hop: via so-0/0/3.0 weight 1, selected
Label-switched-path R6-to-R1
Label operation: Push 100000
Protocol next hop: 10.0.0.1 Indirect next hop: 8671330 301
State: <Active Int Ext>
Local AS: 65432 Peer AS: 65432
Age: 24:35 Metric2: 2
Task: BGP_65432.10.0.0.1+179
Announcement bits (2): 0-KRT 4-Resolve inet.0
AS path: I
Localpref: 100
Router ID: 10.0.0.1
Meaning Sample Output 1 shows that the BGP next hop (10.1.13.1) does not equal the LSP
destination address (10.0.0.1) in the to statement at the [edit protocols mpls
Sample Output 2, taken after the configurations on R1 and R6 are corrected, shows that
the BGP next hop (10.0.0.1) and the LSP destination address (10.0.0.1) are the same,
indicating that BGP can use the LSP to forward BGP traffic.
Action To verify that a particular BGP route is received on the egress router, enter the following
Junos OS CLI operational mode command:
Sample Output 1
user@R6> show route receive-protocol bgp 10.0.0.1
inet.0: 30 destinations, 46 routes (29 active, 0 holddown, 1 hidden)
<<< missing route
inet.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
Sample Output 2
user@R6> show route receive-protocol bgp 10.0.0.1
inet.0: 30 destinations, 46 routes (29 active, 0 holddown, 1 hidden)
Prefix Nexthop MED Lclpref AS path
* 100.100.1.0/24 10.0.0.1 100 I
Meaning Sample Output 1 shows that ingress router R6 (reverse LSP R6-to-R1) does not receive
any BGP routes into the inet.0 routing table when the BGP configurations of R1 and R6
are incorrect.
Sample Output 2 shows a BGP route installed in the inet.0 routing table after the BGP
configurations on R1 and R6 are corrected using “Take Appropriate Action” on page 985.
1. On ingress router R1, include the local-address statement and delete the incorrect
interface address (repeat these steps on egress router R6):
[edit]
user@R1# edit protocols bgp
[edit protocols bgp]
user@R1# show
user@R1# set local-address 10.0.0.1
user@R1# delete group internal neighbor 10.1.36.2
Meaning The sample output shows that the configuration of BGP on ingress router R1 is now
correct. BGP can now forward BGP traffic through the LSP.
Action To verify that BGP traffic is using the LSP, enter the following Junos OS CLI operational
mode command from the ingress router:
Sample Output
user@R1> traceroute 100.100.6.1
traceroute to 100.100.6.1 (100.100.6.1), 30 hops max, 40 byte packets
1 10.1.13.2 (10.1.13.2) 0.858 ms 0.740 ms 0.714 ms
MPLS Label=100016 CoS=0 TTL=1 S=1
2 10.1.36.2 (10.1.36.2) 0.592 ms !N 0.564 ms !N 0.548 ms !N
Meaning The sample output shows that MPLS labels are used to forward packets through the
LSP. Included in the output is a label value (MPLS Label=100016), the time-to-live value
(TTL=1), and the stack bit value (S=1).
The MPLS Label field is used to identify the packet to a particular LSP. It is a 20-bit field,
with a maximum value of (2^^20-1), approximately 1,000,000.
The time-to-live (TTL) value contains a limit on the number of hops that this MPLS
packet can travel through the network (1). It is decremented at each hop, and if the TTL
value drops below one, the packet is discarded.
The bottom of the stack bit value (S=1) indicates that is the last label in the stack and
that this MPLS packet has one label associated with it. The MPLS implementation in the
Junos OS supports a stacking depth of 3 on the M-series routers and up to 5 on the
T-series routing platforms. For more information on MPLS label stacking, see RFC 3032,
MPLS Label Stack Encoding.
MPLS labels appear in the sample output because the traceroute command is issued to
a BGP destination where the BGP next hop for that route is the LSP egress address. The
Junos OS by default uses LSPs for BGP traffic when the BGP next hop equals the LSP
egress address.
If the BGP next hop does not equal the LSP egress address, the BGP traffic does not use
the LSP, and consequently MPLS labels do not appear in the output for the traceroute
command, as indicated in the sample output in “Check BGP Sessions” on page 975.
Action To check that BGP sessions are up, enter the following Junos OS CLI operational mode
command from the ingress router:
Sample Output 1
user@R1> show bgp summary
Groups: 1 Peers: 6 Down peers: 1
Table Tot Paths Act Paths Suppressed History Damp State Pending
inet.0 1 1 0 0 0 0
Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn
State|#Active/Received/Damped...
10.0.0.2 65432 11257 11259 0 0 3d 21:49:57 0/0/0
0/0/0
10.0.0.3 65432 11257 11259 0 0 3d 21:49:57 0/0/0
0/0/0
10.0.0.4 65432 11257 11259 0 0 3d 21:49:57 0/0/0
0/0/0
10.0.0.5 65432 11257 11260 0 0 3d 21:49:57 0/0/0
0/0/0
10.0.0.6 65432 4 4572 0 1 3d 21:46:59 Active
10.1.36.2 65432 11252 11257 0 0 3d 21:46:49 1/1/0
0/0/0
Sample Output 2
user@R1> show bgp summary
Groups: 1 Peers: 5 Down peers: 0
Table Tot Paths Act Paths Suppressed History Damp State Pending
inet.0 1 1 0 0 0 0
Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn
State|#Active/Received/Damped...
10.0.0.2 65432 64 68 0 0 32:18 0/0/0
0/0/0
10.0.0.3 65432 64 67 0 0 32:02 0/0/0
0/0/0
10.0.0.4 65432 64 67 0 0 32:10 0/0/0
0/0/0
10.0.0.5 65432 64 67 0 0 32:14 0/0/0
0/0/0
10.0.0.6 65432 38 39 0 1 18:02 1/1/0
0/0/0
Meaning Sample Output 1 shows that one peer (egress router 10.0.0.6 ) is not established, as
indicated by the Down Peers: 1 field. The last column (State|#Active/Received/Damped)
shows that peer 10.0.0.6 is active, indicating that is it not established. All other peers are
established as indicated by the number of active, received, and damped routes. For
example, 0/0/0 for peer 10.0.0.2 indicates that no BGP routes were active or received in
the routing table, and no BGP routes were damped; 1/1/0 for peer 10.1.36.2 indicates that
one BGP route was active and received in the routing table, and no BGP routes were
damped.
If the output of the show bgp summary command of an ingress router shows that a
neighbor is down, check the BGP configuration. For information on checking the BGP
configuration, see “Verify the BGP Configuration” on page 977.
Sample Output 2 shows output from ingress router R1 after the BGP configurations on
R1 and R6 were corrected in “Take Appropriate Action” on page 985. All BGP peers are
established and one route is active and received. No BGP routes were damped.
If the output of the show bgp summary command shows that a neighbor is up but packets
are not being forwarded, check for received routes from the egress router. For information
on checking the egress router for received routes, see “Verify Received BGP Routes” on
page 984.
Figure 64 on page 989 illustrates an example BGP network topology used in this topic.
The network consists of two directly connected ASs consisting of external and internal
peers. The external peers are directly connected through a shared interface and are
running EBGP. The internal peers are connected through their loopback (lo0) interfaces
through IBGP. AS 65001 is running OSPF and AS 65002 is running IS-IS as its underlying
IGP. IBGP routers do not have to be directly connected, the underlying IGP allows neighbors
to reach one another.
The two routers in AS 65001 each contain one EBGP link to AS 65002 (R2 and R4) over
which they announce aggregated prefixes: 100.100.1.0, 100.100.2.0, 100.100.3.0, and
100.100.4.0. Also, R1 and R5 are injecting multiple exit discriminator (MED) values of 5
and 10, respectively, for some routes.
The internal routers in both ASs are using a full mesh IBGP topology. A full mesh is required
because the networks are not using confederations or route reflectors, so any routes
learned through IBGP are not distributed to other internal neighbors. For example, when
R3 learns a route from R2, R3 does not distribute that route to R6 because the route is
learned through IBGP, so R6 must have a direct BGP connection to R2 to learn the route.
In a full mesh topology, only the border router receiving external BGP information
distributes that information to other routers within its AS. The receiving router does not
redistribute that information to other IBGP routers in its own AS.
From the point of view of AS 65002, the following sessions should be up:
• The four routers in AS 65002 should have IBGP sessions established with each other.
Figure 65 on page 991 illustrates the example configurations used in this topic.
The network in Figure 65 on page 991 consists of two directly connected ASs. IP addresses
included in the network diagram are as follows:
All routers within each AS maintain an IBGP session between each router in that AS. R1
and R5 have an IBGP session through their loopback (lo0) interfaces: 10.0.0.1 and 10.0.05.
R2, R3, R4, and R6 maintain IBGP sessions between each other through their loopback
(lo0) interfaces: 10.0.0.2, 10.0.0.3, 10.0.0.4, and 10.0.0.6.
The two routers in AS 65001 each contain one EBGP link to AS 65002 (R2 and R4) over
which they announce aggregated prefixes: 100.100/16. Routers at the edge of a network
that communicate directly with routers in other networks are called border routers. Border
routers use EBGP to exchange routing information between networks.
Adjacent BGP routers are referred to as neighbors or peers. Peers can be internal or
external to the AS. Internal and external peers are configured slightly differently. In general,
internal peers communicate using the loopback (lo0) interface, and external peers
communicate through the shared interface. See Figure 65 on page 991 for the loopback
(lo0) and interface information.
To verify the BGP configuration of a router in your network, follow these steps:
Action To verify the BGP configuration, enter the following Junos OS CLI operational mode
command:
Sample Output 1
user@R1> show configuration
[...Output truncated...]
interfaces {
so-0/0/0 {
unit 0 {
family inet {
address 10.1.12.1/30;
}
family iso;
family mpls;
}
}
so-0/0/1 {
unit 0 {
family inet {
address 10.1.15.1/30;
}
family iso;
family mpls;
}
}
so-0/0/2 {
unit 0 {
family inet {
address 10.1.13.1/30;
}
family iso;
family mpls;
}
}
fxp0 {
unit 0 {
family inet {
address 192.168.70.143/21;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.0.0.1/32;
}
family iso {
address 49.0004.1000.0000.0001.00;
}
}
}
}
routing-options {
[...Output truncated...]
route 100.100.1.0/24 reject;
}
router-id 10.0.0.1;
autonomous-system 65432;
}
protocols {
rsvp {
interface so-0/0/0.0;
interface so-0/0/1.0;
interface so-0/0/2.0;
interface fxp0.0 {
disable;
}
}
mpls {
label-switched-path R1-to-R6 {
to 10.0.0.6; <<< destination address of the LSP
}
inactive: interface so-0/0/0.0;
inactive: interface so-0/0/1.0;
interface so-0/0/2.0;
interface fxp0.0 {
disable;
}
}
bgp {
export send-statics; <<< missing local-address statement
group internal {
type internal;
neighbor 10.0.0.2;
neighbor 10.0.0.5;
neighbor 10.0.0.4;
neighbor 10.0.0.6;
neighbor 10.0.0.3;
neighbor 10.1.36.2; <<< incorrect interface address
}
}
isis {
level 1 disable;
interface so-0/0/0.0;
interface so-0/0/1.0;
interface so-0/0/2.0;
interface all {
level 2 metric 10;
}
interface fxp0.0 {
disable;
}
interface lo0.0 {
passive;
}
}
ospf {
traffic-engineering;
area 0.0.0.0 {
interface so-0/0/0.0;
interface so-0/0/1.0;
interface so-0/0/2.0;
interface lo0.0; {
passive
}
}
}
}
policy-options {
policy-statement send-statics {
term statics {
from {
route-filter 100.100.1.0/24 exact;
}
then accept;
}
}
}
Sample Output 2
user@R6> show configuration
[...Output truncated...]
interfaces {
so-0/0/0 {
unit 0 {
family inet {
address 10.1.56.2/30;
}
family iso;
family mpls;
}
}
so-0/0/1 {
unit 0 {
family inet {
address 10.1.46.2/30;
}
family iso;
family mpls;
}
}
so-0/0/2 {
unit 0 {
family inet {
address 10.1.26.2/30;
}
family iso;
family mpls;
}
}
so-0/0/3 {
unit 0 {
family inet {
address 10.1.36.2/30;
}
family iso;
family mpls;
}
}
fxp0 {
unit 0 {
family inet {
address 192.168.70.148/21;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.0.0.6/32;
address 127.0.0.1/32;
}
family iso {
address 49.0004.1000.0000.0006.00;
}
}
}
}
routing-options {
[...Output truncated...]
route 100.100.6.0/24 reject;
}
router-id 10.0.0.6;
autonomous-system 65432;
}
protocols {
rsvp {
interface so-0/0/0.0;
interface so-0/0/1.0;
interface so-0/0/2.0;
interface so-0/0/3.0;
interface fxp0.0 {
disable;
}
}
mpls {
label-switched-path R6-to-R1 {
to 10.0.0.1; <<< destination address of the reverse LSP
}
inactive: interface so-0/0/0.0;
inactive: interface so-0/0/1.0;
inactive: interface so-0/0/2.0;
interface so-0/0/3.0;
}
bgp {
group internal {
type internal;
export send-statics; <<< missing local-address statement
neighbor 10.0.0.2;
neighbor 10.0.0.3;
neighbor 10.0.0.4;
neighbor 10.0.0.5;
neighbor 10.0.0.1;
neighbor 10.1.13.1; <<< incorrect interface address
}
}
isis {
level 1 disable;
interface all {
level 2 metric 10;
}
interface fxp0.0 {
disable;
}
interface lo0.0 {
passive;
}
}
ospf {
traffic-engineering;
area 0.0.0.0 {
interface so-0/0/0.0;
interface so-0/0/1.0;
interface so-0/0/2.0;
interface so-0/0/3.0;
interface lo0.0 {
passive;
}
}
}
}
policy-options {
policy-statement send-statics {
term statics {
from {
route-filter 100.100.6.0/24 exact;
}
then accept;
}
}
}
Meaning The sample output shows the BGP configurations on ingress router R1 and egress router
R6. Both configurations show the local AS (65432), one group (internal), and six peers
configured. The underlying interior gateway protocol is IS-IS, and the relevant interfaces
are configured to run IS-IS.
Sample output for ingress router R1 and egress router R6 shows that the BGP protocol
configuration is missing the local-address statement for the internal group. When the
local-address statement is configured, BGP packets are forwarded from the local router
loopback (lo0) interface address, which is the address to which BGP peers are peering.
If the local-address statement is not configured, BGP packets are forwarded from the
outgoing interface address, which does not match the address to which BGP peers are
peering, and BGP does not come up.
On the ingress router, the IP address (10.0.0.1) in the local-address statement should be
the same as the address configured for the LSP on the egress router (R6) in the to
statement at the [edit protocols mpls label-switched-path lsp-path-name ] hierarchy
level. BGP uses this address, which is identical to the LSP address, to forward BGP traffic
through the LSP.
In addition, the BGP configuration on R1 includes two IP addresses for R6, an interface
address (10.1.36.2) and a loopback (lo0) interface address (10.0.0.6), resulting in the
LSP destination address (10.0.0.6) not matching the BGP next-hop address (10.1.36.2).
The BGP configuration on R6 also includes two IP addresses for R1, an interface address
(10.1.13.1) and a loopback (lo0) interface address, resulting in the reverse LSP destination
address (10.0.0.1) not matching the BGP next-hop address (10.1.13.1).
In this instance, because the local-address statement is missing in the BGP configurations
of both routers and the LSP destination address does not match the BGP next-hop
address, BGP is not using the LSP to forward traffic.
[edit]
user@host# edit protocol bgp traceoptions
2. Configure the flag to display sent, received, or both sent and received packet
information:
or
or
user@host# show
For example:
or
or
user@host# commit
For example:
[edit]
user@host# edit protocol bgp
user@host# show
For example:
user@host# commit
For example:
[...Output truncated...]
The network in Figure 66 on page 1000 shows that R1 and R5 announce the same aggregate
routes to R2 and R4, which results in R2 and R4 receiving two routes to the same
destination prefix. The route selection process on R2 and R4 determines which of the
two BGP routes received is active and advertised to the other internal routers (R3 and
R6).
Before the router installs a BGP route, it must make sure that the BGP next-hop attribute
is reachable. If the BGP next hop cannot be resolved, the route is not installed. When a
BGP route is installed in the routing table, it must go through a path selection process if
multiple routes exist to the same destination prefix. The BGP path selection process
proceeds in the following order:
1. Route preference in the routing table is compared. For example, if an OSPF and a BGP
route exist for a particular destination, the OSPF route is selected as the active route
because the OSPF route has a default preference of 110, while the BGP route has a
default preference of 170.
2. Routes are compared for local preference. The route with the highest local preference
is preferred. For example, see “Examine the Local Preference Selection” on page 1002.
4. The origin code is evaluated. The lowest origin code is preferred ( I (IGP) < E (EGP) <
? (Incomplete)).
5. The MED value is evaluated. By default, if any of the routes are advertised from the
same neighboring AS, the lowest MED value is preferred. The absence of a MED value
is interpreted as a MED of 0. For an example, see “Examine the Multiple Exit
Discriminator Route Selection” on page 1003.
6. The route is evaluated as to whether it is learned through EBGP or IBGP. EBGP learned
routes are preferred to IBGP learned routes. For an example, see “Examine the EBGP
over IBGP Selection” on page 1003
7. If the route is learned from IBGP, the route with the lowest IGP cost is preferred. For
an example, see “Examine the IGP Cost Selection” on page 1005. The physical next hop
to the IBGP peer is installed according to the following three rules:
a. After BGP examines the inet.0 and inet.3 routing tables, the physical next hop
of the route with the lowest preference is used.
b. If the preference values in the inet.0 and the inet.3 routing tables are a tie, the
physical next hop of the route in the inet.3 routing table is used.
c. When a preference tie exists in the same routing table, the physical next hop of
the route with more paths is installed.
8. The route reflection cluster list attribute is evaluated. The shortest length cluster list
is preferred. Routes without a cluster list are considered to have a cluster list length
of 0.
9. The router ID is evaluated. The route from the peer with the lowest router ID is preferred
(usually the loopback address).
10. The peer address value is examined. The peer with the lowest peer IP address is
preferred.
To determine the single, active path when BGP receives multiple routes to the same
destination prefix, enter the following Junos OS CLI operational mode command:
The following steps illustrate the inactive reason displayed when BGP receives multiple
routes to the same destination prefix and one route is selected as the single, active path:
Action To examine a route to determine if local preference is the selection criteria for the single,
active path, enter the following Junos OS CLI operational mode command:
Sample Output
user@R4> show route 100.100.1.0 detail
inet.0: 20 destinations, 24 routes (20 active, 0 holddown, 0 hidden)
100.100.1.0/24 (2 entries, 1 announced)
*BGP Preference: 170/-201
Source: 10.0.0.2
Next hop: 10.1.24.1 via so-0/0/3.0, selected
Protocol next hop: 10.0.0.2 Indirect next hop: 8644000 277
State: <Active Int Ext>
Local AS: 65002 Peer AS: 65002
Age: 2:22:34 Metric: 5 Metric2: 10
Task: BGP_65002.10.0.0.2+179
Announcement bits (3): 0-KRT 3-BGP.0.0.0.0+179 4-Resolve inet.0
AS path: 65001 I
Localpref: 200
Router ID: 10.0.0.2
BGP Preference: 170/-101
Source: 10.1.45.2
Next hop: 10.1.45.2 via so-0/0/2.0, selected
State: <Ext>
Inactive reason: Local Preference
Local AS: 65002 Peer AS: 65001
Age: 2w0d 1:28:31 Metric: 10
Task: BGP_65001.10.1.45.2+179
AS path: 65001 I
Localpref: 100
Router ID: 10.0.0.5
Meaning The sample output shows that R4 received two instances of the 100.100.1.0 route: one
from 10.0.0.2 (R2) and one from 10.1.45.2 (R5). R4 selected the path from R2 as its active
path, as indicated by the asterisk (*). The selection is based on the local preference value
contained in the Localpref field. The path with the highest local preference is preferred.
In the example, the path with the higher local preference value is the path from R2, 200.
The reason that the route from R5 is not selected is in the Inactive reason field, in this
case, Local Preference.
Note that the two paths are from the same neighboring network: AS 65001.
Action To examine a route to determine if the MED is the selection criteria for the single, active
path, enter the following Junos OS CLI operational mode command:
Sample Output
user@R4> show route 100.100.2.0 detail
inet.0: 20 destinations, 24 routes (20 active, 0 holddown, 0 hidden)
100.100.2.0/24 (2 entries, 1 announced)
*BGP Preference: 170/-101
Source: 10.0.0.2
Next hop: 10.1.24.1 via so-0/0/3.0, selected
Protocol next hop: 10.0.0.2 Indirect next hop: 8644000 277
State: <Active Int Ext>
Local AS: 65002 Peer AS: 65002
Age: 2:32:01 Metric: 5 Metric2: 10
Task: BGP_65002.10.0.0.2+179
Announcement bits (3): 0-KRT 3-BGP.0.0.0.0+179 4-Resolve inet.0
AS path: 65001 I
Localpref: 100
Router ID: 10.0.0.2
BGP Preference: 170/-101
Source: 10.1.45.2
Next hop: 10.1.45.2 via so-0/0/2.0, selected
State: <NotBest Ext>
Inactive reason: Not Best in its group
Local AS: 65002 Peer AS: 65001
Age: 2w0d 1:37:58 Metric: 10
Task: BGP_65001.10.1.45.2+179
AS path: 65001 I
Localpref: 100
Router ID: 10.0.0.5
Meaning The sample output shows that R4 received two instances of the 100.100.2.0 route: one
from 10.0.0.2 (R2), and one from 10.1.45.2 (R5). R4 selected the path from R2 as its active
route, as indicated by the asterisk (*). The selection is based on the MED value contained
in the Metric: field. The path with the lowest MED value is preferred. In the example, the
path with the lowest MED value (5) is the path from R2. Note that the two paths are from
the same neighboring network: AS 65001.
The reason that the inactive path is not selected is displayed in the Inactive reason: field,
in this case, Not Best in its group. The wording is used because the Junos OS uses the
process of deterministic MED selection, by default.
Action To examine a route to determine if EBGP is selected over IBGP as the selection criteria
for the single, active path, enter the following Junos OS CLI operational mode command:
Sample Output
user@R4> show route 100.100.3.0 detail
inet.0: 20 destinations, 24 routes (20 active, 0 holddown, 0 hidden)
100.100.3.0/24 (2 entries, 1 announced)
*BGP Preference: 170/-101
Source: 10.1.45.2
Next hop: 10.1.45.2 via so-0/0/2.0, selected
State: <Active Ext>
Local AS: 65002 Peer AS: 65001
Age: 5d 0:31:25
Task: BGP_65001.10.1.45.2+179
Announcement bits (3): 0-KRT 3-BGP.0.0.0.0+179 4-Resolve inet.0
AS path: 65001 I
Localpref: 100
Router ID: 10.0.0.5
BGP Preference: 170/-101
Source: 10.0.0.2
Next hop: 10.1.24.1 via so-0/0/3.0, selected
Protocol next hop: 10.0.0.2 Indirect next hop: 8644000 277
State: <NotBest Int Ext>
Inactive reason: Interior > Exterior > Exterior via Interior
Local AS: 65002 Peer AS: 65002
Age: 2:48:18 Metric2: 10
Task: BGP_65002.10.0.0.2+179
AS path: 65001 I
Localpref: 100
Router ID: 10.0.0.2
Meaning The sample output shows that R4 received two instances of the 100.100.3.0 route: one
from 10.1.45.2 (R5) and one from 10.0.0.2 (R2). R4 selected the path from R5 as its active
path, as indicated by the asterisk (*). The selection is based on a preference for routes
learned from an EBGP peer over routes learned from an IBGP. R5 is an EBGP peer.
You can determine if a path is received from an EBGP or IBGP peer by examining the
Local As and Peer As fields. For example, the route from R5 shows the local AS is 65002
and the peer AS is 65001, indicating that the route is received from an EBGP peer. The
route from R2 shows that both the local and peer AS is 65002, indicating that it is received
from an IBGP peer.
The reason that the inactive path is not selected is displayed in the Inactive reason field,
in this case, Interior > Exterior > Exterior via Interior. The wording of this reason shows the
order of preferences applied when the same route is received from two routers. The route
received from a strictly internal source (IGP) is preferred first, the route received from an
external source (EBGP) is preferred next, and any route which comes from an external
source and is received internally (IBGP) is preferred last.
Action To examine a route to determine if EBGP is selected over IBGP as the selection criteria
for the single, active path, enter the following Junos OS CLI operational mode command:
Sample Output
user@R6> show route 100.100.4.0 detail
inet.0: 18 destinations, 20 routes (18 active, 0 holddown, 0 hidden)
100.100.4.0/24 (2 entries, 1 announced)
*BGP Preference: 170/-101
Source: 10.0.0.4
Next hop: 10.1.46.1 via so-0/0/1.0, selected
Protocol next hop: 10.0.0.4 Indirect next hop: 864c000 276
State: <Active Int Ext>
Local AS: 65002 Peer AS: 65002
Age: 2:16:11 Metric2: 10
Task: BGP_65002.10.0.0.4+4120
Announcement bits (2): 0-KRT 4-Resolve inet.0
AS path: 65001 I
Localpref: 100
Router ID: 10.0.0.4
BGP Preference: 170/-101
Source: 10.0.0.2
Next hop: 10.1.46.1 via so-0/0/1.0, selected
Next hop: 10.1.36.1 via so-0/0/3.0
Protocol next hop: 10.0.0.2 Indirect next hop: 864c0b0 278
State: <NotBest Int Ext>
Inactive reason: IGP metric
Local AS: 65002 Peer AS: 65002
Age: 2:16:03 Metric2: 20
Task: BGP_65002.10.0.0.2+179
AS path: 65001 I
Localpref: 100
Router ID: 10.0.0.2
Meaning The sample output shows that R6 received two instances of the 100.100.4.0 route: one
from 10.0.0.4 (R4) and one from 10.0.0.2 (R2). R6 selected the path from R4 as its active
route, as indicated by the asterisk (*). The selection is based on the IGP metric, displayed
in the Metric2 field. The route with the lowest IGP metric is preferred. In the example, the
path with the lowest IGP metric value is the path from R4, with an IGP metric value of
10, while the path from R2 has an IGP metric of 20. Note that the two paths are from the
same neighboring network: AS 65001.
The reason that the inactive path was not selected is displayed in the Inactive reason
field, in this case, IGP metric.
Action To display the set of routes installed in the forwarding table, enter the following Junos
OS CLI operational mode command:
Sample Output
user@R2> show route forwarding-table
Routing table: inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 rjct 10 1
10.0.0.2/32 intf 0 10.0.0.2 locl 256 1
10.0.0.3/32 user 1 10.1.23.0 ucst 282 4 so-0/0/1.0
10.0.0.4/32 user 1 10.1.24.0 ucst 290 7 so-0/0/3.0
10.0.0.6/32 user 1 10.1.24.0 ucst 290 7 so-0/0/3.0
10.1.12.0/30 intf 1 ff.3.0.21 ucst 278 6 so-0/0/0.0
10.1.12.0/32 dest 0 10.1.12.0 recv 280 1 so-0/0/0.0
10.1.12.2/32 intf 0 10.1.12.2 locl 277 1
10.1.12.3/32 dest 0 10.1.12.3 bcst 279 1 so-0/0/0.0
10.1.23.0/30 intf 0 ff.3.0.21 ucst 282 4 so-0/0/1.0
10.1.23.0/32 dest 0 10.1.23.0 recv 284 1 so-0/0/1.0
10.1.23.1/32 intf 0 10.1.23.1 locl 281 1
10.1.23.3/32 dest 0 10.1.23.3 bcst 283 1 so-0/0/1.0
10.1.24.0/30 intf 0 ff.3.0.21 ucst 290 7 so-0/0/3.0
10.1.24.0/32 dest 0 10.1.24.0 recv 292 1 so-0/0/3.0
10.1.24.1/32 intf 0 10.1.24.1 locl 289 1
10.1.24.3/32 dest 0 10.1.24.3 bcst 291 1 so-0/0/3.0
10.1.36.0/30 user 0 10.1.23.0 ucst 282 4 so-0/0/1.0
10.1.46.0/30 user 0 10.1.24.0 ucst 290 7 so-0/0/3.0
100.100.1.0/24 user 0 10.1.12.0 ucst 278 6 so-0/0/0.0
100.100.2.0/24 user 0 10.1.12.0 ucst 278 6 so-0/0/0.0
100.100.3.0/24 user 0 10.1.12.0 ucst 278 6 so-0/0/0.0
100.100.4.0/24 user 0 10.1.12.0 ucst 278 6 so-0/0/0.0
[...Output truncated...]
Meaning The sample output shows the network-layer prefixes and their next hops installed in the
forwarding table. The output includes the same next-hop information as in the show
route detail command (the next-hop address and interface name). Additional information
includes the destination type, the next-hop type, the number of references to this next
hop, and an index into an internal next-hop database. (The internal database contains
additional information used by the Packet Forwarding Engine to ensure proper
encapsulation of packets sent out an interface. This database is not accessible to the
user.
For detailed information about the meanings of the various flags and types fields, see
the Junos Routing Protocols and Policies Command Reference.
Action To log BGP state transition events to the system log, follow these steps:
[edit]
user@host# edit protocol bgp
user@host# show
user@host# commit
Meaning Log messages from BGP state transition events are sufficient to diagnose most BGP
session problems. Table 40 on page 1007 lists and describes the six states of a BGP session.
Idle This is the first state of a connection. BGP waits for a start event initiated by
an administrator. The start event might be the establishment of a BGP session
through router configuration or the resetting of an existing session. After the
start event, BGP initializes its resources, resets a connect-retry timer, initiates
a TCP transport connection, and starts listening for connections initiated by
remote peers. BGP then transitions to a Connect state.
Connect BGP waits for the transport protocol connection to complete. If the TCP
transport connection is successful, the state transitions to OpenSent.
If the connect-retry timer has expired, the state remains in the Connect state,
the timer is reset, and a transport connection is initiated.
If the connect-retry timer expires, BGP restarts the connect timer and falls
back to the Connect state. BGP continues to listen for a connection that may
be initiated from another peer. The state may go back to Idle in case of other
events, such as a stop event.
OpenSent BGP receives an open message from its peer. In the OpenSent state, BGP
compares its autonomous system (AS) number with the AS number of its
peer and recognizes whether the peer belongs to the same AS (internal BGP)
or to a different AS (external BGP).
The open message is checked for correctness. In case of errors, such as a bad
version number of an unacceptable AS, BGP sends an error-notification
message and goes back to Idle.
For any other errors, such as expiration of the hold timer or a stop event, BGP
sends a notification message with the corresponding error code and falls back
to the Idle state.
If there are no errors, BGP sends keepalive messages and resets the keepalive
timer. In this state, the hold time is negotiated. If the hold time is 0, the hold
and keepalive timers are not restarted.
When a TCP transport disconnect is detected, the state falls back to Active.
The system sends periodic keepalive messages at the rate set by the keepalive
timer. In case of a transport disconnect notification or in response to a stop
event, the state falls back to Idle. In response to other events, the system
sends a notification message with a finite state machine (FSM) error code
and goes back to Idle.
Established This is the final state in the neighbor negotiation. In this state, BGP exchanges
update ackets with its peers and the hold timer is restarted at the receipt of
an update or keepalive message when it is not set to zero.
If the system receives a notification message, the state falls back to Idle.
Update messages are checked for errors, such as missing attributes, duplicate
attributes, and so on. If errors are found, a notification is sent to the peer, and
the state falls back to Idle.
BGP goes back to Idle when the hold timer expires, a disconnect notification
is received from the transport protocol, a stop event is received, or in response
to any other event.
For more detailed BGP protocol packet information, configure BGP-specific tracing. See
Checklist for Tracking Error Conditions for more information.
[edit]
user@host# edit protocol bgp traceoptions
user@host# show
For example:
user@host# commit
For example:
Meaning Table 41 on page 1010 lists tracing flags specific to BGP and presents example output for
some of the flags. You can also configure tracing for a specific BGP peer or peer group.
For more information, see the Junos System Basics Configuration Guide.
keepalive BGP keepalive messages Nov 28 17:09:27 bgp_send: sending 19 bytes to 10.217.5.101 (External AS 65471)
Nov 28 17:09:27
Nov 28 17:09:27 BGP SEND 10.217.5.1+179 -> 10.217.5.101+52162
Nov 28 17:09:27 BGP SEND message type 4 (KeepAlive) length 19
Nov 28 17:09:28
Nov 28 17:09:28 BGP RECV 10.217.5.101+52162 -> 10.217.5.1+179
Nov 28 17:09:28 BGP RECV message type 4 (KeepAlive) length 19
open BGP open packets Nov 28 18:37:42 bgp_send: sending 37 bytes to 10.217.5.101 (External AS 65471)
Nov 28 18:37:42
Nov 28 18:37:42 BGP SEND 10.217.5.1+179 -> 10.217.5.101+38135
Nov 28 18:37:42 BGP SEND message type 1 (Open) length 37
packets All BGP protocol packets Sep 27 17:45:31 BGP RECV 10.0.100.108+179 -> 10.0.100.105+1033
Sep 27 17:45:31 BGP RECV message type 4 (KeepAlive) length 19
Sep 27 17:45:31 bgp_send: sending 19 bytes to 10.0.100.108 (Internal AS 100)
Sep 27 17:45:31 BGP SEND 10.0.100.105+1033 -> 10.0.100.108+179
Sep 27 17:45:31 BGP SEND message type 4 (KeepAlive) length 19
Sep 27 17:45:31 bgp_read_v4_update: receiving packet(s) from 10.0.100.108 (Internal AS
100)
update Update packets Nov 28 19:05:24 BGP SEND 10.217.5.1+179 -> 10.217.5.101+55813
Nov 28 19:05:24 BGP SEND message type 2 (Update) length 53
Nov 28 19:05:24 bgp_send: sending 65 bytes to 10.217.5.101 (External AS 65471)
Nov 28 19:05:24
Nov 28 19:05:24 BGP SEND 10.217.5.1+179 -> 10.217.5.101+55813
Nov 28 19:05:24 BGP SEND message type 2 (Update) length 65
Nov 28 19:05:24 bgp_send: sending 55 bytes to 10.217.5.101 (External AS 65471)
Action To verify that a particular BGP route is received on the egress router, enter the following
Junos OS CLI operational mode command:
Sample Output 1
user@R6> show route receive-protocol bgp 10.0.0.1
inet.0: 30 destinations, 46 routes (29 active, 0 holddown, 1 hidden)
<<< missing route
inet.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
Sample Output 2
user@R6> show route receive-protocol bgp 10.0.0.1
inet.0: 30 destinations, 46 routes (29 active, 0 holddown, 1 hidden)
Prefix Nexthop MED Lclpref AS path
* 100.100.1.0/24 10.0.0.1 100 I
Meaning Sample Output 1 shows that ingress router R6 (reverse LSP R6-to-R1) does not receive
any BGP routes into the inet.0 routing table when the BGP configurations of R1 and R6
are incorrect.
Sample Output 2 shows a BGP route installed in the inet.0 routing table after the BGP
configurations on R1 and R6 are corrected using “Take Appropriate Action” on page 985.
Action To verify that a particular BGP route is received on your router, enter the following Junos
OS CLI operational mode command:
Sample Output
user@R6> show route receive-protocol bgp 10.0.0.2
inet.0: 18 destinations, 20 routes (18 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 100.100.1.0/24 10.0.0.2 5 200 65001 I
* 100.100.2.0/24 10.0.0.2 5 100 65001 I
100.100.3.0/24 10.0.0.2 100 65001 I
100.100.4.0/24 10.0.0.2 100 65001 I
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
Meaning The sample output shows four BGP routes from R2 and two from R4. Of the four routes
from R2, only two are active in the routing table, as indicated by the asterisk (*), while
both routes received from R4 are active in the routing table. All BGP routes came through
AS 65001.
Action To verify that BGP traffic is using the LSP, enter the following Junos OS command-line
interface (CLI) operational mode command from the ingress router:
Sample Output
user@R1> traceroute 100.100.6.1
traceroute to 100.100.6.1 (100.100.6.1), 30 hops max, 40 byte packets
1 10.1.13.2 (10.1.13.2) 0.653 ms 0.590 ms 0.543 ms
2 10.1.36.2 (10.1.36.2) 0.553 ms !N 0.552 ms !N 0.537 ms !N
Meaning The sample output shows that BGP traffic is not using the LSP, consequently MPLS
labels do not appear in the output. Instead of using the LSP, BGP traffic is using the
interior gateway protocol (IGP) to reach the BGP next-hop LSP egress address for R6
and R1. The Junos OS default is to use LSPs for BGP traffic when the BGP next hop equals
the LSP egress address.
Action To verify that BGP traffic is using the LSP, enter the following Junos OS CLI operational
mode command from the ingress router:
Sample Output
user@R1> traceroute 100.100.6.1
traceroute to 100.100.6.1 (100.100.6.1), 30 hops max, 40 byte packets
1 10.1.13.2 (10.1.13.2) 0.858 ms 0.740 ms 0.714 ms
MPLS Label=100016 CoS=0 TTL=1 S=1
2 10.1.36.2 (10.1.36.2) 0.592 ms !N 0.564 ms !N 0.548 ms !N
Meaning The sample output shows that MPLS labels are used to forward packets through the
LSP. Included in the output is a label value (MPLS Label=100016), the time-to-live value
(TTL=1), and the stack bit value (S=1).
The MPLS Label field is used to identify the packet to a particular LSP. It is a 20-bit field,
with a maximum value of (2^^20-1), approximately 1,000,000.
The time-to-live (TTL) value contains a limit on the number of hops that this MPLS
packet can travel through the network (1). It is decremented at each hop, and if the TTL
value drops below one, the packet is discarded.
The bottom of the stack bit value (S=1) indicates that is the last label in the stack and
that this MPLS packet has one label associated with it. The MPLS implementation in the
Junos OS supports a stacking depth of 3 on the M-series routers and up to 5 on the
T-series routing platforms. For more information on MPLS label stacking, see RFC 3032,
MPLS Label Stack Encoding.
MPLS labels appear in the sample output because the traceroute command is issued to
a BGP destination where the BGP next hop for that route is the LSP egress address. The
Junos OS by default uses LSPs for BGP traffic when the BGP next hop equals the LSP
egress address.
If the BGP next hop does not equal the LSP egress address, the BGP traffic does not use
the LSP, and consequently MPLS labels do not appear in the output for the traceroute
command, as indicated in the sample output in “Check BGP Sessions” on page 975.
Action To examine a route to determine if EBGP is selected over IBGP as the selection criteria
for the single, active path, enter the following Junos OS CLI operational mode command:
Sample Output
user@R4> show route 100.100.3.0 detail
inet.0: 20 destinations, 24 routes (20 active, 0 holddown, 0 hidden)
100.100.3.0/24 (2 entries, 1 announced)
*BGP Preference: 170/-101
Source: 10.1.45.2
Next hop: 10.1.45.2 via so-0/0/2.0, selected
State: <Active Ext>
Local AS: 65002 Peer AS: 65001
Age: 5d 0:31:25
Task: BGP_65001.10.1.45.2+179
Announcement bits (3): 0-KRT 3-BGP.0.0.0.0+179 4-Resolve inet.0
AS path: 65001 I
Localpref: 100
Router ID: 10.0.0.5
BGP Preference: 170/-101
Source: 10.0.0.2
Next hop: 10.1.24.1 via so-0/0/3.0, selected
Protocol next hop: 10.0.0.2 Indirect next hop: 8644000 277
State: <NotBest Int Ext>
Inactive reason: Interior > Exterior > Exterior via Interior
Local AS: 65002 Peer AS: 65002
Age: 2:48:18 Metric2: 10
Task: BGP_65002.10.0.0.2+179
AS path: 65001 I
Localpref: 100
Router ID: 10.0.0.2
Meaning The sample output shows that R4 received two instances of the 100.100.3.0 route: one
from 10.1.45.2 (R5) and one from 10.0.0.2 (R2). R4 selected the path from R5 as its active
path, as indicated by the asterisk (*). The selection is based on a preference for routes
learned from an EBGP peer over routes learned from an IBGP. R5 is an EBGP peer.
You can determine if a path is received from an EBGP or IBGP peer by examining the
Local As and Peer As fields. For example, the route from R5 shows the local AS is 65002
and the peer AS is 65001, indicating that the route is received from an EBGP peer. The
route from R2 shows that both the local and peer AS is 65002, indicating that it is received
from an IBGP peer.
The reason that the inactive path is not selected is displayed in the Inactive reason field,
in this case, Interior > Exterior > Exterior via Interior. The wording of this reason shows the
order of preferences applied when the same route is received from two routers. The route
received from a strictly internal source (IGP) is preferred first, the route received from an
external source (EBGP) is preferred next, and any route which comes from an external
source and is received internally (IBGP) is preferred last.
Action To verify the BGP configuration of an internal router, enter the following Junos OS
command-line interface (CLI) command:
The following sample output is for a BGP configuration on R3, as shown in “Verify the
BGP Protocol” on page 990:
Sample Output
user@R3> show configuration
[...Output truncated...]
interfaces {
so-0/0/1 {
unit 0 {
family inet {
address 10.1.23.2/30;
}
family iso;
}
}
so-0/0/3 {
unit 0 {
family inet {
address 10.1.36.1/30;
}
family iso;
}
}
lo0 {
unit 0 {
family inet {
address 10.0.0.3/32;
}
family iso {
address 49.0002.1000.0000.0003.00;
}
}
}
}
routing-options {
[...Output truncated...]
router-id 10.0.0.3;
autonomous-system 65002;
}
protocols {
bgp {
group internal {
type internal;
local-address 10.0.0.3;
neighbor 10.0.0.2;
neighbor 10.0.0.4;
neighbor 10.0.0.6;
}
}
isis {
level 1 disable;
interface all {
level 2 metric 10;
}
interface lo0.0;
}
}
unit 0 {
family inet {
address 10.1.46.2/30;
}
family iso;
}
}
so-0/0/3 {
unit 0 {
family inet {
address 10.1.36.2/30;
}
family iso;
}
}
lo0 {
unit 0 {
family inet {
address 10.0.0.6/32;
}
family iso {
address 49.0003.1000.0000.0006.00;
}
}
}
}
routing-options {
[Output truncated...]
router-id 10.0.0.6;
autonomous-system 65002;
}
protocols {
bgp {
group internal {
type internal;
local-address 10.0.0.6;
neighbor 10.0.0.2;
neighbor 10.0.0.3;
neighbor 10.0.0.4;
}
}
isis {
level 1 disable;
interface all {
level 2 metric 10;
}
interface lo0.0;
}
}
Meaning The sample output shows a basic BGP configuration on routers R3 and R6. The local AS
(65002) and one group (internal) are configured on both routers. R3 has three internal
peers—10.0.0.2, 10.0.0.4, and 10.0.0.6—included at the [protocols bgp group group]
hierarchy level. R6 also has three internal peers: 10.0.0.2, 10.0.0.3, and 10.0.0.4. The
underlying IGP protocol is Intermediate System-to-Intermediate System (IS-IS), and
relevant interfaces are configured to run IS-IS.
Note that in this configuration the router ID is manually configured to avoid any duplicate
router ID problems.
Action To verify the BGP configuration of a border router, enter the following Junos OS CLI
operational mode command:
Sample Output
The following sample output is for a BGP configuration on two border routers from AS
65002 (R2 and R4 as shown in “Verify the BGP Protocol” on page 990):
import import-toR1;
peer-as 65001;
neighbor 10.1.12.1;
}
}
isis {
level 1 disable;
interface all {
level 2 metric 10;
}
interface lo0.0;
}
}
policy-options {
policy-statement next-hop-self {
term change-next-hop {
from neighbor 10.1.12.1;
then {
next-hop self;
}
}
}
policy-statement import-toR1 {
term 1 {
from {
route-filter 100.100.1.0/24 exact;
}
then {
local-preference 200;
}
}
}
unit 0 {
family inet {
address 10.0.0.4/32;
}
family iso {
address 49.0001.1000.0000.0004.00;
}
}
}
}
routing-options {
[...Output truncated...]
router-id 10.0.0.4;
autonomous-system 65002;
}
protocols {
bgp {
group internal {
type internal;
local-address 10.0.0.4;
export next-hop-self;
neighbor 10.0.0.2;
neighbor 10.0.0.3;
neighbor 10.0.0.6;
}
group toR5 {
type external;
peer-as 65001;
neighbor 10.1.45.2;
}
}
isis {
level 1 disable;
interface all {
level 2 metric 10;
}
interface lo0.0;
}
}
policy-options {
policy-statement next-hop-self {
term change-next-hop {
from neighbor 10.1.45.2;
then {
next-hop self;
}
}
}
Meaning The sample output shows a basic BGP configuration on border routers R2 and R4. Both
routers have the AS (65002) included at the [routing-options] hierarchy level. Each router
has two groups included at the [protocols bgp group group] hierarchy level. External peers
are included in the external group, either toR1 or toR5, depending on the router. Internal
peers are included in the internal group. The underlying IGP protocol is IS-IS on both
routers, and relevant interfaces are configured to run IS-IS.
Note that in the configuration on both routers, the router ID is manually configured to
avoid duplicate router ID problems, and the next-hop-self statement is included to avoid
any BGP next-hop reachability problems.
Junos OS is based on the FreeBSD Unix operating system. The open source software is
modified and hardened to operate in the device’s specialized environment. For example,
some executables have been deleted, while other utilities were de-emphasized.
Additionally, certain software processes were added to enhance the routing functionality.
The result of this transformation is the kernel, the heart of the Junos OS software.
The kernel is responsible for operating multiple processes that perform the actual
functions of the device. Each process operates in its own protected memory space, while
the communication among all the processes is still controlled by the kernel. This
separation provides isolation between the processes, and resiliency in the event of a
process failure. This is important in a core routing platform because a single process
failure does not cause the entire device to cease functioning.
Some of the common software processes include the routing protocol process (rpd)
that controls the device’s protocols, the device control process (dcd) that controls the
device’s interfaces, the management process (mgd) that controls user access to the
device, the chassis process (chassisd) that controls the device’s properties itself, and
the Packet Forwarding Engine process (pfed) that controls the communication between
the device’s Packet Forwarding Engine and the Routing Engine. The kernel also generates
specialized processes as needed for additional functionality, such as SNMP, the Virtual
Router Redundancy Protocol (VRRP), and Class of Service (CoS).
The routing protocol process is a software process within the Routing Engine software,
which controls the routing protocols that run on the device. Its functionality includes all
protocol messages, routing table updates, and implementation of routing policies.
The routing protocol process starts all configured routing protocols and handles all
routing messages. It maintains one or more routing tables, which consolidate the routing
information learned from all routing protocols. From this routing information, the routing
protocol process determines the active routes to network destinations and installs these
routes into the Routing Engine’s forwarding table. Finally, it implements routing policy,
which allows you to control the routing information that is transferred between the routing
protocols and the routing table. Using routing policy, you can filter and limit the transfer
of information as well as set properties associated with specific routes.
The following sections present the most frequently asked questions and answers related
to the routing protocol process memory utilization, operation, interpretation of related
command outputs, and troubleshooting the software process.
The routing protocol process uses hundreds of megabytes of RAM in the Routing Engine
to store information needed for the operation of routing and related protocols, such as
BGP, OSPF, IS-IS, RSVP, LDP and MPLS. Such huge consumption of memory is common
for the process, as the information it stores includes routes, next hops, interfaces, routing
policies, labels, and label-switched paths (LSPs). Because access to the RAM memory
is much faster than access to the hard disk, most of the routing protocol process
information is stored in the RAM memory instead of using the hard disk space. This ensures
that the performance of the routing protocol process is maximized.
How can I check the amount of memory the routing protocol process is using?
You can check routing protocol process memory usage by entering the show system
processes and the show task memory Junos OS command-line interface (CLI) operational
mode commands.
The show system processes command displays information about software processes
that are running on the device and that have controlling terminals. The show task memory
command displays memory utilization for routing protocol tasks on the Routing Engine.
You can check the routing protocol process memory usage by using the show system
processes command with the extensive option. The show task memory command displays
a report generated by the routing protocol process on its own memory usage. However,
this report does not display all the memory used by the process. The value reported by
the routing protocol process does not account for the memory used for the TEXT and
STACK segments, or the memory used by the process’s internal memory manager. Further,
the Resident Set Size value includes shared library pages used by the routing protocol
process.
For more information about checking the routing protocol process memory usage.
For more information, see the show system processes command and the show task
memory command.
I just deleted a large number of routes from the routing protocol process. Why is it still
using so much memory?
The show system processes extensive command displays a RES value measured in
kilobytes. This value represents the amount of program memory resident in the physical
memory. This is also known as RSS or Resident Set Size. The RES value includes shared
library pages used by the process. Any amount of memory freed by the process might
still be considered part of the RES value. Generally, the kernel delays the migrating of
memory out of the Inact queue into the Cache or Free list unless there is a memory
shortage. This can lead to large discrepancies between the values reported by the routing
protocol process and the kernel, even after the routing protocol process has freed a large
amount of memory.
How do I interpret memory numbers displayed in the show system processes extensive
command output?
The show system processes extensive command displays exhaustive system process
information about software processes that are running on the device and have controlling
terminals. This command is equivalent to the UNIX top command. However, the UNIX
top command shows real-time memory usage, with the memory values constantly
changing, while the show system processes extensive command provides a snapshot of
memory usage in a given moment.
To check overall CPU and memory usage, enter the show system processes extensive
command. Refer to Table 42 on page 1026 for information about the show system processes
extensive commands output fields.
Mem: 25M Active, 3968K Inact, 19M Wired, 184K Cache, 8346K Buf, 202M Free
Swap: 528M Total, 64K Used, 528M Free
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
544 root 30 0 604K 768K RUN 0:00 0.00% 0.00% top
3 root 28 0 0K 12K psleep 0:00 0.00% 0.00% vmdaemon
4 root 28 0 0K 12K update 0:03 0.00% 0.00% update
528 aviva 18 0 660K 948K pause 0:00 0.00% 0.00% tcsh
204 root 18 0 300K 544K pause 0:00 0.00% 0.00% csh
131 root 18 0 332K 532K pause 0:00 0.00% 0.00% cron
186 root 18 0 196K 68K pause 0:00 0.00% 0.00% watchdog
27 root 10 0 512M 16288K mfsidl 0:00 0.00% 0.00% mount_mfs
1 root 10 0 620K 344K wait 0:00 0.00% 0.00% init
304 root 3 0 884K 900K ttyin 0:00 0.00% 0.00% bash
200 root 3 0 180K 540K ttyin 0:00 0.00% 0.00% getty
203 root 3 0 180K 540K ttyin 0:00 0.00% 0.00% getty
202 root 3 0 180K 540K ttyin 0:00 0.00% 0.00% getty
201 root 3 0 180K 540K ttyin 0:00 0.00% 0.00% getty
194 root 2 0 2248K 1640K select 0:11 0.00% 0.00% rpd
205 root 2 0 964K 800K select 0:12 0.00% 0.00% tnp.chassisd
189 root 2 -12 352K 740K select 0:03 0.00% 0.00% xntpd
114 root 2 0 296K 612K select 0:00 0.00% 0.00% amd
188 root 2 0 780K 600K select 0:00 0.00% 0.00% dcd
527 root 2 0 176K 580K select 0:00 0.00% 0.00% rlogind
195 root 2 0 212K 552K select 0:00 0.00% 0.00% inetd
187 root 2 0 192K 532K select 0:00 0.00% 0.00% tnetd
83 root 2 0 188K 520K select 0:00 0.00% 0.00% syslogd
538 root 2 0 1324K 516K select 0:00 0.00% 0.00% mgd
99 daemon 2 0 176K 492K select 0:00 0.00% 0.00% portmap
163 root 2 0 572K 420K select 0:00 0.00% 0.00% nsrexecd
192 root 2 0 560K 400K select 0:10 0.00% 0.00% snmpd
191 root 2 0 1284K 376K select 0:00 0.00% 0.00% mgd
537 aviva 2 0 636K 364K select 0:00 0.00% 0.00% cli
193 root 2 0 312K 204K select 0:07 0.00% 0.00% mib2d
5 root 2 0 0K 12K pfesel 0:00 0.00% 0.00% if_pfe
2 root -18 0 0K 12K psleep 0:00 0.00% 0.00% pagedaemon
0 root -18 0 0K 0K sched 0:00 0.00% 0.00% swapper
Table 42 on page 1026 describes the output fields that represent the memory values for
the show system processes extensive command. Output fields are listed in the approximate
order in which they appear.
Inact Memory allocated but not recently used or memory freed by the programs. Inactive memory remains
mapped in the address space of one or more processes and, therefore, counts toward the RSS value
of those processes.
Wired Memory that is not eligible to be swapped, usually used for in-kernel memory structures and/or memory
physically locked by a process.
Cache Memory that is not associated with any program and does not need to be swapped before being reused.
Buf Size of memory buffer used to hold data recently called from the disk.
Free Memory that is not associated with any programs. Memory freed by a process can become Inactive,
Cache, or Free, depending on the method used by the process to free the memory.
The rest of the command output displays information about the memory usage of each
process. The SIZE field indicates the size of the virtual address space, and the RES field
indicates the amount of the program in physical memory, which is also known as RSS or
Resident Set Size. For more information, see the show system processes command.
What is the difference between Active and Inact memory that is displayed by the show
system processes extensive command?
When the system is under memory pressure, the pageout process reuses memory from
the free, cache, inact and, if necessary, active pages. When the pageout process runs, it
scans memory to see which pages are good candidates to be unmapped and freed up.
Thus, the distinction between Active and Inact memory is only used by the pageout
process to determine which pool of pages to free first at the time of a memory shortage.
The pageout process first scans the Inact list, and checks whether the pages on this list
have been accessed since the time they have been listed here. The pages that have been
accessed are moved from the Inact list to the Active list. On the other hand, pages that
have not been accessed become prime candidates to be freed by the pageout process.
If the pageout process cannot produce enough free pages from the Inact list, pages from
the Active list get freed up.
Because the pageout process runs only when the system is under memory pressure, the
pages on the Inact list remain untouched – even if they have not been accessed recently
– when the amount of Free memory is adequate.
How do I interpret memory numbers displayed in the show task memory command
output?
The show task memory command provides a comprehensive picture of the memory
utilization for routing protocol tasks on the Routing Engine. The routing protocol process
is the main task that uses Routing Engine memory.
To check routing process memory usage, enter the show task memory command. Refer
to Table 43 on page 1027 for information about the show task memory command output
fields.
Table 43 on page 1027 describes the output fields for the show task memory command.
Output fields are listed in the approximate order in which they appear.
Memory Currently In Use Memory currently in use. Dynamically allocated memory plus the DATA
segment memory in kilobytes.
The show task memory command does not display all the memory used by the routing
protocol process. This value does not account for the memory used for the TEXT and
STACK segments, or the memory used by the routing protocol process’s internal memory
manager.
Why is the Currently In Use value less than the RES value?
The show task memory command displays a Currently In Use value measured in kilobytes.
This value represents the memory currently in use. It is the dynamically allocated memory
plus the DATA segment memory. The show system processes extensive command displays
a RES value measured in kilobytes. This value represents the amount of program memory
resident in the physical memory. This is also known as RSS or Resident Set Size.
The Currently In Use value does not account for all of the memory that the routing protocol
process uses. This value does not include the memory used for the TEXT and the STACK
segments, and a small percentage of memory used by the routing protocol process’s
internal memory manager. Further, the RES value includes shared library pages used by
the routing protocol process.
Any amount of memory freed by the routing protocol process might still be considered
part of the RES value. Generally, the kernel delays the migrating of memory out of the
Inact queue into the Cache or Free list unless there is a memory shortage. This can lead
to large discrepancies between the Currently In Use value and the RES value.
When the system is under memory pressure, the pageout process reuses memory from
the free, cache, inact and, if necessary, active pages. You can monitor the swap activity
by viewing the syslog message reported by the kernel during periods of high pageout
activity.
You can use the vmstat -s command to print the statistics for the swapout activity. The
displayed statistics appear as follows:
0 swap pager pageouts
0 swap pager pages paged out
The swap pager pageouts is the number of pageout operations to the swap device, and
the swap pager pages paged out is the number of pages paged out to the swap device.
Why does the system start swapping when I try to dump core using the request system
core-dumps command?
The request system core-dumps command displays a list of system core files created
when the device has failed. This command can be useful for diagnostic purposes. Each
list item includes the file permissions, number of links, owner, group, size, modification
date, path, and filename. You can use the core-filename option and the core-file-info,
brief, and detail options to display more information about the specified core-dump files.
You can use the request system core-dumps command to perform a non-fatal core-dump
without aborting the routing protocol process. To do this, the routing protocol process
is forked, generating a second copy, and then aborted. This process can double the
memory consumed by the two copies of the routing protocol processes, pushing the
system into swap.
Why does the show system processes extensive command show that memory is swapped
to disk although there is plenty of free memory?
Memory can remain swapped out indefinitely if it is not accessed again. Therefore, the
show system processes extensive command shows that memory is swapped to disk even
though there is plenty of free memory, and such a situation is not unusual.
The RPD_OS_MEMHIGH message is written into the system message file if the routing
protocol process is running out of memory. This message alerts you that the routing
protocol process is using the indicated amount and percentage of Routing Engine memory,
which is considered excessive. This message is generated either because the routing
protocol process is leaking memory or the use of system resources is excessive, perhaps
because routing filters are misconfigured or the configured network topology is very
complex.
When the memory utilization for the routing protocol process is using all available Routing
Engine DRAM memory (Routing Engines with maximum 2 GB DRAM) or reaches the limit
of 2 GB of memory (Routing Engines with 4 GB DRAM), a message of the following form
is written every minute in the syslog message file:
This message includes the amount, in kilobytes and/or the percentage, of the available
memory in use.
This message should not appear under normal conditions, as any further memory
allocations usually require a portion of existing memory to be written to swap. As a
recommended solution, increase the amount of RAM in the Routing Engine. For more
information, go to http://kb.juniper.net/InfoCenter/index?page=content&id=KB14186 .
It is not recommended for the system to operate in this state, notwithstanding the
existence of swap. The protocols that run in the routing protocol process usually have a
real-time requirement that cannot reliably withstand the latency of being swapped to
hard disk. If the memory shortage has not resulted from a memory leak, then either a
How do I determine whether there is a memory leak in the routing protocol process?
Memory leaks are typically the result of a seemingly unbounded growth in the memory
usage of a process as reported by the show system processes extensive command.
There are two classes of memory leaks that the routing protocol process can experience.
• The first class occurs when the allocated memory that is no longer in use is not freed.
This class of leak can usually be fixed by taking several samples of the show task
memory detail command over a period of time and comparing the deltas.
• The second class occurs when there is a late access to freed memory. If the access is
not outside the mapped address space, the kernel backfills the accessed page with
real memory. This backfill is done without the knowledge of the routing protocol
process’s internal memory allocator, which makes this class of leak much more difficult
to resolve. If a memory leak of this class is suspected, writing the state of the system
to a disk file (creating a core file) is suggested.
A large discrepancy between the RES value and the Currently In Use value might indicate
a memory leak. However, large discrepancies can also occur for legitimate reasons. For
example, the memory used for the TEXT and STACK segments or the memory used by
the routing protocol process’s internal memory manager might not be displayed. Further,
the RES value includes shared library pages used by the process.
The source of a routing protocol process memory leak can usually be identified by dumping
the timers for each task. You can use the show task task-name command to display
routing protocol tasks on the Routing Engine. Tasks can be baseline tasks performed
regardless of the device’s configuration, and other tasks that depend on the device
configuration.
Index
• Index on page 1033
peering sessions See BGP peers; BGP sessions show route forwarding-table command.........1006
point-to-point internal peer session show route receive-protocol bgp
logical systems......................................................54 command..................................................................1012
route reflectors See BGP route reflectors state transitions, logging........................................1007
route-flap damping....................................................484 traceoptions statement....................998, 999, 1009
BGP confederations tracing
creating (configuration editor)...............................422 configuring..........................................................1009
description......................................................................421 flags, table...........................................................1010
route-flap damping....................................................484 update statement......................................................998
BGP groups BGP route reflectors
confederations (configuration editor).................422 cluster of clusters.......................................................400
BGP layer creating (configuration editor).......................401, 417
broken network topology, figure ...........................974 description.....................................................................399
BGP Monitoring Protocol...................................................601 multiple clusters.........................................................400
configuring......................................................................557 BGP sessions
displaying internal...............................................................................54
statistics..................................................................761 internal (configuration editor)..................................43
BGP peers point-to-point external (configuration
external (configuration editor).................................20 editor)............................................................................20
internal...............................................................................54 sample peering session................................................19
internal (configuration editor)..................................43 bgp statement......................................................................599
point-to-point connections........................................19 bgp-error-tolerance statement.....................................506
BGP protocol bgp-orf-cisco-mode
checklist for verifying...................................................971 usage guidelines...........................................................219
detail statement.........................................................999 bgp-orf-cisco-mode statement....................................600
edit protocol bgp traceoptions BGP_L2VPN_AD_NLRI........................................................594
command..................................................................998 bmp statement.....................................................................601
edit protocol command...........................................999 usage guidelines...........................................................557
establishment issues ...............................................999 Border Gateway Protocol See BGP
flag statement.............................................................999 braces, in configuration statements...............................xxii
network brackets
configuration topology, figure ........................991 angle, in syntax descriptions....................................xxii
topology, figure .....................................989, 1000 square, in configuration statements......................xxii
open statement...........................................................999
protocol statement....................................................999 C
run show log command...........................................999 checklist for
send statement...........................................................998 BGP protocol, verifying...............................................971
session Cisco non-deterministic, BGP MED option..................80
problems...................................................999, 1007 cisco-non-deterministic option......................8, 239, 689
states, table .......................................................1007 clear bgp damping command.........................................742
set flag command......................................................998 clear bgp neighbor command.........................................743
show configuration command clear bgp table command.................................................745
border router.......................................................1018 clear validation databasecommand.............................747
internal router.....................................................1015 clear validation session command................................748
show route command clear validation statistics command.............................749
EBGP over IBGP.....................................1003, 1014 CLNS..........................................................................................637
lGP cost................................................................1005 BGP..........................................................................549, 551
local preference................................................1002 CLNS (Connectionless Network Service) VPNs
MED.......................................................................1003 BGP, to carry CLNS VPN NLRI................................549
key-chain-name loose-check
BGP..................................................................................640 BGP...................................................................................655
keychain loss-priority (firewall filter action).................................532
BGP..................................................................................430
overview..........................................................................429 M
malformed BGP attributes..............................................506
L malformed-route-limittatement
labeled-unicast statement...............................................642 for BGP............................................................................506
layered model malformed-update-log-interval statement
BGP layer, figure ..........................................................973 for BGP............................................................................506
LDP manuals
authentication algorithm..........................................591 comments on................................................................xxiii
LDP-based Layer 2 VPN and VPLS update match conditions
messages firewall filters
BGP...................................................................................594 overview.................................................................530
load balance max-sessions statement
asymmetric..........................................................320, 363 Origin AS Validation...................................................656
unequal.................................................................320, 363 maximum-length statement
load balancing Origin AS Validation....................................................657
advertising multiple paths to a MBGP MVPNs.......................................................................494
destination.........................................................371, 372 MD5 authentication............................................................430
per-prefix........................................................................258 BGP..................................................................................430
load-balance statement MED See BGP
usage guidelines......................................320, 346, 363 MED (multiple exit discriminator)
local AS always compare option..............................................80
BGP......................................................................116, 121, 131 Cisco non-deterministic option...............................80
local-address statement plus IGP option...............................................................80
BGP..................................................................................644 med-igp-update-interval statement
Origin AS Validation...................................................646 usage guidelines...........................................................106
usage guidelines.............................................................43 med-plus-igp statement..................................................689
local-as statement..............................................................647 usage guidelines.....................................................8, 239
usage guidelines.....................................................121, 131 members statement
local-interface statement usage guidelines..........................................................422
BGP..................................................................................649 metric statement
usage guidelines.............................................................27 BGP
local-preference statement............................................650 usage guidelines....................................................93
usage guidelines............................................................66 metric-out statement
log (firewall filter action)...................................................532 BGP..................................................................................658
log-updown statement.......................................................651 usage guidelines.....................................................81
BGP minimum-interval...............................................................660
usage guidelines..................................................477 BFD, transmit-interval...............................................662
logical systems usage guidelines..........................................................330
EBGP minimum-interval statement
with IPv6 interfaces..............................................27 BGP...................................................................................595
internal BGP.....................................................................54 minimum-receive-interval
viewing system files on..............................................561 BFD...................................................................................664
logical-systems statement..............................................652
loops statement
BGP address family....................................................653
verification
BGP session flap prevention..........................483, 512
BMP..................................................................................559
IS-IS policy......................................................................199
network interfaces.............................................169, 392
tracing.............................................................................566
version
BFD....................................................................................736
version statement
BFD (BGP)
usage guidelines.................................................330
BGP...................................................................................595
vpn-apply-export statement............................................737
VPNs
BGP
preventing session flaps...................................477
VRF export policy..................................................................737