Latest

Part 2: 5 BGP commands rarely used

Today we are going to talk about second part of the earlier article of the BGP commands which actually very rare people know to use. 

In this article, we will talk about next 5 commands. The main purpose of these commands is to understand and learn so that we can know how to configure in the network when you enabled BGP. Check out the previous article as 
Part 1: 5 BGP commands rarely used

Fig 1.1- BGP basic Connectivity


Command No1: "distance bgp"
You may heard about this command but did you know what is the purpose of this command in actual ?

This command is used to allow the use of external, internal, and local administrative distances that could be a better route to a node, use the distance bgp router configuration command. To return to the default values, use the no form of this command

R1(Config)# router bgp 100
R1(config-router)# network 11.18.0.0
R1(config-router)# neighbor 19.10.6.6 remote-as 200
R1(config-router)# distance bgp 20 200 200

first value 20 is an external-distance, Second value 200 is an internal-distance, Third value 200 is a local-distance.

External Distance: Administrative distance for BGP external routes. External routes are routes for which the best path is learned from a neighbor external to the autonomous system. Acceptable values are from 1 to 255. The default is 20. Routes with a distance of 255 are not installed in the routing table.

Internal-distance: Administrative distance for BGP internal routes. Internal routes are those routes that are learned from another BGP entity within the same autonomous system. Acceptable values are from 1 to 255. The default is 200. Routes with a distance of 255 are not installed in the routing table.

local-distance: Administrative distance for BGP local routes. Local routes are those networks listed with a network router configuration command, often as back doors, for that router or for networks that are being redistributed from another process. Acceptable values are from 1 to 255. The default is 200. Routes with a distance of 255 are not installed in the routing table.

Command No2: "ip bgp-community new-format"
I think most of the people are unaware of this command. This command is used to display BGP communities in the format AA:NN

R1# show ip bgp community 12345:111 local-as
BGP table version is 10, local router ID is 224.0.0.10
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 2.2.2.2/32 158.43.222.2 0 0 222 ?
*> 111.0.0.0 158.43.222.2 0 0 222 ?
*> 158.43.0.0 158.43.222.2 0 0 222 ?
*> 158.43.44.44/32 158.43.222.2 0 0 222 ?

Command No3: "match as-path"
May be most of you know this command, This command is used to match a BGP autonomous system path access list, use the match as-path route-map configuration command. To remove a path list entry, use the no form of this command.

R1(Config)# route-map igp2bgp
R1(Config)# match as-path 100

Command No4: "neighbor default-originate"
This command is used to allow a BGP speaker (the local router) to send the default route 0.0.0.0 to a neighbor for use as a default route, use the neighbor default-originate router configuration command. To send no route as a default, use the no form of this command.

See the below configuration shows that the local router injects route 0.0.0.0 to the neighbor 16.90.2.3 unconditionally:

R1(Config)# router bgp 100
R1(config-router)# network 10.80.0.0
R1(config-router)# neighbor 16.90.2.3 remote-as 200
R1(config-router)# neighbor 16.90.2.3 default-originate

Command No5: "neighbor maximum-prefix"
This command is used to control how many prefixes can be received from a neighbor, use the neighbor maximum-prefix router configuration command. To disable this function, use the no form of this command.

R1(Config)# router bgp 100
R1(config-router)# network 10.80.0.0
R1(config-router)# neighbor 16.90.2.3 maximum-prefix 1000