Get the App
SLTechnology News&Howtos  ›  Network Security  › 

50. Community attribute community of BGP configuration experiment

Shulou Source: shulou.com Published: 2022-06-01 07:22:02 11月16日 Update

1. Community analysis of community attributes.

BGP Community Properties community:

Can be enabled: BGP community attribute community is optional and is not recognized by default. Can be turned on by command: neighbor x.x.x.x send-community

Transitivity: BGP community attribute community is only valid for neighbors. Neighbors of neighbors are no longer valid. Neighbors who want to pass to neighbors need to configure neighbor x.x.x.x send-community.

To modify the BGP community attributes community:

Ip prefix-list 1 permit 1.1.1.0/24

Route-map COM permit 10

Match ip address prefix-list 1

Set community no-advertise does not pass to BGP neighbors

Set community no-export does not emit large AS.

Set community local-AS does not send out little AS.

Route-map COM permit 20

Router bgp 1

Neighbor 12.1.1.2 send-community

Neighbor 12.1.1.2 route-map COM out

2. Experimental topology

3. Basic configuration

R1 configuration

Interface Loopback0

Ip address 1.1.1.1 255.255.255.0

Interface Serial0/0

Ip address 12.1.1.1 255.255.255.0

Router bgp 1

No synchronization

Bgp router-id 1.1.1.1

Network 1.1.1.0 mask 255.255.255.0

Neighbor 12.1.1.2 remote-as 2

Neighbor 12.1.1.2 send-community

No auto-summary

R2 configuration

Interface Loopback0

Ip address 2.2.2.2 255.255.255.0

Interface Serial0/0

Ip address 12.1.1.2 255.255.255.0

Interface Serial0/1

Ip address 23.1.1.2 255.255.255.0

Router ospf 110

Router-id 2.2.2.2

Network 2.2.2.0 0.0.0.255 area 0

Network 23.1.1.0 0.0.0.255 area 0

Router bgp 64512

No synchronization

Bgp router-id 2.2.2.2

Bgp confederation identifier 2

Neighbor 3.3.3.3 remote-as 64512

Neighbor 3.3.3.3 update-source Loopback0

Neighbor 3.3.3.3 next-hop-self

Neighbor 12.1.1.1 remote-as 1

Neighbor 3.3.3.3 send-community

No auto-summary

R3 configuration

Interface Loopback0

Ip address 3.3.3.3 255.255.255.0

Interface Serial0/0

Ip address 34.1.1.3 255.255.255.0

Interface Serial0/1

Ip address 23.1.1.3 255.255.255.0

Router ospf 110

Router-id 3.3.3.3

Network 3.3.3.0 0.0.0.255 area 0

Network 23.1.1.0 0.0.0.255 area 0

Network 34.1.1.0 0.0.0.255 area 0

Router bgp 64512

No synchronization

Bgp router-id 3.3.3.3

Bgp confederation identifier 2

Bgp confederation peers 64513

Neighbor 2.2.2.2 remote-as 64512

Neighbor 2.2.2.2 update-source Loopback0

Neighbor 4.4.4.4 remote-as 64513

Neighbor 4.4.4.4 ebgp-multihop 255

Neighbor 4.4.4.4 update-source Loopback0

Neighbor 4.4.4.4 send-community

No auto-summary

R4 configuration

Interface Loopback0

Ip address 4.4.4.4 255.255.255.0

Interface Serial0/0

Ip address 34.1.1.4 255.255.255.0

Interface Serial0/1

Ip address 45.1.1.4 255.255.255.0

Router ospf 110

Router-id 4.4.4.4

Network 4.4.4.0 0.0.0.255 area 0

Network 34.1.1.0 0.0.0.255 area 0

Network 45.1.1.0 0.0.0.255 area 0

Router bgp 64513

No synchronization

Bgp router-id 4.4.4.4

Bgp confederation identifier 2

Bgp confederation peers 64512

Neighbor 3.3.3.3 remote-as 64512

Neighbor 3.3.3.3 ebgp-multihop 255

Neighbor 3.3.3.3 update-source Loopback0

Neighbor 5.5.5.5 remote-as 64513

Neighbor 5.5.5.5 update-source Loopback0

Neighbor 5.5.5.5 send-community

No auto-summary

R5 configuration

Interface Loopback0

Ip address 5.5.5.5 255.255.255.0

Interface Serial0/0

Ip address 56.1.1.5 255.255.255.0

Interface Serial0/1

Ip address 45.1.1.5 255.255.255.0

Router ospf 110

Router-id 5.5.5.5

Network 5.5.5.0 0.0.0.255 area 0

Network 45.1.1.0 0.0.0.255 area 0

Router bgp 64513

No synchronization

Bgp router-id 5.5.5.5

Bgp confederation identifier 2

Neighbor 4.4.4.4 remote-as 64513

Neighbor 4.4.4.4 update-source Loopback0

Neighbor 56.1.1.6 remote-as 6

Neighbor 56.1.1.6 send-community

No auto-summary

R6 configuration

Interface Loopback0

Ip address 6.6.6.6 255.255.255.0

Interface Serial0/0

Ip address 56.1.1.6 255.255.255.0

Router bgp 6

No synchronization

Bgp router-id 6.6.6.6

Neighbor 56.1.1.5 remote-as 2

No auto-summary

4. Community attribute verification

Ip prefix-list 1 seq 5 permit 1.1.1.0/24

Route-map COM permit 10

Match ip address prefix-list 1

Set community no-advertise

Route-map COM permit 20

Router bgp 1

Neighbor 12.1.1.2 send-community

Neighbor 12.1.1.2 route-map COM out

Ip prefix-list 1 seq 5 permit 1.1.1.0/24

Route-map COM permit 10

Match ip address prefix-list 1

Set community no-export

Route-map COM permit 20

Router bgp 1

Neighbor 12.1.1.2 send-community

Neighbor 12.1.1.2 route-map COM out

Ip prefix-list 1 seq 5 permit 1.1.1.0/24

Route-map COM permit 10

Match ip address prefix-list 1

Set community local-AS

Route-map COM permit 20

Router bgp 1

Neighbor 12.1.1.2 send-community

Neighbor 12.1.1.2 route-map COM out

Tags: Configuration attribute Community neighbor valid x.x.x.x Lab Command Foundation Topology step Reachability Verification Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Microsoft Apple Redmi Xiaomi