BGP Attribute – AS Prepend

BGP Attribute – AS Prepend
In the below topology, Traffic is asymmetric as outgoing
taffic from R1 is going via R2 -> R5 ->R6 whereas
Incoming traffic is coming from R6-> R4 ->R3->R1



To remove asymmetric routing, we need to manipulate the
incoming traffic. AS-Prepend to be done on R3 so that R6 will always prefer the
path from R5.



R1:-

interface Loopback0
 ip address 1.1.1.1
255.255.255.255

interface FastEthernet0/0
 description ”
Connected to R2″
 ip address
12.12.12.1 255.255.255.0
no shut

interface FastEthernet0/1
 description ”
Connected to R3″
 ip address
13.13.13.1 255.255.255.0
 no shut

interface FastEthernet2/0
 description ”
Connected to PC1″
 ip address
10.1.1.1 255.255.255.0
no shut

router bgp 1
 no synchronization
 bgp
log-neighbor-changes
 network 10.1.1.0
mask 255.255.255.0
 neighbor 12.12.12.2
remote-as 1


 neighbor
13.13.13.3 remote-as 1

R2:-

interface Loopback0
 ip address 2.2.2.2
255.255.255.255

interface FastEthernet0/0
 description ”
Connected to R1″
 ip address
12.12.12.2 255.255.255.0
no shut

interface FastEthernet1/0
 description ”
Connected to R5″
 ip address
25.25.25.2 255.255.255.0
 no shut

router bgp 1
 no synchronization
 bgp router-id
2.2.2.2
 bgp
log-neighbor-changes
 neighbor
12.12.12.1 remote-as 1
 neighbor
12.12.12.1 next-hop-self
 neighbor
25.25.25.5 remote-as 2

R3:-

interface Loopback0
 ip address 3.3.3.3
255.255.255.255

interface FastEthernet0/1
description ” Connected to R1″
 ip address
13.13.13.3 255.255.255.0
no shut

interface FastEthernet1/0
description ” Connected to R4″
 ip address
34.34.34.3 255.255.255.0
no shut

router bgp 1
 no synchronization
 bgp router-id
3.3.3.3
 bgp
log-neighbor-changes
 neighbor
13.13.13.1 remote-as 1
 neighbor
13.13.13.1 next-hop-self
 neighbor
34.34.34.4 remote-as 2
 no auto-summary

configured AS Prepend:-

router bgp 1
neighbor 34.34.34.4 route-map SET_AS out

route-map SET_AS permit 10
 set as-path
prepend 1 1 1 1

R4:-

interface FastEthernet0/1
description ” Connected to R6″
 ip address
46.46.46.4 255.255.255.0
no shut

interface FastEthernet1/0
description ” Connected to R3″
 ip address
34.34.34.4 255.255.255.0
no shut

router bgp 2
 no synchronization
 bgp
log-neighbor-changes
 neighbor
34.34.34.3 remote-as 1
 neighbor
46.46.46.6 remote-as 2
 neighbor
46.46.46.6 next-hop-self
 no auto-summary

R5:-

interface Loopback0
 ip address 5.5.5.5
255.255.255.255

interface FastEthernet0/0
description ” Connected to R6″
 ip address
56.56.56.5 255.255.255.0
no shut

interface FastEthernet1/0
description ” Connected to R2″
 ip address
25.25.25.5 255.255.255.0
no shut

router bgp 2
 no synchronization
 bgp
log-neighbor-changes
 neighbor
25.25.25.2 remote-as 1
 neighbor
56.56.56.6 remote-as 2
 neighbor
56.56.56.6 next-hop-self
 no auto-summary


R6:-

interface Loopback0
 ip address 6.6.6.6
255.255.255.255

interface FastEthernet0/0
description ” Connected to R5″
 ip address
56.56.56.6 255.255.255.0
no shut

interface FastEthernet0/1
description ” Connected to R4″
 ip address
46.46.46.6 255.255.255.0
no shut

interface FastEthernet2/0
description ” Connected to PC2″
 ip address
20.1.1.1 255.255.255.0
 no shut

router bgp 2
 no synchronization
 bgp
