Some important concepts:
bgp confederation identifier command to tell BGP the main AS number.
bgp confederation peers command to configure all other sub-AS numbers
confed-internal tagged which means that it came from an IBGP router within the same sub-AS.
confed-external tagged which means that it came from another Sub-AS within the confederations.

Configurations Section:
R1 Configs:
R1#show run | sec bgp
ipv6 multicast rpf use-bgp
router bgp 1
 bgp log-neighbor-changes
 network 11.11.11.11 mask 255.255.255.255
 neighbor 192.168.12.2 remote-as 2
R1#
R2 Configs:
R2#show run | sec ospf
router ospf 1
 network 22.22.22.22 0.0.0.0 area 0
 network 192.168.23.0 0.0.0.255 area 0
 network 192.168.24.0 0.0.0.255 area 0
R2#
R2#show run | sec bgp
ipv6 multicast rpf use-bgp
router bgp 24
 bgp log-neighbor-changes
 bgp confederation identifier 2
 bgp confederation peers 35
 network 22.22.22.22 mask 255.255.255.255
 network 192.168.12.0
 neighbor 192.168.12.1 remote-as 1
 neighbor 33.33.33.33 remote-as 35
 neighbor 33.33.33.33 ebgp-multihop 2
 neighbor 33.33.33.33 update-source Loopback0
 neighbor 44.44.44.44 remote-as 24
 neighbor 44.44.44.44 update-source Loopback0
R2#
R3 Configs:
R3#show run | sec ospf
router ospf 1
 network 33.33.33.33 0.0.0.0 area 0
 network 192.168.23.0 0.0.0.255 area 0
 network 192.168.35.0 0.0.0.255 area 0
R3#
R3#show run | sec bgp
ipv6 multicast rpf use-bgp
router bgp 35
 bgp log-neighbor-changes
 bgp confederation identifier 2
 bgp confederation peers 24
 neighbor 22.22.22.22 remote-as 24
 neighbor 22.22.22.22 ebgp-multihop 2
 neighbor 22.22.22.22 update-source Loopback0
 neighbor 55.55.55.55 remote-as 35
 neighbor 55.55.55.55 update-source Loopback0
R3#
R4 Configs:
R4#show run | sec ospf
router ospf 1
 network 44.44.44.44 0.0.0.0 area 0
 network 192.168.24.0 0.0.0.255 area 0
 network 192.168.45.0 0.0.0.255 area 0
R4#
R4#show run | sec bgp
ipv6 multicast rpf use-bgp
router bgp 24
 bgp log-neighbor-changes
 bgp confederation identifier 2
 bgp confederation peers 35
 neighbor 22.22.22.22 remote-as 24
 neighbor 22.22.22.22 update-source Loopback0
 neighbor 55.55.55.55 remote-as 35
 neighbor 55.55.55.55 ebgp-multihop 255
 neighbor 55.55.55.55 update-source Loopback0
R4#
R5 Configs:
R5#show run | sec ospf
router ospf 1
 network 55.55.55.55 0.0.0.0 area 0
 network 192.168.35.0 0.0.0.255 area 0
 network 192.168.45.0 0.0.0.255 area 0
R5#
R5#show run | sec bgp
ipv6 multicast rpf use-bgp
router bgp 35
 bgp log-neighbor-changes
 network 55.55.55.55 mask 255.255.255.255
 neighbor 33.33.33.33 remote-as 35
 neighbor 33.33.33.33 update-source Loopback0
 neighbor 44.44.44.44 remote-as 24
 neighbor 44.44.44.44 ebgp-multihop 2
 neighbor 44.44.44.44 update-source Loopback0
R5#
Verifications Sections:
R1#show ip bgp summary
BGP router identifier 11.11.11.11, local AS number 1
BGP table version is 6, main routing table version 6
4 network entries using 576 bytes of memory
4 path entries using 320 bytes of memory
3/3 BGP path/bestpath attribute entries using 408 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 1328 total bytes of memory
BGP activity 4/0 prefixes, 4/0 paths, scan interval 60 secs
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.22     4            2      36      33        6    0    0 00:26:53        3
R1#
R2#show ip bgp summary
BGP router identifier 22.22.22.22, local AS number 24
BGP table version is 6, main routing table version 6
4 network entries using 576 bytes of memory
4 path entries using 320 bytes of memory
3/3 BGP path/bestpath attribute entries using 408 bytes of memory
2 BGP AS-PATH entries using 48 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 1352 total bytes of memory
BGP activity 4/0 prefixes, 5/1 paths, scan interval 60 secs
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
11.11.11.11     4            1      34      37        6    0    0 00:27:53        1
33.33.33.33     4           35      54      57        6    0    0 00:45:44        1
44.44.44.44     4           24      67      68        6    0    0 00:56:01        0
R2#
R3#show ip bgp summary
BGP router identifier 33.33.33.33, local AS number 35
BGP table version is 4, main routing table version 4
4 network entries using 576 bytes of memory
4 path entries using 320 bytes of memory
3/2 BGP path/bestpath attribute entries using 408 bytes of memory
2 BGP AS-PATH entries using 48 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 1352 total bytes of memory
BGP activity 4/0 prefixes, 6/2 paths, scan interval 60 secs
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.22     4           24      57      55        4    0    0 00:46:10        3
55.55.55.55     4           35      24      21        4    0    0 00:15:03        1
R3#
R4#show ip bgp summary
BGP router identifier 44.44.44.44, local AS number 24
BGP table version is 5, main routing table version 5
4 network entries using 576 bytes of memory
7 path entries using 560 bytes of memory
5/2 BGP path/bestpath attribute entries using 680 bytes of memory
3 BGP AS-PATH entries using 72 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 1888 total bytes of memory
BGP activity 4/0 prefixes, 7/0 paths, scan interval 60 secs
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.22     4           24      69      68        5    0    0 00:56:52        4
55.55.55.55     4           35      22      22        5    0    0 00:15:58        3
R4#
R5#show ip bgp summary
BGP router identifier 55.55.55.55, local AS number 35
BGP table version is 11, main routing table version 11
3 network entries using 432 bytes of memory
6 path entries using 480 bytes of memory
3/2 BGP path/bestpath attribute entries using 408 bytes of memory
2 BGP AS-PATH entries using 48 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 1368 total bytes of memory
BGP activity 3/0 prefixes, 6/0 paths, scan interval 60 secs
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
33.33.33.33     4           35      22      25       11    0    0 00:15:53        2
44.44.44.44     4           24      23      23       11    0    0 00:16:22        3
R5#
Routing Verifications:
R1#show ip  bgp
BGP table version is 16, local router ID is 11.11.11.11
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
 *>  11.11.11.11/32   0.0.0.0                  0         32768 i
 *>  22.22.22.22/32   192.168.12.2             0             0 2 i
 *>  55.55.55.55/32   192.168.12.2                           0 2 I     <<<<<<< RIB failures
 r>  192.168.12.0     192.168.12.2             0             0 2 i
