BGP local-as + option no-prepend + option replace

Hello

Just a quick note today. Have a look at this:

router bgp 200

neighbor 1.1.1.1 local-as 100

This is useful when transiting from an old AS to a new AS. We have the new AS 200 but we want our neighbor to still peer with us using AS 100.

Any updates received from 1.1.1.1 will have 100 and 200 prepended.

Case A:

Not all BGP internal peers in our AS have migrated to the new AS.

If we don’t want 100 prepended (maybe our internal peers have the old AS 100 still configured, in which case they would reject this update), we can use:

neighbor 1.1.1.1 local-as 100 no-prepend

So now our other neighbors will see only 200 and will accept this update.

 

Case B

We don’t want any external peers to know we are moving to the new AS

Here we would use an extra command:

neighbor 1.1.1.1 local-as 100 no-prepend replace-as

Now our other neighbors will see only the old AS when they receive updates from us.

 

Here’s what it would look like with the command local-as. R7 sees both AS (old and new) in the path when it receives updates from R1

R7#show ip bgp
BGP table version is 51, local router ID is 150.1.7.7
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i – IGP, e – EGP, ? – incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
* 28.119.16.0/24 155.1.67.6 0 100 146 200 54 i
* 155.1.37.3 0 200 54 i
*> 155.1.79.9 0 54 i
* 28.119.17.0/24 155.1.67.6 0 100 146 200 54 i
* 155.1.37.3 0 200 54 i
*> 155.1.79.9 0 54 i
* 51.51.51.51/32 155.1.67.6 0 100 146 200 254 ?
*> 155.1.37.3 0 200 254 ?
* 112.0.0.0 155.1.67.6 0 100 146 200 54 50 60 i
* 155.1.37.3 0 200 54 50 60 i
*> 155.1.79.9 0 0 54 50 60 i
* 113.0.0.0 155.1.67.6 0 100 146 200 54 50 60 i

R7#
%BGP-5-NBR_RESET: Neighbor 155.1.67.6 reset (Peer closed the session)
%BGP-5-ADJCHANGE: neighbor 155.1.67.6 Down Peer closed the session
%BGP_SESSION-5-ADJCHANGE: neighbor 155.1.67.6 IPv4 Unicast topology base removed from session Peer closed the session
%BGP-5-ADJCHANGE: neighbor 155.1.67.6 Up

 

And here we added local-as no-prepend replace-as. R7 only sees the old AS.
R7#show ip bgp
BGP table version is 51, local router ID is 150.1.7.7
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i – IGP, e – EGP, ? – incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
* 28.119.16.0/24 155.1.67.6 0 100 200 54 i
* 155.1.37.3 0 200 54 i
*> 155.1.79.9 0 54 i
* 28.119.17.0/24 155.1.67.6 0 100 200 54 i
* 155.1.37.3 0 200 54 i
*> 155.1.79.9 0 54 i
* 51.51.51.51/32 155.1.67.6 0 100 200 254 ?
*> 155.1.37.3 0 200 254 ?
* 112.0.0.0 155.1.67.6 0 100 200 54 50 60 i
* 155.1.37.3 0 200 54 50 60 i
*> 155.1.79.9 0 0 54 50 60 i
* 113.0.0.0 155.1.67.6 0 100 200 54 50 60 i

R7#sh run | s routre
R7#sh run | s router
router eigrp 100
network 150.1.0.0
network 155.1.7.7 0.0.0.0
network 155.1.37.7 0.0.0.0
network 155.1.67.7 0.0.0.0
redistribute connected metric 1 1 1 1 1 route-map BGP_NEXT_HOP
router bgp 300
bgp log-neighbor-changes
network 155.1.67.0 mask 255.255.255.0
aggregate-address 155.1.0.0 255.255.0.0 summary-only
neighbor 155.1.37.3 remote-as 200
neighbor 155.1.67.6 remote-as 100
neighbor 155.1.79.9 remote-as 54
R7#

 

Sometimes, this may lead to unexpected results: R4 is advertising 4.4.4.0/24 to R5 using the new AS, but to all other neighbors using the old AS. R5 gets this route via two paths.

R5#show ip bgp
BGP table version is 55, local router ID is 150.1.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i – IGP, e – EGP, ? – incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
* i 4.4.4.0/24 155.1.13.1 0 100 0                          100 i
*> 155.1.45.4 0 0                                                    146 i

 

Skomentuj

Wprowadź swoje dane lub kliknij jedną z tych ikon, aby się zalogować:

Logo WordPress.com

Komentujesz korzystając z konta WordPress.com. Wyloguj /  Zmień )

Zdjęcie na Google

Komentujesz korzystając z konta Google. Wyloguj /  Zmień )

Zdjęcie z Twittera

Komentujesz korzystając z konta Twitter. Wyloguj /  Zmień )

Zdjęcie na Facebooku

Komentujesz korzystając z konta Facebook. Wyloguj /  Zmień )

Połączenie z %s