log-neighbor-changes
 network 20.1.1.0
mask 255.255.255.0
 neighbor
46.46.46.4 remote-as 2
 neighbor
56.56.56.5 remote-as 2
 no auto-summary

PC1:-

PC1> show ip

NAME        :
PC1[1]
IP/MASK     :
10.1.1.10/24
GATEWAY     :
10.1.1.1
DNS         :
MAC         : 00:50:79:66:68:00
LPORT       : 10003
RHOST:PORT  :
127.0.0.1:10002
MTU:        : 1500

PC2:-
PC2> show ip

NAME        :
PC2[1]
IP/MASK     :
20.1.1.10/24
GATEWAY     :
20.1.1.1
DNS         :
MAC         :
00:50:79:66:68:00
LPORT       : 10003
RHOST:PORT  :
127.0.0.1:10002
MTU:        : 1500

Verification:-

R1:-

Without AS Prepend:-

R1#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P – periodic downloaded static
route, H – NHRP
       + –
replicated route, % – next hop override

Gateway of last resort is not set

      1.0.0.0/32 is
subnetted, 1 subnets
C        1.1.1.1 is
directly connected, Loopback0
      10.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
10.1.1.0/24 is directly connected, FastEthernet2/0
L       
10.1.1.1/32 is directly connected, FastEthernet2/0
      12.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
12.12.12.0/24 is directly connected, FastEthernet0/0
L       
12.12.12.1/32 is directly connected, FastEthernet0/0
      13.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
13.13.13.0/24 is directly connected, FastEthernet0/1
L       
13.13.13.1/32 is directly connected, FastEthernet0/1
      20.0.0.0/24
is subnetted, 1 subnets
B        20.1.1.0 [200/0] via 12.12.12.2,
00:10:52
  //best path is selected as per selection criteria,
lowest router ID.

R1#sh ip bgp summ
BGP router identifier 1.1.1.1, local AS number 1
BGP table version is 18, main routing table version 18
2 network entries using 256 bytes of memory
3 path entries using 156 bytes of memory
2/2 BGP path/bestpath attribute entries using 248 bytes
of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 684 total bytes of memory
BGP activity 3/1 prefixes, 9/6 paths, scan interval 60
secs

Neighbor       
V           AS MsgRcvd
MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.12.12.2     
4            1      84     
83       18    0   
0 01:11:37        1
13.13.13.3     
4            1     192    
187       18    0   
0 02:47:10        1

R1#sh ip bgp neighbors | in router
  BGP version 4,
remote router ID 2.2.2.2
  BGP version 4,
remote router ID 3.3.3.3
R1#

With AS Prepend:-

R1#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override

Gateway of last resort is not set

      1.0.0.0/32 is
subnetted, 1 subnets
C        1.1.1.1 is
directly connected, Loopback0
      10.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
10.1.1.0/24 is directly connected, FastEthernet2/0
L       
10.1.1.1/32 is directly connected, FastEthernet2/0
      12.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
12.12.12.0/24 is directly connected, FastEthernet0/0
L       
12.12.12.1/32 is directly connected, FastEthernet0/0
      13.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
13.13.13.0/24 is directly connected, FastEthernet0/1
L        13.13.13.1/32
is directly connected, FastEthernet0/1
      20.0.0.0/24
is subnetted, 1 subnets
B        20.1.1.0 [200/0] via 12.12.12.2,
00:37:25
    \No change in outgoing traffic
R2:-

Without AS prepend

R2#sh ip bgp summary
BGP router identifier 2.2.2.2, local AS number 1
BGP table version is 5, main routing table version 5
2 network entries using 256 bytes of memory
2 path entries using 104 bytes of memory
2/2 BGP path/bestpath attribute entries using 248 bytes
of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 632 total bytes of memory
BGP activity 11/9 prefixes, 11/9 paths, scan interval 60
secs

Neighbor       
V           AS MsgRcvd
MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.12.12.1     
4            1     509    
517        5    0   
0 07:39:45        1
25.25.25.5     
4            2     522    
525        5    0   
0 07:50:54        1