R1#
R2#show ip bgp
BGP table version is 9, local router ID is 22.22.22.22
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
 *>  11.11.11.11/32   192.168.12.1             0             0 1 i
 *>  22.22.22.22/32   0.0.0.0                  0         32768 i
 r>  55.55.55.55/32   55.55.55.55              0    100      0 (35) i
 *>  192.168.12.0     0.0.0.0                  0         32768 i
R2#
Received Prefix as an External route via R1:
R2#show ip bgp 11.11.11.11
BGP routing table entry for 11.11.11.11/32, version 8
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     4          5
  Refresh Epoch 1
  1
    192.168.12.1 from 192.168.12.1 (11.11.11.11)
      Origin IGP, metric 0, localpref 100, valid, external, best
      rx pathid: 0, tx pathid: 0x0
R2#
Prefix is received by R2 from R3 and is tagged with confed-external. This means that the route is learned from another Sub-AS within the confederations.
R2#show ip bgp 55.55.55.55
BGP routing table entry for 55.55.55.55/32, version 4
Paths: (1 available, best #1, table default, RIB-failure(17))
  Advertised to update-groups:
     5          7
  Refresh Epoch 1
  (35)
    55.55.55.55 (metric 3) from 33.33.33.33 (33.33.33.33)
      Origin IGP, metric 0, localpref 100, valid, confed-external, best
      rx pathid: 0, tx pathid: 0x0
R2#
R3#show ip bgp
BGP table version is 16, local router ID is 33.33.33.33
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
 *>  11.11.11.11/32   192.168.12.1             0    100      0 (24) 1 i
 r>  22.22.22.22/32   22.22.22.22              0    100      0 (24) i
 r>i 55.55.55.55/32   55.55.55.55              0    100      0 i
 *>  192.168.12.0     22.22.22.22              0    100      0 (24) i
R3#
R3 learned the Prefix11.11.11.11/32  from R2 , and AS Path have appended AS 24.
R3#show ip bgp 11.11.11.11
BGP routing table entry for 11.11.11.11/32, version 16
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     2
  Refresh Epoch 1
  (24) 1
    192.168.12.1 (metric 2) from 22.22.22.22 (22.22.22.22)
      Origin IGP, metric 0, localpref 100, valid, confed-external, best
      rx pathid: 0, tx pathid: 0x0
R3#
R4 learned 11.11.11.11/32 from both R1 and R5. R1 tagged the prefix with confed-internalwhile R5 tagged the prefix as confed-external
R4#show ip bgp 11.11.11.11
BGP routing table entry for 11.11.11.11/32, version 14
Paths: (2 available, best #2, table default)
  Advertised to update-groups:
     2
  Refresh Epoch 1
  35 1
    55.55.55.55 (metric 2) from 55.55.55.55 (55.55.55.55)
      Origin IGP, localpref 100, valid, confed-external
      rx pathid: 0, tx pathid: 0
  Refresh Epoch 1
  1
    192.168.12.1 (metric 2) from 22.22.22.22 (22.22.22.22)
      Origin IGP, metric 0, localpref 100, valid, confed-internal, best
      rx pathid: 0, tx pathid: 0x0
R4#
From the BGP routing Information base, new BGP attribute is introduced which is the Confed_AS_Set which prepend the Confederation Sub-AS. For the case of prefix 11.11.11.11/32 , it was advertised from R1 with AS 1 and it was learned by R2
R4#show ip bgp
BGP table version is 14, local router ID is 44.44.44.44
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
 *   11.11.11.11/32   55.55.55.55                            0 35 1 i
 *>i                  192.168.12.1             0    100      0 1 i
 r   22.22.22.22/32   55.55.55.55                            0 35 i
 r>i                  22.22.22.22              0    100      0 i
 r>i 55.55.55.55/32   55.55.55.55              0    100      0 (35) i
 r                    55.55.55.55              0             0 35 i
 *   192.168.12.0     55.55.55.55                            0 35 i

 *>i                  22.22.22.22              0    100      0 i

Leave a comment

Quote of the week

"People ask me what I do in the winter when there's no baseball. I'll tell you what I do. I stare out the window and wait for spring."

~ Rogers Hornsby