BGP AS Path Prepending

AS Path is the fourth BGP attribute, AS Path is known, the attribute is mandatory. BGP prefers the shortest route to reach the destination. In other words, the route that contains the shortest route to the tracks is more than satisfactory.

You can handle this using a pre-route AS. Manually manipulating the length of the AS track is called the previous AS route. The AS route should be extended with several copies of the sender's AS number.

The AS is used to prepend the route to:


1.Ensure a correct selection of the return route.
. Distribution of cargo traffic for multi-homed clients.


The prepayment results for the AS route can be observed on the receiving router.

Let's see the composition: -

Topology:




Objective:

Configure the topology according to the scheme and assign the IP address by structure.
The composition of IBGP and EBGP.
Configure AS 650014 to make sure that all routes in AS 650014 must leave router_1 to AS 650003 (30.0.0.0).
Configure AS 650014 to ensure that traffic is from 30.0.0.0 to 10.0.0.0. The return traffic must use the same route as the routing traffic routers_1_2_3.



R1 # Displays a brief IP interface

IP interface - correct address? Protocol State Method
FastEthernet0 / 0 10.1.1.1 Yes, even manual
Serial3 / 0 1.1.1.1 Yes Arrive manually
Serial3 / 3 4.1.1.2 Yes Manual lifting
Loopback0 11.0.0.1 Yes Manual Reach


R2 # Displays a brief IP interface

IP interface - correct address? Protocol State Method
FastEthernet0 / 0 20.1.1.1 Yes, manual lifting
Serial3 / 0 1.1.1.2 Yes Arrive manually
Serial3 / 1 2.1.1.1 Yes Manual lifting
Loopback0 12.0.0.1 Yes Manual Reach


R3 # Displays a brief IP interface

IP interface - correct address? Protocol State Method
FastEthernet0 / 0 30.1.1.1 Yes, manual lifting
Serial3 / 1 2.1.1.2 Yes Manual lifting
Serial3 / 2 3.1.1.1 Yes Manual lifting
Loopback0 13.0.0.1 Yes Reach manual

R4 # Displays a brief IP interface

IP interface - correct address? Protocol State Method
FastEthernet0 / 0 40.1.1.1 Yes, manual lifting
Serial3 / 2 3.1.1.2 Yes Manual lifting
Serial3 / 3 4.1.1.1 Yes Manual lifting
Loopback0 14.0.0.1 Yes Manual Reach




R1 (config) #router bgp 650014
R1 (config-router) #neighbor 4.1.1.1 remote as 650014
R1 (config-router) # Neighbor 1.1.1.2 Remote as 650002
R1 (config-router) # Red 10.0.0.0
R1 (config-router) # Red 1.0.0.0
R1 (config-router) # Red 4.0.0.0
R1 (config-router) # Network mask 11.0.0.0 255.255.255.0
R1 (router configuration)

R2 (config) #rout bgp 650002
R2 (config-router) # Neighbor 1.1.1.1 Remote like 650014

* March 13 12: 23: 30.111:% BGP-5-ADJCHANGE: Neighbor 1.1.1.1 Top

R2 (config-router) # Neighbor 2.1.1.2 Remote as 650003
R2 (config-router) # Red 20.0.0.0
R2 (config-router) # Red 1.0.0.0
R2 (config-router) # Red 2.0.0.0
R2 (config-router) # Network Mask 12.0.0.0 255.255.255.0
R2 (router configuration) #exit

R3 (config) #router bgp 650003
R3 (config-router) # Neighbor 2.1.1.1 Remote as 650002

* March 13 12: 25: 42,495:% BGP-5-ADJCHANGE: Neighbor 2.1.1.1 Top

R3 (config-router) # Neighbor 3.1.1.2 Remote as 650014
R3 (config-router) # Red 30.0.0.0
R3 (config-router) # Network 3.0.0.0
R3 (config-router) # Red 2.0.0.0
R3 (config-router) # Network mask 13.0.0.0 255.255.255.0
R3 (router configuration) #exit

R4 (config) #luter bgp 650014
R4 (config-router) # Neighbor 3.1.1.1 Remote as 650003

* 13 Mar 12: 27: 46.807:% BGP-5-ADJCHANGE: Neighbor 3.1.1.1 Top

R4 (config-router) #neighbor 4.1.1.2 remote like 650014

* March 13 12: 28: 10.663:% BGP-5-SETTING: Neighbor 4.1.1.2