R2#sh ip bgp
BGP table version is 5, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid,
> best, i – internal,
              r
RIB-failure, S Stale, m multipath, b backup-path, x best-external
Origin codes: i – IGP, e – EGP, ? – incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i10.1.1.0/24     
12.12.12.1               0    100     
0 i
*> 20.1.1.0/24     
25.25.25.5                            
0 2 i


R2#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override

Gateway of last resort is not set

      2.0.0.0/32 is
subnetted, 1 subnets
C        2.2.2.2 is
directly connected, Loopback0
      10.0.0.0/24
is subnetted, 1 subnets
B        10.1.1.0
[200/0] via 12.12.12.1, 07:39:52
      12.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
12.12.12.0/24 is directly connected, FastEthernet0/0
L       
12.12.12.2/32 is directly connected, FastEthernet0/0
      20.0.0.0/24
is subnetted, 1 subnets
B        20.1.1.0 [20/0] via 25.25.25.5,
07:50:04
      25.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
25.25.25.0/24 is directly connected, FastEthernet1/0
L       
25.25.25.2/32 is directly connected, FastEthernet1/0
R2#

With AS Prepend:-

R2#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP, EX – EIGRP external, O – OSPF, IA
– OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override

Gateway of last resort is not set

      2.0.0.0/32 is
subnetted, 1 subnets
C        2.2.2.2 is
directly connected, Loopback0
      10.0.0.0/24
is subnetted, 1 subnets
B        10.1.1.0
[200/0] via 12.12.12.1, 08:00:35
      12.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
12.12.12.0/24 is directly connected, FastEthernet0/0
L       
12.12.12.2/32 is directly connected, FastEthernet0/0
      20.0.0.0/24
is subnetted, 1 subnets
B        20.1.1.0 [20/0] via 25.25.25.5,
08:10:47
      25.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
25.25.25.0/24 is directly connected, FastEthernet1/0
L       
25.25.25.2/32 is directly connected, FastEthernet1/0

R3:-

Without AS prepend

R3#sh ip bgp su
BGP router identifier 3.3.3.3, local AS number 1
BGP table version is 3, main routing table version 3
2 network entries using 256 bytes of memory
2 path entries using 104 bytes of memory
2/2 BGP path/bestpath attribute entries using 248 bytes
of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 632 total bytes of memory
BGP activity 5/3 prefixes, 5/3 paths, scan interval 60
secs

Neighbor       
V           AS MsgRcvd
MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
13.13.13.1     
4            1      30     
33        3    0   
0 00:23:58        1
34.34.34.4     
4            2      31     
32        3    0   
0 00:23:58        1

R3#sh ip bgp
BGP table version is 3, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid,
> best, i – internal,
              r
RIB-failure, S Stale, m multipath, b backup-path, x best-external
Origin codes: i – IGP, e – EGP, ? – incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i10.1.1.0/24     
13.13.13.1               0    100     
0 i
*>
20.1.1.0/24      34.34.34.4                             0 2 i

R3#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override

Gateway of last resort is not set

      3.0.0.0/32 is
subnetted, 1 subnets
C        3.3.3.3 is
directly connected, Loopback0
      10.0.0.0/24
is subnetted, 1 subnets
B        10.1.1.0
[200/0] via 13.13.13.1, 00:23:03
      13.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
13.13.13.0/24 is directly connected, FastEthernet0/1
L       
13.13.13.3/32 is directly connected, FastEthernet0/1
      20.0.0.0/24
is subnetted, 1 subnets
B        20.1.1.0 [20/0] via 34.34.34.4,
00:23:03
      34.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
34.34.34.0/24 is directly connected, FastEthernet1/0
L       
34.34.34.3/32 is directly connected, FastEthernet1/0

With AS Prepend:-

R3#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS inter
area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override

Gateway of last resort is not set

      3.0.0.0/32 is
subnetted, 1 subnets
C        3.3.3.3 is directly connected, Loopback0
      10.0.0.0/24
is subnetted, 1 subnets
B        10.1.1.0
[200/0] via 13.13.13.1, 00:43:14
      13.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
