The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter describes the Cisco NX-OS Border Gateway Protocol (BGP) commands that begin with R.
To inject routes from one routing domain into the Border Gateway Protocol (BGP), use the redistribute command. To remove the redistribute command from the configuration file and restore the system to its default condition in which the software does not redistribute routes, use the no form of this command.
redistribute { direct | eigrp instance-tag | ospf instance-tag | rip instance-tag | static } [ route-map map-name ]
no redistribute {{ direct | eigrp instance-tag | ospf instance-tag | rip instance-tag | static } [ route-map map-name ]
Address family configuration mode
|
|
Use the redistribute command to import routes from other routing protocols into BGP. You should always use a route map to filter these routes to ensure that BGP redistributes only the routes that you intend to redistribute.
You must configure a default metric to redistribute routes from another protocol into BGP. You can configure the default metric with the default-metric command or with the route map configured with the redistribute command.
This example shows how to redistribute BGP routes into an EIGRP autonomous system:
|
|
---|---|
To specify the autonomous system (AS) number for a neighbor, use the remote-as command. To remove an AS number, use the no form of this command.
AS number. The format is x for a two-byte value or x.x for a four-byte value. The range is from 1 to 65535. |
|
|
This example shows how to configure the neighbor AS number:
|
|
To restart a Border Gateway Protocol (BGP) autonomous system and remove all associated neighbors, use the restart command.
restart bgp as-num [ . as-num ]
|
|
This example shows how to restart the BGP autonomous system:
|
|
---|---|
To create a route map, enter the route-map configuration mode, or define the conditions for redistributing routes from one routing protocol into another, use the route-map command. To delete an entry, use the no form of this command.
route-map map-tag [ deny | permit ] [ sequence-number ]
no route-map map-tag [ permit | deny ] [ sequence-number ]
|
|
If you make changes to a route map that is used by a client, you must exit the route-map configuration submode before the changes take effect in the client. The route-map changes are not propagated to its clients until you exit from the route-map configuration submode or 60 seconds expire since entering the submode.
Once you enter the route-map configuration mode, the following keywords are available:
– as-path name [ name ] —Specifies the autonomous system (AS) path access list to match. The name can be any alphanumeric string up to 63 characters. See the match as-path command for additional information.
– community name [ name | exact-match ]— Specifies the BGP community list name to match. See the match community command for additional information.
– ip —Configures the IPv4 features. The follow keywords and arguments are available:
address { access-list-name [ access-list-name ] | prefix-list ipv4-list-name [ ipv4-list-name ]}— Specifies the address of the route or packet to match. See the match ip address command for additional information.
multicast { group address/length | rp address/length }—Specifies the multicast attributes to match. See the match ip multicast command for additional information.
next-hop —Matches the next-hop address of the route. See the match ip next-hop command for additional information.
route-source —Matches the advertising source address of the route. See the match ip route-source command for additional information.
– as-path —Prepends a string for a BGP AS-path attribute. See the set as-path command for additional information.
– comm-list —Sets the BGP community list (for deletion). See the set comm-list command for additional information.
– community —Sets the BGP community attribute. See the set community command for additional information.
– dampening —Sets the BGP route flap dampening parameters. See the set dampening command for additional information.
– forwarding-address —Sets the forwarding address. See the set forwarding-address command for additional information.
– level —Specifies where to import the route. See the set level command for additional information.
– local-preference —Specifies the BGP local preference path attribute. See the set local-preference command for additional information.
– metric —Sets the metric for the destination routing protocol. See the set metric command for additional information.
– metric-type —Sets the type of metric for the destination routing protocol. See the set metric-type command for additional information.
– origin —Specifies the BGP origin code. See the set origin command for additional information.
– tag —Specifies the tag value for the destination routing protocol. See the set tag command for additional information.
– weight —Sets the BGP weight for the routing table. See the set weight command for additional information.
Use route maps to redistribute routes.
The redistribute router configuration command uses the map-tag name to reference the route map. Multiple route maps may share the same map tag name.
Use the route-map global configuration command and the match and set route-map configuration commands to define the conditions for redistributing routes from one routing protocol into another. Each route-map command has a list of match and set commands associated with it. The match commands specify the match criteria—the conditions under which redistribution is allowed for the current route-map command. The set commands specify the set actions—the particular redistribution actions to perform if the criteria enforced by the match commands are met. The no route-map command deletes the route map.
The match route-map configuration command has multiple formats. The match commands can be given in any order, and all match commands must pass to cause the route to be redistributed according to the set actions given with the set commands. The no forms of the match commands remove the specified match criteria.
Use route maps when you want detailed control over how routes are redistributed between routing processes. The destination routing protocol is the one you specify with the router global configuration command. The source routing protocol is the one you specify with the redistribute router configuration command. See the “Examples” section for an illustration of how route maps are configured.
When you are passing routes through a route map, a route map can have several parts. Any route that does not match at least one match clause that relates to a route-map command is ignored; that is, the route is not advertised for outbound route maps and is not accepted for inbound route maps. If you want to modify some particular data, you must configure a second route map section with an explicit match specified.
This example shows how to redistribute Routing Information Protocol (RIP) routes with a hop count equal to 1 into Open Shortest Path First (OSPF). These routes are redistributed into OSPF as external link-state advertisements (LSAs) with a metric type of Type 1, and a tag equal to 1.
switch(config
)# router ospf 109
switch(config-route-map)# redistribute
rip route-map rip-to-ospf
switch(config-route-map)# route
-map rip-to-ospf permit
switch(config
-route-map)# set metric 5
switch(config
-route-map)# set metric-type type1
switch(config
-route-map)# set tag 1
This example shows how to set the autonomous system path to match BGP autonomous system path access list 20:
switch(config
)# route-map IGP2BGP
switch(config
-route-map)# match as-path 20
This example shows how to configure that the routes matching community list 1 have the weight set to 100. Any route that has community 109 has the weight set to 100.
switch(config
)# ip community-list 1 permit 109
switch(config
)# route-map set_weight
switch(config
-route-map)# match community 1
switch(config
-route-map)# set weight 100
This example shows how to configure that the routes matching community list 1 have the weight set to 200. Any route that has community 109 alone has the weight set to 200.
switch(config
)# ip community-list 1 permit 109
switch(config
)# route-map set_weight
switch(config
-route-map)# match community 1 exact
switch(config
-route-map)# set weight 200
This example shows how to configure that the routes match community list LIST_NAME have the weight set to 100. Any route that has community 101 alone has the weight set to 100.
switch(config
)# ip community-list 1 permit 101
switch(config
)# route-map set_weight
switch(config
-route-map)# match community LIST_NAME
switch(config
-route-map)# set weight 100
To configure the router as a BGP route reflector and configure the specified neighbor as its client, use the route-reflector-client command. To indicate that the neighbor is not a client, use the no form of this command.
BGP Neighbor address-family configuration mode
|
|
---|---|
Use the route-reflector-client command to configure the local router as the route reflector and the specified neighbor as one of its clients. All the neighbors configured with this command will be members of the client group and the remaining BGP peers will be members of the nonclient group for the local route reflector.
This example shows how to configure the local router as a route reflector to the neighbor at 192.168.0.1:
|
|
---|---|
Enters the router in address family configuration mode for configuring BGP routing sessions. |
|
To assign an autonomous system (AS) number to a router and enter the router BGP configuration mode, use the router bgp command. To remove an AS number assignment, use the no form of this command.
router bgp as-num [ . as-num ]
no router bgp as-num [ . as-num ]
Address-family configuration mode
Neighbor address-family configuration mode
Router BGP configuration mode
|
|
---|---|
The as-num is the number for the local BGP speaker and allows you to create a unique identifier for the BGP process on the router.
Once you enter the router BGP configuration mode, the following parameters are available:
The confederation command is used to configure a single autonomous system number to identify a group of smaller autonomous systems as a single confederation.You can use a confederation to divide a large single autonomous system into multiple subautonomous systems and then group them into a single confederation. The subautonomous systems within the confederation exchange routing information. External peers interact with the confederation as if it were a single autonomous system.
Each subautonomous system is fully meshed within itself and has a few connections to other autonomous systems within the confederation. Next hop, Multi Exit Discriminator (MED), and local preference information is preserved throughout the confederation, allowing you to retain a single Interior Gateway Protocol (IGP) for all the autonomous systems.
The fast-external-fallover command is used to disable or enable fast external fallover for BGP peering sessions with directly connected external peers. The session is immediately reset if the link goes down. Only directly connected peering sessions are supported.
If BGP fast external fallover is disabled, the BGP routing process waits until the default hold timer expires (three keepalives) to reset the peering session.
Using the log-neighbor-changes command to enable status change message logging does not cause a substantial performance impact, unlike, for example, enabling per BGP update debugging. If the UNIX syslog facility is enabled, messages are sent to the UNIX host that is running the syslog daemon so that the messages can be stored and archived. If the UNIX syslog facility is not enabled, the status change messages are retained in the internal buffer of the router and are not stored to the disk. You can set the size of this buffer, which is dependent upon the available RAM, using the logging buffered command.
The neighbor status change messages are not tracked if the bgp log-neighbor-changes command is not enabled, except for the reset reason, which is always available as output of the show ip bgp neighbors command.
The eigrp log-neighbor-changes command enables logging of Enhanced Interior Gateway Routing Protocol (EIGRP) neighbor adjacencies, but messages for BGP neighbors are logged only if they are specifically enabled with the bgp log-neighbor-changes command.
Use the show logging command to display the log for the BGP neighbor changes.
– bestpath-limit interval —Configures the timeout for the first best path after a restart, in seconds. Range: 1 to 3600. Default: 300.
– bgp interval —Configures the different BGP keepalive and holdtimes in seconds. Range: 0 to 3600. Default: 60.
– prefix-peer-timeout interval —Configures how long a prefix peer is maintained in seconds. Range: 0 to 1200. Default: 300:
– vrf-name —Specifies the VRF name.
This example shows how to configure a BGP process for autonomous system 120:
This example shows how to log neighbor changes for BGP in router configuration mode:
This example shows how to disable the BGP fast external fallover feature. If the link through which this session is carried flaps, the connection is not reset.
This example shows how all incoming updates from eBGP peers are examined to ensure that the first autonomous system number in the AS_PATH is the local AS number of the transmitting peer. The updates from the 10.100.0.1 peer are discarded if the first AS number is not 65001.
|
|
---|---|