BGP Community Local AS
Compare the member-AS boundary with the overall confederation boundary.
Six-router confederation
R1 (AS 65010) feeds confederation 65234 through R2. R2–R3 belong to member AS 65023; R4–R5 belong to member AS 65045. R6 (AS 65060) attaches to R3. External routers see 65234, while internal sessions use member AS numbers.
| Physical link | First endpoint | Second endpoint |
|---|---|---|
| R1–R2 | GigabitEthernet1 192.0.2.1/30 | GigabitEthernet1 192.0.2.2/30 |
| R2–R3 | GigabitEthernet2 192.0.2.5/30 | GigabitEthernet1 192.0.2.6/30 |
| R2–R4 | GigabitEthernet3 192.0.2.9/30 | GigabitEthernet1 192.0.2.10/30 |
| R3–R5 | GigabitEthernet2 192.0.2.13/30 | GigabitEthernet1 192.0.2.14/30 |
| R4–R5 | GigabitEthernet2 192.0.2.17/30 | GigabitEthernet2 192.0.2.18/30 |
| R3–R6 | GigabitEthernet3 192.0.2.21/30 | GigabitEthernet1 192.0.2.22/30 |
Complete baseline configurations
R1
hostname R1
ip cef
interface Loopback0
ip address 10.255.0.1 255.255.255.255
exit
interface Loopback10
ip address 198.51.100.1 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.1 255.255.255.252
no shutdown
exit
router bgp 65010
bgp router-id 10.255.0.1
no bgp default ipv4-unicast
neighbor 192.0.2.2 remote-as 65234
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.2 activate
network 198.51.100.1 mask 255.255.255.255
exit-address-family
endR2
hostname R2
ip cef
interface Loopback0
ip address 10.255.0.2 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.2 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.5 255.255.255.252
no shutdown
exit
interface GigabitEthernet3
ip address 192.0.2.9 255.255.255.252
no shutdown
exit
router ospf 1
router-id 10.255.0.2
network 10.255.0.2 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.2 0.0.0.0 area 0
passive-interface GigabitEthernet1
network 192.0.2.5 0.0.0.0 area 0
network 192.0.2.9 0.0.0.0 area 0
exit
router bgp 65023
bgp router-id 10.255.0.2
bgp confederation identifier 65234
bgp confederation peers 65045
no bgp default ipv4-unicast
neighbor 192.0.2.1 remote-as 65010
neighbor 10.255.0.3 remote-as 65023
neighbor 10.255.0.3 update-source Loopback0
neighbor 10.255.0.4 remote-as 65045
neighbor 10.255.0.4 update-source Loopback0
neighbor 10.255.0.4 ebgp-multihop 2
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.1 activate
neighbor 10.255.0.3 activate
neighbor 10.255.0.3 send-community
neighbor 10.255.0.3 next-hop-self
neighbor 10.255.0.4 activate
neighbor 10.255.0.4 send-community
exit-address-family
endR3
hostname R3
ip cef
interface Loopback0
ip address 10.255.0.3 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.6 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.13 255.255.255.252
no shutdown
exit
interface GigabitEthernet3
ip address 192.0.2.21 255.255.255.252
no shutdown
exit
router ospf 1
router-id 10.255.0.3
network 10.255.0.3 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.6 0.0.0.0 area 0
network 192.0.2.13 0.0.0.0 area 0
exit
router bgp 65023
bgp router-id 10.255.0.3
bgp confederation identifier 65234
bgp confederation peers 65045
no bgp default ipv4-unicast
neighbor 10.255.0.2 remote-as 65023
neighbor 10.255.0.2 update-source Loopback0
neighbor 10.255.0.5 remote-as 65045
neighbor 10.255.0.5 update-source Loopback0
neighbor 10.255.0.5 ebgp-multihop 2
neighbor 192.0.2.22 remote-as 65060
address-family ipv4 unicast
no auto-summary
neighbor 10.255.0.2 activate
neighbor 10.255.0.2 send-community
neighbor 10.255.0.5 activate
neighbor 10.255.0.5 send-community
neighbor 192.0.2.22 activate
exit-address-family
endR4
hostname R4
ip cef
interface Loopback0
ip address 10.255.0.4 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.10 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.17 255.255.255.252
no shutdown
exit
router ospf 1
router-id 10.255.0.4
network 10.255.0.4 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.10 0.0.0.0 area 0
network 192.0.2.17 0.0.0.0 area 0
exit
router bgp 65045
bgp router-id 10.255.0.4
bgp confederation identifier 65234
bgp confederation peers 65023
no bgp default ipv4-unicast
neighbor 10.255.0.2 remote-as 65023
neighbor 10.255.0.2 update-source Loopback0
neighbor 10.255.0.2 ebgp-multihop 2
neighbor 10.255.0.5 remote-as 65045
neighbor 10.255.0.5 update-source Loopback0
address-family ipv4 unicast
no auto-summary
neighbor 10.255.0.2 activate
neighbor 10.255.0.2 send-community
neighbor 10.255.0.5 activate
neighbor 10.255.0.5 send-community
exit-address-family
endR5
hostname R5
ip cef
interface Loopback0
ip address 10.255.0.5 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.14 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.18 255.255.255.252
no shutdown
exit
router ospf 1
router-id 10.255.0.5
network 10.255.0.5 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.14 0.0.0.0 area 0
network 192.0.2.18 0.0.0.0 area 0
exit
router bgp 65045
bgp router-id 10.255.0.5
bgp confederation identifier 65234
bgp confederation peers 65023
no bgp default ipv4-unicast
neighbor 10.255.0.3 remote-as 65023
neighbor 10.255.0.3 update-source Loopback0
neighbor 10.255.0.3 ebgp-multihop 2
neighbor 10.255.0.4 remote-as 65045
neighbor 10.255.0.4 update-source Loopback0
address-family ipv4 unicast
no auto-summary
neighbor 10.255.0.3 activate
neighbor 10.255.0.3 send-community
neighbor 10.255.0.4 activate
neighbor 10.255.0.4 send-community
exit-address-family
endR6
hostname R6
ip cef
interface Loopback0
ip address 10.255.0.6 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.22 255.255.255.252
no shutdown
exit
router bgp 65060
bgp router-id 10.255.0.6
no bgp default ipv4-unicast
neighbor 192.0.2.21 remote-as 65234
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.21 activate
exit-address-family
endOSPF carries the four internal loopbacks and R2’s R1-facing /30 (passive in OSPF), so the preserved next hop 192.0.2.1 is reachable throughout the confederation. R2 also uses next-hop-self toward R3. Thus route loss in this exercise is caused by scope policy rather than an unresolved next hop. Confederation construction is covered fully in its own later lesson.
Verify unrestricted propagation
R3# show ip bgp 198.51.100.1/32
Network Next Hop Metric LocPrf Weight Path
*>i 198.51.100.1/32 10.255.0.2 0 100 0 65010 iR4# show ip bgp 198.51.100.1/32
Network Next Hop Metric LocPrf Weight Path
*> 198.51.100.1/32 192.0.2.1 0 100 0 (65023) 65010 iR6# show ip bgp 198.51.100.1/32
Network Next Hop Metric LocPrf Weight Path
*> 198.51.100.1/32 192.0.2.21 0 65234 65010 iR3 learns within member 65023. R4 learns across a member boundary; parentheses identify an AS_CONFED_SEQUENCE, not an ordinary external AS sequence. R6 sees the confederation identifier and the original external AS, not the member numbers.
Apply Local AS
On R2, add Local AS inbound to the prefix from R1. Internal send-community is already enabled in the baseline, including R2 toward R3. Soft inbound processing requests fresh advertisements using route refresh.
R2
ip prefix-list TARGET seq 5 permit 198.51.100.1/32
route-map TAG-TARGET permit 10
match ip address prefix-list TARGET
set community local-AS additive
exit
route-map TAG-TARGET permit 20
exitrouter bgp 65023
address-family ipv4 unicast
neighbor 192.0.2.1 route-map TAG-TARGET in
exit-address-familyR2# clear ip bgp 192.0.2.1 soft inThe command keyword means NO_EXPORT_SUBCONFED. It is unrelated to the neighbor local-as command that changes the AS presented in a session.
Inspect the member boundary
R2# show ip bgp 198.51.100.1/32
BGP routing table entry for 198.51.100.1/32
Paths: (1 available, best #1, table default)
65010
192.0.2.1 from 192.0.2.1
Origin IGP, metric 0, localpref 100, valid, external, best
Community: local-ASR3# show ip bgp 198.51.100.1/32
BGP routing table entry for 198.51.100.1/32
Paths: (1 available, best #1, table default)
65010
10.255.0.2 from 10.255.0.2
Origin IGP, metric 0, localpref 100, valid, internal, best
Community: local-ASR4# show ip bgp 198.51.100.1/32
% Network not in tableR5# show ip bgp 198.51.100.1/32
% Network not in tableR6# show ip bgp 198.51.100.1/32
% Network not in tableR2 and R3 keep the prefix inside member 65023. R2 cannot export it to R4, R3 cannot export it to R5, and R3 cannot export it to external R6. R3’s internal copy must retain the tag so it enforces the same restriction.
Contrast No Export
Replace the action in the existing R2 route map, then refresh the inbound route.
route-map TAG-TARGET permit 10
set community no-export additive
exitR2# clear ip bgp 192.0.2.1 soft inR4# show ip bgp 198.51.100.1/32
BGP routing table entry for 198.51.100.1/32
Paths: (1 available, best #1, table default)
(65023) 65010
192.0.2.1 from 192.0.2.1
Origin IGP, metric 0, localpref 100, valid, confed-external, best
Community: no-exportR6# show ip bgp 198.51.100.1/32
% Network not in tableThe new set action replaces the previous action in the route-map clause. The fresh route from R1 is untagged, so it gains No Export rather than retaining Local AS. R4 and R5 now learn inside the confederation; R6 remains outside the allowed boundary.
| Tag received in member 65023 | R3: same member | R4/R5: other member | R6: outside confederation |
|---|---|---|---|
| None | Allowed | Allowed | Allowed |
| No Export | Allowed | Allowed | Blocked |
| Local AS | Allowed | Blocked | Blocked |
| No Advertise at R2 | Blocked | Blocked | Blocked |
Restore the baseline
router bgp 65023
address-family ipv4 unicast
no neighbor 192.0.2.1 route-map TAG-TARGET in
exit-address-familyR2# clear ip bgp 192.0.2.1 soft inR6# show ip bgp 198.51.100.1/32
Network Next Hop Metric LocPrf Weight Path
*> 198.51.100.1/32 192.0.2.21 0 65234 65010 iRemoving the inbound route map restores the unrestricted baseline. Preserve the explicit community transmission on internal sessions for future scope policies.
Key Takeaways
- Local AS is the command keyword for NO_EXPORT_SUBCONFED.
- The tag permits iBGP distribution inside the same confederation member.
- It blocks both another member AS and an external AS.
- No Export instead permits distribution among members of the same confederation.
- The community keyword is distinct from the neighbor local-as session command.
Protocol and command references
Standard communities · Confederation behavior · Community lists and transmission · Router-symbol attribution.