13.13.13.0/24 is directly connected, FastEthernet0/1
L       
13.13.13.3/32 is directly connected, FastEthernet0/1
      20.0.0.0/24
is subnetted, 1 subnets
B        20.1.1.0 [20/0] via 34.34.34.4,
00:43:14
      34.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
34.34.34.0/24 is directly connected, FastEthernet1/0
L       
34.34.34.3/32 is directly connected, FastEthernet1/0

R4:-

Without AS prepend

R4#sh ip bgp summ
BGP router identifier 4.4.4.4, local AS number 2
BGP table version is 9, main routing table version 9
2 network entries using 256 bytes of memory
2 path entries using 104 bytes of memory
2/2 BGP path/bestpath attribute entries using 248 bytes
of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 632 total bytes of memory
BGP activity 4/2 prefixes, 4/2 paths, scan interval 60
secs

Neighbor       
V           AS MsgRcvd
MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
34.34.34.3     
4            1      33     
32        9    0   
0 00:24:21        1
46.46.46.6     
4            2     609    
618        9   
0    0 09:12:16        1
R4#sh ip bgp
BGP table version is 9, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid,
> best, i – internal,
              r
RIB-failure, S Stale, m multipath, b backup-path, x best-external
Origin codes: i – IGP, e – EGP, ? – incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.1.1.0/24     
34.34.34.3                            
0 1 i
*>i20.1.1.0/24     
46.46.46.6               0    100     
0 i
R4#sh ip rou
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + – replicated route, % – next hop override

Gateway of last resort is not set

      4.0.0.0/32 is
subnetted, 1 subnets
C        4.4.4.4 is
directly connected, Loopback0
      10.0.0.0/24
is subnetted, 1 subnets
B        10.1.1.0 [20/0] via 34.34.34.3, 00:18:39
      20.0.0.0/24
is subnetted, 1 subnets
B        20.1.1.0
[200/0] via 46.46.46.6, 09:07:54
      34.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
34.34.34.0/24 is directly connected, FastEthernet1/0
L       
34.34.34.4/32 is directly connected, FastEthernet1/0
      46.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
46.46.46.0/24 is directly connected, FastEthernet0/1
L       
46.46.46.4/32 is directly connected, FastEthernet0/1
R4#

With AS Prepend:-

R4#sh ip bgp
BGP table version is 10, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid,
> best, i – internal,
              r
RIB-failure, S Stale, m multipath, b backup-path, x best-external
Origin codes: i – IGP, e – EGP, ? – incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>
10.1.1.0/24      34.34.34.3                             0 1 1 1 1 1 I

  \ Increased the AS path
*>i20.1.1.0/24     
46.46.46.6               0    100     
0 i

R4#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override

Gateway of last resort is not set

      4.0.0.0/32 is
subnetted, 1 subnets
C        4.4.4.4 is
directly connected, Loopback0
      10.0.0.0/24
is subnetted, 1 subnets
B        10.1.1.0 [20/0] via 34.34.34.3,
00:10:17
      20.0.0.0/24
is subnetted, 1 subnets
B        20.1.1.0
[200/0] via 46.46.46.6, 09:28:03
      34.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C        34.34.34.0/24 is directly connected,
FastEthernet1/0
L       
34.34.34.4/32 is directly connected, FastEthernet1/0
      46.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
46.46.46.0/24 is directly connected, FastEthernet0/1
L       
46.46.46.4/32 is directly connected, FastEthernet0/1

R5:-

Without AS prepend

R5#sh ip bgp sum
BGP router identifier 5.5.5.5, local AS number 2
BGP table version is 13, main routing table version 13
2 network entries using 256 bytes of memory
2 path entries using 104 bytes of memory
2/2 BGP path/bestpath attribute entries using 248 bytes
of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 632 total bytes of memory
BGP activity 7/5 prefixes, 7/5 paths, scan interval 60
secs

Neighbor       
V           AS MsgRcvd
MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
25.25.25.2     
4            1     527    
524       13    0   
0 07:52:40        1
56.56.56.6     
4            2     614    
616       13    0   
0 09:12:04        1
R5#sh ip bgp
BGP table version is 13, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history, * valid,
> best, i – internal,
              r
