What are the attributes in BGP

introduction

This document is intended to provide a better understanding of the Border Gateway Protocol (BGP) Multi Exit Discriminator (MED) attribute when an AS (Autonomous System) boundary is crossed by implementation in different scenarios.

The MED offers a dynamic possibility of influencing another AS in such a way that a certain route is reached if there are several entry points for this AS. BGP follows a systematic process of choosing the best path. There are other important attributes such as weight, local preference, original route and AS path that are considered before considering the MED attribute. So if any of these criteria match, the MED attribute is ignored.

Note: If all other factors are equal, the starting point is with the lowest MED preferable.

requirements

conditions

Cisco recommends that you have a basic understanding of BGP.

Components used

This document is not limited to specific software and hardware versions. The scenarios described in this document use the following hardware and software versions:

  • Scenario 1: Cisco 2600 router with Cisco IOSĀ® software, version 12.4 or higher

  • Scenario 2: Cisco 2600 router with Cisco IOS software, version 12.4 or higher

Conventions

For more information about document conventions, see Cisco Technical Tips Conventions.

User report

Scenario 1

When a BGP speaker learns a route from a peer, the MED of the route is passed to other internal BGP (iBGP) peers, but not to external BGP (eBGP) peers.

Consider the following network setup:

Here router R1 and router R2 are in the same AS, e.g. B. AS # 100, and router R3 belong to AS # 101. To simplify the convention, IP addresses are used in the / 24 block.

Routers R1 and R2 are configured as follows:

Router 1
(Config) #interface Loopback10 (Config-if) #ip address 10.10.10.10 255.255.255.255 (Config-if) #interface FastEthernet0 / 0 (Config-if) #ip address 192.1.12.1 255.255.255.0 (Config) #router bgp 100 (Config-router) #no synchronization (Config-router) #bgp router-id 10.10.10.10 (Config-router) #bgp log-neighbor-changes (Config-router) #network 10.10.10.10 mask 255.255.255.255 route- map ATTACH_MED (Config-router) #neighbor 192.1.12.2 remote-as 100 (Config-router) #no auto-summary (Config) # access-list 10 permit 10.10.10.10 (Config) # route-map ATTACH_MED permit 10 (Config ) #match ip address 10 (Config) #set metric 100
Router 2
(Config) #interface FastEthernet0 / 0 (Config-if) #ip address 192.1.12.2 255.255.255.0 (Config-if) #interface Serial1 / 0 (Config-if) #ip address 192.1.23.2 255.255.255.0 (Config-if ) #encapsulation frame-relay IETF (Config-if) #no fair-queue (Config-if) # frame-relay map ip 192.1.23.3 203 broadcast (Config-if) #no frame-relay inverse-arp (Config-if ) # frame-relay lmi-type ansi (Config) #router bgp 100 (Config-router) #no synchronization (Config-router) #bgp router-id 22.22.22.22 (Config-router) #bgp log-neighbor-changes ( Config-router) #neighbor 192.1.12.1 remote-as 100 (Config-router) #neighbor 192.1.23.3 remote-as 101 (Config-router) #neighbor 192.1.23.3 ebgp-multihop 3 (Config-router) #no auto- summary

Router R3 configuration is given here:

Router 3
(Config) #interface Serial1 / 0 (Config-if) #ip address 192.1.23.3 255.255.255.0 (Config-if) #encapsulation frame-relay IETF (Config-if) #no fair-queue (Config-if) #frame -relay map ip 192.1.23.2 302 broadcast (Config-if) #no frame-relay inverse-arp (Config-if) # frame-relay lmi-type ansi (Config) #router bgp 101 (Config-router) #no synchronization (Config-router) #bgp log-neighbor-changes (Config-router) #neighbor 192.1.23.2 remote-as 100 (Config-router) #neighbor 192.1.23.2 ebgp-multihop 3 (Config-router) #no auto-summary

In this configuration, iBGP is executed on R1 and R2. When an update with a certain metric gets into the AS, this metric is therefore used to make decisions within the AS. The command show ip bgp shows the metric value for 10.10.10.10 when activating R2. This value is set via the iBGP neighbor 192.1.12.1 and has a MED value of 100.

The output of R2 is pictured here:

eBGP is executed between R2 and R3, as these are located in a different AS. If the same update is forwarded to a third AS, e.g. B. AS # 101, this metric is reset to 0. The command show ip bgp is removed from R3 when checking out, since 10.10.10.10 exceeds the AS limit (101).

The output of R3 is shown here:

In this scenario, it is evident that the MED attribute can affect incoming traffic from neighboring autonomous systems. The MED attribute cannot influence the routing decisions of autonomous remote systems. When a BGP speaker learns a route from a peer, he can transfer the MED of the route to any iBGP peers, but not to eBGP peers. As a result, the MED is only relevant between neighboring autonomous systems.

Scenario 2

If the route fed into the BGP (either via the network or the command for redistribution) comes from an IGP (RIP or EIGRP or OSPF), the MED is derived from the IGP metric and the route is communicated to an eBGP neighbor with this MED.

The following network setup is used in this scenario:

In this network, R1 is configured to run on a RIP network. BGP is executed on routers R2 and R3, where R2 is configured with AS 100 and R3 with AS 101.

Router R1 is configured as follows:

Router R1
(Config) #interface Loopback10 (Config-if) #ip address 10.10.10.10 255.255.255.255 (Config-if) #interface FastEthernet0 / 0 (Config-if) #ip address 192.1.12.1 255.255.255.0 (Config) #router rip (Config-router) #network 10.0.0.0 (Config-router) #network 192.1.12.0 (Config-router) #no auto-summary

Routers R2 and R3 are configured for BGP, with redistribution done in R2 to inject the RIP networks into a BGP.

Router R2
(Config) #interface FastEthernet0 / 0 (Config-if) #ip address 192.1.12.2 255.255.255.0 (Config-if) #interface Serial1 / 0 (Config-if) #ip address 192.1.23.2 255.255.255.0 (Config-if ) #encapsulation frame-relay IETF (Config-if) #no fair-queue (Config-if) # frame-relay map ip 192.1.23.3 203 broadcast (Config-if) #no frame-relay inverse-arp (Config-if ) # frame-relay lmi-type ansi (Config) #router rip (Config-router) # network 192.1.12.0 (Config-router) #no auto-summary (Config-router) #router bgp 100 (Config-router) # no synchronization (Config-router) #bgp router-id 22.22.22.22 (Config-router) #bgp log-neighbor-changes (Config-router) #neighbor 192.1.23.3 remote-as 101 (Config-router) #neighbor 192.1. 23.3 ebgp-multihop 3 (Config-router) #redistribute rip metric 1 Config-router) #no auto-summary
Router R3
(Config) #interface Serial1 / 0 (Config-if) #ip address 192.1.23.3 255.255.255.0 (Config-if) #encapsulation frame-relay IETF (Config-if) #no fair-queue (Config-if) #frame -relay map ip 192.1.23.2 302 broadcast (Config-if) #no frame-relay inverse-arp (Config-if) # frame-relay lmi-type ansi (Config) #router bgp 101 (Config-router) # no synchronization (Config-router) #bgp router-id 33.33.33.33 (Config-router) #bgp log-neighbor-changes (Config-router) #neighbor 192.1.23.2 remote-as 100 (Config-router) #neighbor 192.1.23.2 ebgp -multihop 3 (Config-router) #no auto-summary

Both RIP and BGP run on R2. If you are using the command show ip bgp check, you can see it shows the prefix 10.0.0.0 network with metric 1 derived from the RIP.

The output of R2 is pictured here:

With R3 running on eBGP, however, the network is advertised taking into account the MED value derived from the IGP. In this case it's RIP. The prefix 10.0.0.0 is announced with the IGP-MED value, i.e. H. the RIP metric 1.

This can be seen in this issue:

In this scenario, the behavior of the MED for networks that use the network- Or redistribution command are passed to the BGP router, clearly recognizable where the actual MED value is replaced by the actual value of the IGP metric. Now that this attribute is a hint to external neighbors about the path preference in an AS. As mentioned earlier, there is not always consideration given to whether there are other important attributes in determining the best route. To get the same effect with a more deterministic attribute, use the Set as-path prepend command under the route overview. If you prepare the AS path for certain routes, it will continue to be displayed by other AS. For more information about using As-path prepend, see Using the Set-aspath prepend command.

Related information