PacketLab
BGP · Communities

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.

Confederation boundariesPhysical links
Confederation 65234Member AS 65023Member AS 65045.1 / .2.5 / .6.9 / .10.13 / .14.17 / .18.21 / .22R1AS 65010R2Lo0 10.255.0.2R3Lo0 10.255.0.3R4Lo0 10.255.0.4R5Lo0 10.255.0.5R6AS 65060
All link addresses are 192.0.2.x/30; labels identify each endpoint. Internal BGP sessions use loopbacks over OSPF. R2–R3 and R4–R5 are iBGP; R2–R4 and R3–R5 are confederation eBGP.
Physical linkFirst endpointSecond endpoint
R1–R2GigabitEthernet1 192.0.2.1/30GigabitEthernet1 192.0.2.2/30
R2–R3GigabitEthernet2 192.0.2.5/30GigabitEthernet1 192.0.2.6/30
R2–R4GigabitEthernet3 192.0.2.9/30GigabitEthernet1 192.0.2.10/30
R3–R5GigabitEthernet2 192.0.2.13/30GigabitEthernet1 192.0.2.14/30
R4–R5GigabitEthernet2 192.0.2.17/30GigabitEthernet2 192.0.2.18/30
R3–R6GigabitEthernet3 192.0.2.21/30GigabitEthernet1 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
end

R2

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
end

R3

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
end

R4

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
end

R5

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
end

R6

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
end
Outputs are illustrative, not recorded router results. Start this lab from its baseline, independently of the preceding four-router labs.

OSPF 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 i
R4# 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 i
R6# 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 i

R3 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
exit
router bgp 65023
 address-family ipv4 unicast
  neighbor 192.0.2.1 route-map TAG-TARGET in
 exit-address-family
R2# clear ip bgp 192.0.2.1 soft in

The 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-AS
R3# 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-AS
R4# show ip bgp 198.51.100.1/32
% Network not in table
R5# show ip bgp 198.51.100.1/32
% Network not in table
R6# show ip bgp 198.51.100.1/32
% Network not in table

R2 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
exit
R2# clear ip bgp 192.0.2.1 soft in
R4# 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-export
R6# show ip bgp 198.51.100.1/32
% Network not in table

The 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 65023R3: same memberR4/R5: other memberR6: outside confederation
NoneAllowedAllowedAllowed
No ExportAllowedAllowedBlocked
Local ASAllowedBlockedBlocked
No Advertise at R2BlockedBlockedBlocked

Restore the baseline

router bgp 65023
 address-family ipv4 unicast
  no neighbor 192.0.2.1 route-map TAG-TARGET in
 exit-address-family
R2# clear ip bgp 192.0.2.1 soft in
R6# 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 i

Removing 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.

Local AS Quiz

Six questions · four options each · select one answer per question. Submit all answers to see your score and explanations.

1. Which RFC community corresponds to the local-AS keyword?
2. R2 tags the route Local AS. Which router still learns it in this lab?
3. Why does R4 lose the route?
4. Replacing Local AS with No Export allows which additional routers?
5. Which AS does R6 see for the transit confederation in the baseline?
6. Does set community local-AS change the AS presented during session setup?
Protocol and command references

Standard communities · Confederation behavior · Community lists and transmission · Router-symbol attribution.