RIB-failure, S Stale, m multipath, b backup-path, x best-external
Origin codes: i – IGP, e – EGP, ? – incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.1.1.0/24     
25.25.25.2                            
0 1 i
*>i20.1.1.0/24     
56.56.56.6               0    100     
0 i

R5#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override

Gateway of last resort is not set

      5.0.0.0/32 is
subnetted, 1 subnets
C        5.5.5.5 is
directly connected, Loopback0
      10.0.0.0/24
is subnetted, 1 subnets
B        10.1.1.0
[20/0] via 25.25.25.2, 07:41:34
      20.0.0.0/24
is subnetted, 1 subnets
B        20.1.1.0
[200/0] via 56.56.56.6, 09:07:32
      25.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
25.25.25.0/24 is directly connected, FastEthernet1/0
L       
25.25.25.5/32 is directly connected, FastEthernet1/0
      56.0.0.0/8 is variably subnetted, 2 subnets,
2 masks
C       
56.56.56.0/24 is directly connected, FastEthernet0/0
L       
56.56.56.5/32 is directly connected, FastEthernet0/0
R5#

With AS Prepend:-

R5#sh ip bgp
BGP table version is 13, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history, * valid,
> best, i – internal,
              r
RIB-failure, S Stale, m multipath, b backup-path, x best-external
Origin codes: i – IGP, e – EGP, ? – incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.1.1.0/24     
25.25.25.2                            
0 1 i
*>i20.1.1.0/24     
56.56.56.6               0    100     
0 i
R5#sh ip rou
R5#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override

Gateway of last resort is not set

      5.0.0.0/32 is
subnetted, 1 subnets
C        5.5.5.5 is
directly connected, Loopback0
      10.0.0.0/24
is subnetted, 1 subnets
B        10.1.1.0
[20/0] via 25.25.25.2, 08:03:18
      20.0.0.0/24
is subnetted, 1 subnets
B        20.1.1.0 [200/0] via 56.56.56.6,
09:29:16
      25.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
25.25.25.0/24 is directly connected, FastEthernet1/0
L       
25.25.25.5/32 is directly connected, FastEthernet1/0
      56.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
56.56.56.0/24 is directly connected, FastEthernet0/0
L        56.56.56.5/32
is directly connected, FastEthernet0/0

R6:-

Without AS prepend

R6#sh ip bgp summ
BGP router identifier 6.6.6.6, local AS number 2
BGP table version is 14, main routing table version 14
2 network entries using 256 bytes of memory
3 path entries using 156 bytes of memory
2/2 BGP path/bestpath attribute entries using 248 bytes
of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 684 total bytes of memory
BGP activity 3/1 prefixes, 10/7 paths, scan interval 60
secs

Neighbor       
V           AS MsgRcvd
MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
46.46.46.4     
4            2     619    
610       14    0   
0 09:13:10        1
56.56.56.5     
4            2     617    
615       14    0   
0 09:13:20        1

R6#sh ip bgp
BGP table version is 14, local router ID is 6.6.6.6
Status codes: s suppressed, d damped, h history, * valid,
> best, i – internal,
              r
RIB-failure, S Stale, m multipath, b backup-path, x best-external
Origin codes: i – IGP, e – EGP, ? – incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i10.1.1.0/24     
46.46.46.4               0    100     
0 1 i
* i                
56.56.56.5               0    100     
0 1 i
*> 20.1.1.0/24     
0.0.0.0                  0        
32768 i

R6#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override

Gateway of last resort is not set

      6.0.0.0/32 is
subnetted, 1 subnets
C        6.6.6.6 is
directly connected, Loopback0
      10.0.0.0/24
is subnetted, 1 subnets
B        10.1.1.0 [200/0] via 46.46.46.4,
00:14:25
      20.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
20.1.1.0/24 is directly connected, FastEthernet2/0
L       
20.1.1.1/32 is directly connected, FastEthernet2/0
      46.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
46.46.46.0/24 is directly connected, FastEthernet0/1
L       
46.46.46.6/32 is directly connected, FastEthernet0/1
      56.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