R4 (config-router) # Red 40.0.0.0
R4 (config-router) # Red 4.0.0.0
R4 (config-router) # Network 3.0.0.0
R4 (config-router) # Netmask 14.0.0.0 255.255.255.0
R4 (router configuration) #exit

R1 # See IP bgp
Router ID BGP 11.0.0.1, local AS number 650014
Fifth neighbor AS MsgRcvd MsgSent TblVer InQ OutQ State higher / lower State / PfxRcd
1.1.1.2 4 650002 14 16 21 - 0 00:08:00 7
4.1.1.1 4 650014 14 13 21 - 0 00:03:19 7

See the IPgpp summary
The BGP router ID 12.0.0.1, local AS number 650002
Fifth neighbor AS MsgRcvd MsgSent TblVer InQ OutQ State higher / lower State / PfxRcd
1.1.1.1 4 650014 17 15 14 - 0 00:09:06 9
2.1.1.2 4 650003 12 15 14 - 0 00:06:54 9

R3 # See the IP summary bgp
The BGP router ID 13.0

R1 # show ip bgp 30.1.1.1
Entry of the BGP routing table for 30.0.0.0/8, version 20
Tracks: (2 available, best # 1, default table)
Update of announced groups:
one
Update age 1
650003
3.1.1.1 of 4.1.1.1 (14.0.0.1)
Origin of IGP, metric 0, local prefix 100, fit, internal, best
rx pathid: 0, tx pathid: 0x0
Update age 1
650002
1.1.1.2 of 1.1.1.2 (12.0.0.1)
Origin of IGP, localpref 100, valid, external.
rx pathid: 0, tx pathid: 0

(By default, AS_650014, exit VIA R4 to access the prefix AS 650003 (30.0.0.0) by using shorter AS-PATH)


R1 (config) # access-list 10 Statement 30.0.0.0 0.255.255.255

R1 (config) # cisco-route route 10
R1 (config-route-map) #match ip address 10
R1 (config-route-map) #set Local preference 300
R1 (Configuration route map)

Roadmap Permit
R1 (Configuration route map)


R1 # show ip bgp 30.1.1.1
Entry of the BGP routing table for 30.0.0.0/8, version 22
Tracks: (1 available, best # 1, default table)
Update of announced groups:
two
Update 2 years
650002
1.1.1.2 of 1.1.1.2 (12.0.0.1)
Origin of IGP, localpref 300, valid, external, better.
rx pathid: 0, tx pathid: 0x0

(Now set the traffic back)

R3 # show ip bgp
The version of the BGP table is 18, and the ID of the local router is 13.0.0.1
Status codes: s deleted, d damped, h record, * fit,> better, i - internal,
Malfunction of the RIB, S Stale, m m, backup routes b, f RT-Filter,
Better external x, additional track, compressed from RIB,
Origin codes: i - IGP, e - EGP,? - incomplete
RPKI verification codes: V is valid, I is not valid, N does not exist

Weight of the Metric Next Hop route LocPrf of the network
* 1.0.0.0 3.1.1.2 0 650014 i
*> 2.1.1.1 0 - 650002 i
*> 2.0.0.0 0.0.0.0 0 32768 i
* 2.1.1.1 0 - 650002 i
* 3.0.0.0 3.1.1.2 0 0 650014 i
*> 0.0.0.0 0 32768 i
*> 4.0.0.0 3.1.1.2 0 0 650014 i
* 2.1.1.1 0 650002 650014 i
*> 10.0.0.0 3.1.1.2 0 650014 i
* 2.1.1.1 0 650002 650014 i
*> 11.0.0.0/24 3.1.1.2 0 650014 i
* 2.1.1.1 0 650002 650014 i
* 12.0.0.0/24 3.1.1.2 0 650014 650002 i
*> 2.1.1.1 0 - 650002 i
Weight of the Metric Next Hop route LocPrf of the network
*> 13.0.0.0/24 0.0.0.0 0 32768 i
* 14.0.0.0/24 2.1.1.1 0 650002 650014 i
*> 3.1.1.2 0 0 650014 i
* 20.0.0.0 3.1.1.2 0 650014 650002 i
*> 2.1.1.1 0 - 650002 i
*> 30.0.0.0 0.0.0.0 0 32768 i
*> 40.0.0.0 3.1.1.2 0 0 650014 i
* 2.1.1.1 0 650002 650014 i

R3 # show ip bgp 10.1.1.1
Entry of the BGP routing table for 10.0.0.0/8, version 13
Tracks: (2 available, best # 1, default table)
Update of announced groups:
one
Update age 1
650014
3.1.1.2 From 3.1.1.2 (14.0.0.1)
Origin of IGP, localpref 100, valid, external, better.
rx pathid: 0, tx pathid: 0x0
Update 2 years
650002
2.1.1.1 of 2.1.1.1 (12.0.0.1)
Origin of IGP, localpref 100, valid, external.
rx pathid: 0, tx pathid: 0

R4 (config) # access-list 10 Statement 10.0.0.0 0.255.255.255

R4 (config) # cisco-map route 10
R4 (config-route-map) #match ip address 10
R4 (config-route-map) #set as-path prepend 650014 650014 650014 650014
R4 (Configuration route map)

Route Map - Permission
R4 (Configuration route map)

R4 (config) #luter bgp 650014
R4 (router configuration) #nei
R4 (config-router) # Neighbor 3.1.1.1 rou
R4 (config-router) # Neighbor 3.1.1.1 Road-m
R4 (config-router) # Neighbor 3.1.1.1 - Cisco Outbound Scheme
R4 (router configuration) #END

R3 # show ip bgp
The BGP table version is 19, the ID of the local router is 13.0.0.1
Status codes: s deleted, d damped, h record, * fit,> better, i - internal,
Malfunction of the RIB, S Stale, m m, backup routes b, f RT-Filter,
Better external x, additional track, compressed from RIB,
Origin codes: i - IGP, e - EGP,? - incomplete
RPKI verification codes: V is valid, I is not valid, N does not exist

Weight of the Metric Next Hop route LocPrf of the network
* 1.0.0.0 3.1.1.2 0 650014 i
*> 2.1.1.1 0 - 650002 i
*> 2.0.0.0 0.0.0.0 0 32768 i
* 2.1.1.1 0 - 650002 i
* 3.0.0.0 3.1.1.2 0 0 650014 i
*> 0.0.0.0 0 32768 i
*> 4.0.0.0 3.1.1.2 0 0 650014 i
* 2.1.1.1 0 650002 650014 i
* 10.0.0.0 3.1.1.2 0 650014 650014 650014 650014 650014 i
*> 2.1.1.1 0 650002 650014 i
*> 11.0.0.0/24 3.1.1.2 0 650014 i
* 2.1.1.1 0 650002 650014 i
* 12.0.0.0/24 3.1.1.2 0 650014 650002 i
Weight of the Metric Next Hop route LocPrf of the network
*> 2.1.1.1 0 - 650002 i
*> 13.0.0.0/24 0.0.0.0 0 32768 i
* 14.0.0.0/24 2.1.1.1 0 650002 650014 i
*> 3.1.1.2 0 0 650014 i
* 20.0.0.0 3.1.1.2 0 650014 650002 i
*> 2.1.1.1 0 - 650002 i
*> 30.0.0.0 0.0.0.0 0 32768 i
*> 40.0.0.0 3.1.1.2 0 0 650014 i
* 2.1.1.1 0 650002 650014 i

R3 # show ip bgp 10.1.1.1
Entry of the BGP routing table for 10.0.0.0/8, version 19
Tracks: (2 available, best # 2, default table)
Update of announced groups:
one
Update age 3
650014 650014 650014 650014 650014
3.1.1.2 From 3.1.1.2 (14.0.0.1)
Origin of IGP, localpref 100, valid, external.
rx pathid: 0, tx pathid: 0
Update age 3
650002
2.1.1.1 of 2.1.1.1 (12.0.0.1)
Origin of IGP, localpref 100, valid, external, better.
rx pathid: 0, tx pathid: 0x0


R1 # traceroute 30.1.1.1
Write the escape sequence for the abortion.
Route route up to 30.1.1.1.
VRF information: (vrf in name / id, vrf out of name / id)
1.1.1.2 52 ms
2 2.1.1.2 [AS 650002] 120 milliseconds 140 ms 176 ms

R3 # traceroute 10.1.1.1
Write the escape sequence for the abortion.
Follow the road to 10.1.1.1
VRF information: (vrf in name / id, vrf out of name / id)
1 2.1.1.1 36 msec
1.1.1.1 [AS 650002] 112 ms. 92 ms 76 ms.
Post a Comment (0)
Previous Post Next Post

Advertisment