0% found this document useful (0 votes)
276 views20 pages

BGP Community

bgp

Uploaded by

RANJITH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
276 views20 pages

BGP Community

bgp

Uploaded by

RANJITH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

2/1/2018 BGP Community Local AS | NetworkLessons.

com

Search...

Table of Contents
BGP

 Unit 1: Introduction to BGP

 Unit 2: BGP Neighbor Adjacency

 Unit 3: BGP Attributes

 Unit 4: BGP Communities

BGP Communities

BGP Community No Advertise

BGP Community No Export

BGP Community Local AS

 Unit 5: BGP Filtering

 Unit 6: Advanced BGP Features

You are here: Home » BGP

BGP Community Local AS


a d k y v

https://networklessons.com/bgp/bgp-community-local-as/ 1/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

The local AS community is a well known BGP community and can be used for BGP confederations.
It’s basically the same as the no export community but this one works for within the sub-AS of a
confederation. Pre xes that are tagged are only advertised to other neighbors in the same sub-AS,
not to other sub-AS’es or eBGP routers.

To demonstrate this I will use the following topology:

https://networklessons.com/bgp/bgp-community-local-as/ 2/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

AS 2345 has 4 routers and 2 sub-AS’es. We will advertise a pre x from R1 to AS 2345 so you can see
what happens with and without the use of the local AS community. Let’s look at the con guration…

Configuration
BGP Configuration
Below you will nd the BGP con guration for all these routers. Within AS 2345 I have used OSPF so
that these routers can use their loopback interfaces for BGP.

R1#show running-config | section bgp


router bgp 1
no synchronization
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
neighbor 192.168.12.2 remote-as 2345
no auto-summary

https://networklessons.com/bgp/bgp-community-local-as/ 3/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

R2#show running-config | section bgp


router bgp 23
no synchronization
bgp log-neighbor-changes
bgp confederation identifier 2345
bgp confederation peers 45
neighbor 3.3.3.3 remote-as 23
neighbor 3.3.3.3 update-source Loopback0
neighbor 4.4.4.4 remote-as 45
neighbor 4.4.4.4 ebgp-multihop 2
neighbor 4.4.4.4 update-source Loopback0
neighbor 192.168.12.1 remote-as 1
no auto-summary

R3#show running-config | section bgp


router bgp 23
no synchronization
bgp log-neighbor-changes
bgp confederation identifier 2345
bgp confederation peers 45
neighbor 2.2.2.2 remote-as 23
neighbor 2.2.2.2 update-source Loopback0
neighbor 5.5.5.5 remote-as 45
neighbor 5.5.5.5 ebgp-multihop 2
neighbor 5.5.5.5 update-source Loopback0
neighbor 192.168.36.6 remote-as 6
no auto-summary

R4#show running-config | section bgp


router bgp 45
no synchronization
bgp log-neighbor-changes
bgp confederation identifier 2345
bgp confederation peers 23
neighbor 2.2.2.2 remote-as 23

https://networklessons.com/bgp/bgp-community-local-as/ 4/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

neighbor 2.2.2.2 ebgp-multihop 2


neighbor 2.2.2.2 update-source Loopback0
neighbor 5.5.5.5 remote-as 45
neighbor 5.5.5.5 update-source Loopback0
no auto-summary

R5#show running-config | section bgp


router bgp 45
no synchronization
bgp log-neighbor-changes
bgp confederation identifier 2345
bgp confederation peers 23
neighbor 3.3.3.3 remote-as 23
neighbor 3.3.3.3 ebgp-multihop 2
neighbor 3.3.3.3 update-source Loopback0
neighbor 4.4.4.4 remote-as 45
neighbor 4.4.4.4 update-source Loopback0
no auto-summary

R6#show running-config | section bgp


router bgp 6
no synchronization
bgp log-neighbor-changes
neighbor 192.168.36.3 remote-as 2345
no auto-summary

R1 has advertised pre x 1.1.1.1/32 in BGP, let’s see if our routers have learned this:

R2#show ip bgp | begin 1.1.1.1


*> 1.1.1.1/32 192.168.12.1 0 0 1 i

R3#show ip bgp | begin 1.1.1.1


*>i1.1.1.1/32 192.168.12.1 0 100 0 1 i

https://networklessons.com/bgp/bgp-community-local-as/ 5/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

R4#show ip bgp | begin 1.1.1.1


* i1.1.1.1/32 192.168.12.1 0 100 0 (23) 1 i
*> 192.168.12.1 0 100 0 (23) 1 i

R5#show ip bgp | begin 1.1.1.1


* i1.1.1.1/32 192.168.12.1 0 100 0 (23) 1 i
*> 192.168.12.1 0 100 0 (23) 1 i

R6#show ip bgp | begin 1.1.1.1