56.56.56.0/24 is directly connected, FastEthernet0/0
L       
56.56.56.6/32 is directly connected, FastEthernet0/0
R6#

With AS Prepend:-

R6#sh ip bgp
BGP table version is 15, local router ID is 6.6.6.6
Status codes: s suppressed, d damped, h history, * valid,
> best, i – internal,
              r
RIB-failure, S Stale, m multipath, b backup-path, x best-external
Origin codes: i – IGP, e – EGP, ? – incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*
i10.1.1.0/24      46.46.46.4               0    100     
0 1 1 1 1 1 I
  \Modified AS path received on R6
from R4
*>i                 56.56.56.5               0    100     
0 1 I
                         \Preferred path
*> 20.1.1.0/24     
0.0.0.0                  0         32768 i

R6#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF NSSA external type 1, N2 – OSPF
NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override

Gateway of last resort is not set

      6.0.0.0/32 is
subnetted, 1 subnets
C        6.6.6.6 is
directly connected, Loopback0
      10.0.0.0/24
is subnetted, 1 subnets
B        10.1.1.0 [200/0] via 56.56.56.5,
00:12:44
      20.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
20.1.1.0/24 is directly connected, FastEthernet2/0
L       
20.1.1.1/32 is directly connected, FastEthernet2/0
      46.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
46.46.46.0/24 is directly connected, FastEthernet0/1
L       
46.46.46.6/32 is directly connected, FastEthernet0/1
      56.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
56.56.56.0/24 is directly connected, FastEthernet0/0
L       
56.56.56.6/32 is directly connected, FastEthernet0/0
R6#

PC1:-

Without AS prepend

PC1> trace 20.1.1.10
trace to 20.1.1.10, 8 hops max, press Ctrl+C to stop
 1   10.1.1.1  
10.000 ms  10.000 ms  20.000 ms
 2   12.12.12.2  
30.000 ms  30.000 ms  30.000 ms \R2
 3   25.25.25.5  
50.000 ms  50.000 ms  50.000 ms 
\R5
 4   56.56.56.6  
80.000 ms  60.000 ms  50.000 ms  
\R6
 5   *20.1.1.10  
80.000 ms (ICMP type:3, code:3, Destination port unreachable)

With AS Prepend:-

PC1> trace 20.1.1.10  
–<< No change
trace to 20.1.1.10, 8 hops max, press Ctrl+C to stop
 1   10.1.1.1  
10.000 ms  10.000 ms  10.000 ms
 2   12.12.12.2  
50.000 ms  30.000 ms  30.000 ms 
\R2
 3   25.25.25.5  
50.000 ms  50.000 ms  50.000 ms 
\R5
 4   56.56.56.6  
60.000 ms  60.000 ms  60.000 ms 
\R6
 5    20.1.1.10   70.000 ms (ICMP type:3, code:3, Destination
port unreachable)


PC2:-

Without AS prepend

C2> trace 10.1.1.10
trace to 10.1.1.10, 8 hops max, press Ctrl+C to stop
 1   20.1.1.1  
10.000 ms  10.000 ms  10.000 ms
 2   46.46.46.4  
30.000 ms  30.000 ms  30.000 ms
        \R4
 3  
34.34.34.3   50.000 ms  40.000 ms 
50.000 ms        
\R3
 4  
13.13.13.1   50.000 ms  70.000 ms 
70.000 ms
        \R1
 5   *10.1.1.10  
70.000 ms (ICMP type:3, code:3, Destination port unreachable)

With AS Prepend:-

PC2> trace 10.1.1.10
trace to 10.1.1.10, 8 hops max, press Ctrl+C to stop
 1   20.1.1.1  
10.000 ms  10.000 ms  10.000 ms
 2   56.56.56.5  
20.000 ms  30.000 ms  30.000 ms
       \R5
 3  
25.25.25.2   30.000 ms  40.000 ms 
30.000 ms
       \R2
 4  
12.12.12.1   70.000 ms  70.000 ms 
60.000 ms
       \R1



 5   *10.1.1.10  
80.000 ms (ICMP type:3, code:3, Destination port unreachable)