Mandatory Well Known BGP Attributes
There are three mandatory well known attributes that must be present on every update. These three well known attributes are propagated to other Neighbors. The discretionary well known attributes may be present, but are not mandatory.Understand the relationship between the Attributes as well as the Autonomous Systems is foundation or understanding of BGP itself.
- Next Hop
- AS Path
- Origin
The Origin Attribute
When a Router receives or originates a route it sets the Origin attribute to one of the following. If a route is injected via the network command or summerization the route or routes are set to i for interior. If information about a subnet is injected via redistribution the Origin attribute is set to ? for exterior. The e reference has become obsolete.
- i – The route originated in an IGP
- e – The route originated in an EGP
- ? – The route was redistributed into BGP
As information or packets cross over an Autonomous System Boundary the egress Router or Boarder Router appends the AS-Path attributes with its own AS-Path.
Discretionary Well Known Attributes
The discretionary well known attributes are optional. They may or may not be included in the updates. A Router will prefer a route with a Higher Local Preference, and if this value is changed the Router will prefer the new route. Local Preference is only carried within an Autonomous System or AS. The Atomic Aggregate attribute is attached to route via route summerization.
- Local Preference – Default is 100
- Atomic Aggregate
Optional BGP Attributes
Optional attributes come in one of two flavors Transitive and Nontransitive. Transitive attributes are propagated to other Neighbors. The nontransitive attributes are discarded if not needed. The MED attribute is considered to be nontransitive. If there are multiple links between to Autonomous Systems the MED attribute can be used to influence the path selection.
- Multi Exit Discriminator or MED
- Community
One of the simplest Attributes to use to influence routing is the AS Path. Lets build a scenario with 4 Routers each with their respective links to one another. One being the primary link and the other for backup purposes. We will use AS Path attribute to influence route selections between CE1, and CE2 so that the PE1 is considered the primary link, and routes via PE2 are used for backup.
Lets put together a simple example from the above Topology to demonstrate the BGP path selection using one of the Well Known Attributes from above. In this simple example I will use the AS-Path attribute to manipulate the path selection between Routers CE1, and CE2 by simply prepending the AS numbers together to form a less desirable route.
CE1#configure terminal
CE1(config)#interface Serial0/0
CE1(config-if)#ip address 10.0.1.1 255.255.255.252
CE1(config-if)#interface Serial0/1
CE1(config-if)#ip address 10.0.2.1 255.255.255.252
CE1(config-if)#end
CE1#
PE1#configure terminal PE1(config)#interface Serial0/0 PE1(config-if)#ip address 10.0.1.2 255.255.255.252 PE1(config-if)#interface Serial0/1 PE1(config-if)#ip address 10.0.3.2 255.255.255.252 PE1(config-if)#end PE1#
PE2#configure terminal PE2(config)#interface Serial0/0 PE2(config-if)#ip address 10.0.2.2 255.255.255.252 PE2(config-if)#interface Serial0/1 PE2(config-if)#ip address 10.0.4.2 255.255.255.252 PE2(config-if)#end PE2#
CE2#configure terminal CE2(config)#interface Serial0/0 CE2(config-if)#ip address 10.0.3.1 255.255.255.252 CE2(config-if)#interface Serial0/1 CE2(config-if)#ip address 10.0.4.1 255.255.255.252 CE2(config-if)#end CE2#
I’ll create a couple of loopback interfaces that can be advertise via BGP on Routers CE1, and CE2. This way we can take a quick peak look at the BGP table to see how the these routes are being influenced by prepended AS path.
CE1#configure terminal CE1(config)#interface loopback 0 CE1(config-if)#ip address 192.168.1.1 255.255.255.0 CE1(config-if)#exit CE1(config)#exit CE1#
CE2#configure terminal CE2(config)#interface loopback 0 CE2(config-if)#ip address 192.168.2.1 255.255.255.0 CE2(config-if)#exit CE2(config)#exit CE2#
Lets create a simple Route Map called BACKUP that we can use to prepend the AS Path Attribute as it passes through AS 2000, and AS 11 making the route less desirable.
CE1#configure terminal CE1(config)#route-map BACKUP permit 10 CE1(config-route-map)#set as-path prepend 10 10 CE1(config-route-map)#exit CE1(config)#exit CE1#
Lets create the BGP configuration on Router CE1 using soft reconfiguration inbound with both neighbors PE1, and PE2. We will also add the BACKUP route map with both PE1, and PE2 neighbors to prepend the AS number as it travels through the autonomous systems.
CE1#configure terminal
CE1(config)#router bgp 10
CE1(config-router)#no synchronization
CE1(config-router)#bgp router-id 10.0.1.1
CE1(config-router)#bgp log-neighbor-changes
CE1(config-router)#network 192.168.1.0
CE1(config-router)#redistribute connected
CE1(config-router)#neighbor 10.0.1.2 remote-as 1000
CE1(config-router)#neighbor 10.0.1.2 default-originate
CE1(config-router)#neighbor 10.0.1.2 soft-reconfiguration inbound
CE1(config-router)#neighbor 10.0.2.2 remote-as 2000
CE1(config-router)#neighbor 10.0.2.2 default-originate
CE1(config-router)#neighbor 10.0.2.2 soft-reconfiguration inbound
CE1(config-router)#neighbor 10.0.2.2 route-map BACKUP out
CE1(config-router)#no auto-summary
CE1(config-router)#exit
CE1(config)exit
CE1#
Now lets take a look at the BGP table along with the Routing table on Router CE2 specifically at the 192.168.1.0 network that was advertised from Router CE1.
CE2#show ip bgp 192.168.1.0
BGP routing table entry for 192.168.1.0/24, version 8
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:1
2000 10 10 10
10.0.4.2 from 10.0.4.2 (10.0.4.2)
Origin IGP, localpref 100, valid, external
1000 10
10.0.3.2 from 10.0.3.2 (10.0.1.2)
Origin IGP, localpref 100, valid, external, best
CE2#show ip route 192.168.1.0
Routing entry for 192.168.1.0/24
Known via "bgp 11", distance 20, metric 0
Tag 1000, type external
Last update from 10.0.3.2 00:18:49 ago
Routing Descriptor Blocks:
* 10.0.3.2, from 10.0.3.2, 00:18:49 ago
Route metric is 0, traffic share count is 1
AS Hops 2
Route tag 1000
I hope you found this post on BGP Attrubutes helpful and informative. Be sure to let me know what you think by leaving suggestions, and feedback in the comments section below. You can find out more about these and other articles be checking out recent posts and archives. To learn more about me be sure to check out the About page. And as always thanks again for visiting The Packet.