3.7.b Implement and Troubleshoot IBGP and EBGP
3.7b(i) EBGP, IBGP
The main difference between internal BGP (IBGP) and external BGP (EBGP) happens in BGP peering (neighbor x.x.x.x remote-as <asn>). IBGP is run between neighbors within the same autonomous system, EBGP is needed between peers in different autonomous systems.
Key behavioral differences between IBGP and EBGP:
- Administrative distance: 20 for EBGP, 200 for IBGP.
- By default, EBGP peers have TTL=1, which means the neighbors are assumed to be directly connected.
- IBGP peers have a default TTL=255.
- The next-hop is not changed when a route is advertised to an IBGP peer.
- The next-hop is updated for each EBGP peer.
- Loop prevention in IBGP: fully meshed neighbors or route reflectors (routes learned from IBGP are not advertised to other IBGP peers, exception route reflectors). The local AS is not included in the AS_PATH attribute when advertising to IBGP peers.
- Loop prevention in EBGP: the AS_PATH attribute. When a route advertisement is sent out to an external peer, the AS number is written into the AS_PATH attribute. If a BGP speaker receives a route with its own AS in the AS_PATH, the update is silently discarded.
3.7b(ii) The 4-byte AS number
Similar to IPv4, the public AS number space is being allocated quickly. The 2-byte space provides the AS number range 0-65535, of which IANA reserves 64512-65534 for private purposes. Much like IPv6 was introduced to solve the IPv4 depletion problem, the 4-byte AS number has been created to solve the 2-byte AS number depletion problem. The 4-byte AS number format provides over four billion AS numbers. The 2-byte and the 4-byte AS numbers are interoperable. The 2-byte ASNs can be represented in the low-order bits, the high-order values set to 0.
Three ways of representing the 4-byte ASN:
- asplain is a simple decimal representation of the ASN (0-4294967295).
- asdot+ breaks the ASN in half into high-order and low-order values (16 bits each). Examples: 65535 = 0.65535, 65536 = 1.0.
- asdot is a mixture of asplain and asdot+. Anything in the 2-byte AS number range is written in asplain and anything above that is written as asdot+.
The asplain notation is the Cisco IOS default notation. However, Cisco IOS will support asdot via a configuration option.
router bgp 1.1
bgp asnotation dot
The use of the 4-byte ASN is agreed upon BGP Capabilities Advertisement during the initial session negotiation. If the neighbor does not support the new format, BGP uses a reserved 2-byte ASN 23456, called AS_TRANS. Rather than adding its own 4-byte AS number to the AS_PATH, BGP prepends the AS_TRANS. The router also adds a new attribute AS4_PATH, which carries a list of the real AS numbers (both 4-byte and 2-byte). The AS4_PATH is an optional transitive attribute.
Border Gateway Protocol - UPDATE Message
Path Attribute - AS4_PATH: 655361 2621441
Flags: 0xc0: Optional, Transitive, Complete
Type Code: AS4_PATH (17)
Length: 10
AS Path segment: 655361 2621441
Segment type: AS_SEQUENCE (2)
Segment length (number of ASN): 2
AS4: 655361
AS4: 2621441
Path Attribute - AS_PATH: 23456 23456
Flags: 0x40: Well-known, Transitive, Complete
Type Code: AS_PATH (2)
Length: 6
AS Path segment: 23456 23456
Segment type: AS_SEQUENCE (2)
Segment length (number of ASN): 2
AS2: 23456
AS2: 23456
When needed, the AGGREGATOR attribute is modified similarly. The BGP speaker replaces the 4-byte AS number with AS_TRANS and puts the real AS number in a new optional transitive attribute called AS4_AGGREGATOR.
3.7b(iii) Private AS
As briefly mentioned in the previous section, IANA has reserved 1023 AS numbers for private use (64512-65534 inclusive). Private AS numbers operate identically to private IP addresses, they cannot leak into the global routing table. A router should strip off private AS numbers before propagating NLRI to an eBGP peer. To remove the private AS number, use the neighbor x.x.x.x remove-private-as command.
Example:
R1#
router bgp 65001
neighbor 172.16.0.2 remote-as 2
R2#
router bgp 2
neighbor 172.16.0.1 remote-as 65001
neighbor 192.168.0.3 remote-as 3
neighbor 192.168.0.3 remove-private-as
R3#
router bgp 1
neighbor 192.168.0.2 remote-as 2
A few conditions that apply:
- You can only use this solution with external BGP (eBGP) peers.
- If the update has only private AS numbers in the AS_PATH, BGP removes these numbers.
- If the AS_PATH includes both private and public AS numbers, BGP doesn't remove the private AS numbers. This situation is considered a configuration error.
- If the AS_PATH contains the AS number of the eBGP neighbor, BGP does not remove the private AS number.
- If the AS_PATH contains confederations, BGP removes the private AS numbers only if they come after the confederation portion of the AS_PATH.
No comments:
Post a Comment