Unit 1: Network Infrastructure
This will allow you to demonstrate your networking skills, knowledge, and abilities, with a focus on enterprise-level switching, routing, and multicast components that support cross-platform (inter)operability and integration with the most recent software-defined technologies.

BGP AS Path Prepending

The manipulation of the BGP AS-path attribute that goes beyond the insertion of the local AS number on outbound EBGP updates is referred to as AS-path prepending of packets. Extra AS-numbers are added to the beginning of the AS-path, immediately following the local AS-number. This is referred to as “prepending.”

AS-path prepending on EBGP sessions is supported by Cisco IOS for both inbound and outbound traffic. The prepending of AS-paths does not function properly on IBGP sessions.

It is possible to use outbound AS-path prepending as a mechanism of last resort in order to influence global BGP routing policies in BGP multi-homing scenarios. This is the case when all other methods, such as Multi-exit Discriminator or Local preference manipulation through BGP communities, are ineffective. This could be because of a lack of support from upstream Internet service providers (ISPs) or because of a wide difference in the connectivity of upstream ISPs to the internet core.

When using AS-path prepending to impact the BGP routing policies, it is recommended that only a few copies of the local AS-number be prepended to the AS-path. It is recommended that you make use of other procedures in the event that your problem cannot be resolved by prepending less than ten copies of the local AS-number.

Be cautious not to append lengthy AS-path segments, change inbound updates by appending an inbound AS-path, or append non-local AS numbers outside of a lab environment. On the Internet, you should never append lengthy AS-path segments.

Let’s use following test network:-

The Configuration

Within a route-map, the set as-path prepend statement is used to specify the BGP AS-path prepending feature. It is therefore possible to apply the route-map to updates that are received or delivered to an EBGP peer, whether they are inbound or outbound.

When the route-map is utilized in a network statement or when performing an IBGP session, the AS-path prepending function does not function properly. In either scenario, the set as-path prepend route map command is ignored without an error message.

Outbound AS-Path Prepending

You may, for instance, use the following configuration on E1 in order to append two more copies of the local AS-number to the outbound BGP updates that are transmitted from E1 to R1:

Outbound AS-path prepending on E1

router bgp 65001

 bgp log-neighbor-changes

 network 192.168.0.1 mask 255.255.255.255

 neighbor 20.0.0.2 remote-as 64801

 neighbor 20.0.0.2 description BGP sesssion to R1

 neighbor 20.0.0.2 next-hop-self

 neighbor 20.0.0.2 route-map prepend out

!

route-map prepend permit 10

 set as-path prepend 65001 65001

It is used to prefix the AS path of EBGP changes when they are sent or received. The outbound BGP updates are not made when the route-map configuration or the BGP routing protocol configuration changes, but they might be made when the next BGP scanner run happens (the usual time is 60 seconds). Once a route-map has been changed, to make the BGP routing scheme change,use the clear ip bgp neighbor soft out command.

After a change in an outbound route-map, older Cisco IOS releases never communicated BGP updates to BGP neighbors. This was the case even more frequently. Following the modification of a route map, the IOS release 15.6(1)T consistently generated an outbound update during the subsequent BGP generic scan.

R1’s BGP table shows the changed AS-path sent by E1 after it has gotten the changed BGP updates. Since prefixes sent over the E1-R1 link have longer AS-paths, R1 prefers IBGP paths sent from R2. The link between E1 and R1 has been turned into a backup link.

r1#show ip bgp

BGP table version is 9, local router ID is 192.168.0.2

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 192.168.0.1/32   20.0.0.3                 0    100      0 65001 i

 *                    20.0.0.1                 0             0 65001 65001 65001 i

 *>  192.168.0.2/32   0.0.0.0                  0         32768 i

 *>i 192.168.0.3/32   20.0.0.3                 0    100      0 i

Inbound AS-Path Prepending

The set as-path prepend command is available for use in a route map for coming in. To add an extra copy of the remote AS number to changes coming in from E1, for example, set up R2 in the following way:

router bgp 64801

 bgp log-neighbor-changes

 network 192.168.0.3 mask 255.255.255.255

 neighbor 20.0.0.1 remote-as 65001

 neighbor 20.0.0.1 description BGP sesssion to E1

 neighbor 20.0.0.1 next-hop-self

 neighbor 20.0.0.1 route-map prependIn in

!

route-map prependIn permit 10

 set as-path prepend last-as 1

The first AS in the AS-path, which is the neighbor’s AS, is prepended by the command set as-path prepend last-as. In order to simplify your configuration and make the route-map independent of the AS number of the neighbor, you can use this command in an inbound route-map.

No Attachment Found
No Attachment Found