*> 1.1.1.1/32 192.168.36.3 0 2345 1 i

All router know about this pre x. Time to activate the local AS community…

Local AS Community Configuration


We will create a route-map on R2  that sets the local AS community on all pre xes that it receives
from R1:

R2(config)#route-map LOCAL_AS permit 10


R2(config-route-map)#set community local-AS

R2(config)#router bgp 23
R2(config-router)#neighbor 192.168.12.1 route-map LOCAL_AS in
R2(config-router)#neighbor 3.3.3.3 send-community

R2 sets the community so make sure that it advertises it to R3. Before we reset BGP, take a look at
the BGP table of R2:

R2#show ip bgp 1.1.1.1


BGP routing table entry for 1.1.1.1/32, version 2
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
2 3
1

https://networklessons.com/bgp/bgp-community-local-as/ 6/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

192.168.12.1 from 192.168.12.1 (192.168.12.1)


Origin IGP, metric 0, localpref 100, valid, external, best

Above you can see the output without any communities. Let’s reset BGP now:

R2#clear ip bgp *

Here’s what it looks like now:

R2#show ip bgp 1.1.1.1


BGP routing table entry for 1.1.1.1/32, version 2
Paths: (1 available, best #1, table Default-IP-Routing-Table, not
advertised outside local AS)
Flag: 0x820
Advertised to update-groups:
3
1
192.168.12.1 from 192.168.12.1 (192.168.12.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: local-AS

Above you can see that this pre x has the local AS community. It will not be advertised outside of
our sub-AS. So which of our routers still has it?

R3#show ip bgp | begin 1.1.1.1


*>i1.1.1.1/32 192.168.12.1 0 100 0 1 i

R4#show ip bgp 1.1.1.1


% Network not in table

R5#show ip bgp 1.1.1.1


% Network not in table

https://networklessons.com/bgp/bgp-community-local-as/ 7/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

R6#show ip bgp 1.1.1.1


% Network not in table

Only R3 has the pre x now since it’s in the same sub-AS as R2. Another good method to verify this is
by using checking what pre xes are advertised by R2 and R3:

R2#show ip bgp neighbors 3.3.3.3 advertised-routes


BGP table version is 2, 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
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path


*> 1.1.1.1/32 192.168.12.1 0 0 1 i

Total number of prefixes 1

Above you can see that R2 advertises 1.1.1.1/32 to R3, it doesn’t advertise it to R4 anymore:

R2#show ip bgp neighbors 4.4.4.4 advertised-routes

Total number of prefixes 0

We can also check this on R3:

R3#show ip bgp 1.1.1.1


BGP routing table entry for 1.1.1.1/32, version 2
Paths: (1 available, best #1, table Default-IP-Routing-Table, not
advertised outside local AS)
Flag: 0x820
Not advertised to any peer
1
192.168.12.1 (metric 20) from 2.2.2.2 (2.2.2.2)

https://networklessons.com/bgp/bgp-community-local-as/ 8/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

Origin IGP, metric 0, localpref 100, valid, confed-internal, best


Community: local-AS

R3 sees the local AS community so it doesn’t advertise this pre x to R5 or R6:

R3#show ip bgp neighbors 5.5.5.5 advertised-routes

Total number of prefixes 0

R3#show ip bgp neighbors 192.168.36.6 advertised-routes

Total number of prefixes 0

That’s all there is to it. Make sure you also check the other well known BGP communities:

No-Advertise
No-Export

Configurations
Want to take a look for yourself? Here you will nd the con guration of each device.

R1
hostname R1
!
ip cef
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
!
router bgp 1
bgp log-neighbor-changes

https://networklessons.com/bgp/bgp-community-local-as/ 9/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

network 1.1.1.1 mask 255.255.255.255


neighbor 192.168.12.2 remote-as 2345
!
end

R2
hostname R2
!
ip cef
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.12.2 255.255.255.0
!
interface FastEthernet0/1
ip address 192.168.23.2 255.255.255.0
!
interface FastEthernet1/0
ip address 192.168.24.2 255.255.255.0
!
router bgp 23
bgp log-neighbor-changes
bgp confederation identifier 2345
bgp confederation peers 45
neighbor 3.3.3.3 remote-as 23
neighbor 3.3.3.3 update-source Loopback0
neighbor 4.4.4.4 remote-as 45
neighbor 4.4.4.4 ebgp-multihop 2
neighbor 4.4.4.4 update-source Loopback0
neighbor 192.168.12.1 remote-as 1
neighbor 192.168.12.1 remote-as 1
neighbor 192.168.12.1 route-map LOCAL_AS in
!
route-map LOCAL_AS permit 10

https://networklessons.com/bgp/bgp-community-local-as/ 10/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

set community local-AS


!
end

R3
hostname R3
!
ip cef
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.36.3 255.255.255.0
!
interface FastEthernet0/1
ip address 192.168.23.3 255.255.255.0
!
interface FastEthernet1/0
ip address 192.168.35.3 255.255.255.0
!
router bgp 23
bgp log-neighbor-changes
bgp confederation identifier 2345
bgp confederation peers 45
neighbor 2.2.2.2 remote-as 23
neighbor 2.2.2.2 update-source Loopback0
neighbor 5.5.5.5 remote-as 45
neighbor 5.5.5.5 ebgp-multihop 2
neighbor 5.5.5.5 update-source Loopback0
neighbor 192.168.36.6 remote-as 6
!
end

R4
https://networklessons.com/bgp/bgp-community-local-as/ 11/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

hostname R4
!
ip cef
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.24.4 255.255.255.0
!
interface FastEthernet0/1
ip address 192.168.45.4 255.255.255.0
!
router bgp 45
bgp log-neighbor-changes
bgp confederation identifier 2345
bgp confederation peers 23
neighbor 2.2.2.2 remote-as 23
neighbor 2.2.2.2 ebgp-multihop 2
neighbor 2.2.2.2 update-source Loopback0
neighbor 5.5.5.5 remote-as 45
neighbor 5.5.5.5 update-source Loopback0
!
end

R5
hostname R5
!
ip cef
!
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.35.5 255.255.255.0

https://networklessons.com/bgp/bgp-community-local-as/ 12/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

!
interface FastEthernet0/1
ip address 192.168.45.5 255.255.255.0
!
router bgp 45
bgp log-neighbor-changes
bgp confederation identifier 2345
bgp confederation peers 23
neighbor 3.3.3.3 remote-as 23
neighbor 3.3.3.3 ebgp-multihop 2
neighbor 3.3.3.3 update-source Loopback0
neighbor 4.4.4.4 remote-as 45
neighbor 4.4.4.4 update-source Loopback0
!
end

R6
hostname R6
!
ip cef
!
interface Loopback0
ip address 6.6.6.6 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.36.2 255.255.255.0
!
router bgp 6
bgp log-neighbor-changes
neighbor 192.168.36.3 remote-as 2345
!
end

I hope this example has been useful, if you have any questions feel free to leave a comment!
https://networklessons.com/bgp/bgp-community-local-as/ 13/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

« Previous Lesson
BGP Community No Export
Next Lesson
BGP Regular Expressions »
 Tags: Communities

Forum Replies

marioramales
September 20, 2015

Quick question Rene on this topic. The lab works ne as I followed along with my own topology. But I am just
wondering why R2 should send the community only to R3? For example, you mentioned: “R2 sets the
community so make sure that it advertises it to R3”… why should it not send the community to R4 as well. I
know R4 is in another AS, but R4 would have ltered it out as well, wouldn’t it?

ReneMolenaar
September 24, 2015

Hi Mario,

On R2 I con gured the route-map inbound (facing R1) so that R2 sets the local AS community. Because of this,
R2 will no longer advertise pre xes to R4 since it’s another sub-AS. R3 will still receive it since it’s in the same
sub-AS as R2.

To make sure R5 (and R4) learn anything through R3, we need to advertise the local AS community to R3.

Rene

champlsp
July 11, 2016

Hi,

I am confused about BGP selecting path.Here topology

https://networklessons.com/bgp/bgp-community-local-as/ 14/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

2r7n9t3.jpg811x569
R5 is in sub-AS 45.And advertise pre x 9.9.9.9/32.

R5#sh ip bgp
BGP table version is 14, 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
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path


*> 9.9.9.9/32 0.0.0.0 0 32768 i
*> 192.168.12.0 2.2.2.2 0 100 0 (23) i
* i 2.2.2.2 0 100 0 (23) i

R4 is in sub-AS 45 same R5 and it learn pre x 9.9.9.9/32 from R5.

R4#sh ip bg
BGP table version is 15, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal,

https://networklessons.com/bgp/bgp-community-local-as/ 15/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path


*>i9.9.9.9/32 5.5.5.5 0 100 0 i
* i192.168.12.0 2.2.2.2 0 100 0 (23) i
*> 2.2.2.2 0 100 0 (23) i
R4#sh ip bgp 9.9.9.9/32
BGP routing table entry for 9.9.9.9/32, version 10
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
2
Local
5.5.5.5 (metric 11) from 5.5.5.5 (5.5.5.5)
Origin IGP, metric 0, localpref 100, valid, confed-internal, best

R2 is in sub-AS 23 and it learn pre x 9.9.9.9/32 from R4.

R2#sh ip bgp
BGP table version is 4, 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
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path


*> 9.9.9.9/32 5.5.5.5 0 100 0 (45) i
*> 192.168.12.0 0.0.0.0 0 32768 i
R2#
R2#sh ip bgp 9.9.9.9/32
BGP routing table entry for 9.9.9.9/32, version 4
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
1 3
(45)
5.5.5.5 (metric 21) from 4.4.4.4 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, confed-external, best

R3 is in sub-AS 23 and it learn pre x 9.9.9.9/32 from both R2 and R5.

R3#sh ip bgp
BGP table version is 3, local router ID is 3.3.3.3

https://networklessons.com/bgp/bgp-community-local-as/ 16/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

Status codes: s suppressed, d damped, h history, * valid, > best, i -


internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path


* 9.9.9.9/32 5.5.5.5 0 100 0 (45) i
*>i 5.5.5.5 0 100 0 (45) i
*>i192.168.12.0 2.2.2.2 0 100 0 i
R3#
R3#
R3#sh ip bgp 9.9.9.9/32
BGP routing table entry for 9.9.9.9/32, version 2
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
2
(45)
5.5.5.5 (metric 11) from 5.5.5.5 (5.5.5.5)
Origin IGP, metric 0, localpref 100, valid, confed-external
(45)
5.5.5.5 (metric 11) from 2.2.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, valid, confed-internal, best

The question is, Why R3 select confed-internal(2.2.2.2) instead confed-external(5.5.5.5)?

Thank you in advance.

ReneMolenaar
July 18, 2016

Hi Ler Sak,

BGP doesn’t di erentiate between confed-internal or confed-external. When the two paths are the same, it’s
up to the router ID to decide which one will be selected.

Here’s an example from the topology I used in this lesson:

R4#show ip bgp 55.55.55.55/32


BGP routing table entry for 55.55.55.55/32, version 5
Paths: (2 available, best #1, table default)
Flag: 0x800
Not advertised to any peer

https://networklessons.com/bgp/bgp-community-local-as/ 17/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

Refresh Epoch 1
(35)
5.5.5.5 (metric 2) from 2.2.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, valid, confed-internal, best
rx pathid: 0, tx pathid: 0x0
Refresh Epoch 1
(35)
5.5.5.5 (metric 2) from 5.5.5.5 (55.55.55.55)
Origin IGP, metric 0, localpref 100, valid, confed-external
rx pathid: 0, tx pathid: 0

Above you can see the path from 2.2.2.2 has been selected. Let’s change the router ID on R2:

R2(config)#router bgp 24
R2(config-router)#bgp router-id 222.222.222.222

Now it prefers R5:

R4#show ip bgp 55.55.55.55/32


BGP routing table entry for 55.55.55.55/32, version 13
Paths: (2 available, best #2, table default)
Flag: 0x800
Advertised to update-groups: (Pending Update Generation)
2 4
Refresh Epoch 1
(35)
5.5.5.5 (metric 2) from 2.2.2.2 (222.222.222.222)
Origin IGP, metric 0, localpref 100, valid, confed-internal
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
(35)
5.5.5.5 (metric 2) from 5.5.5.5 (55.55.55.55)
Origin IGP, metric 0, localpref 100, valid, confed-external, best
rx pathid: 0, tx pathid: 0x0

Hope this helps!

Rene

champlsp
July 18, 2016

https://networklessons.com/bgp/bgp-community-local-as/ 18/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

Hi Rene,

Thank you so much.

 3 more replies! Ask a question or join the discussion by visiting our Community Forum

About NetworkLessons.com
Hello There! I'm René Molenaar (CCIE #41726), Your main Instructor of
NetworkLessons.com. I'd like to teach you everything about Cisco, Wireless and
Security. I am here to Help You Master Networking!

Read my story

Social Fans

 
14,326 9,712
FANS FOLLOWERS


237
FOLLOWERS

New Lessons
Multicast PIM Sparse-Dense Mode
Multicast PIM Snooping
Multicast MSDP SA (Source Active) Filtering
Multicast Boundary Filtering

https://networklessons.com/bgp/bgp-community-local-as/ 19/20
2/1/2018 BGP Community Local AS | NetworkLessons.com

L2TPv3 (Layer 2 Tunnel Protocol Version 3)

Tag Cloud
802.1Q ACL ARP DMVPN Filtering Firewall
Authentication Certi cate Default Route DHCP

GRE IGMP IKE IOS IP Routing IPSec LDP Linux Load Balancing LSA NAT
Network Management Network Services Network Type OER OSPFv3 PAT PE-CE PFR PIM
PPP Redistribution Security Shaping SNMP SSH Stub Summarization Trunk Tuning
Tunnel VLAN VPN VRF Wireless

Disclaimer
Privacy Policy
Support

© 2013 - 2018 NetworkLessons.com 14255

https://networklessons.com/bgp/bgp-community-local-as/ 20/20

You might also like