User Tools

Site Tools


tech:network:cisco:bgp:bgp:community:community

BGP: COMMUNITY

Topology

IP

Project name: ccna-bgp23-community-topology-horizontal

  • R1
enable
configure terminal
!
hostname R1
no ip domain-lookup
line console 0
exec-timeout 0 0
logging synchronous
exit
!
interface Loopback 1
ip address 1.0.0.1 255.0.0.0
no shutdown
exit
interface GigabitEthernet 0/0
ip address 100.1.2.1 255.255.255.0
no shutdown
exit
!
end
write
  • R2
enable
configure terminal
!
hostname R2
no ip domain-lookup
line console 0
exec-timeout 0 0
logging synchronous
exit
!
interface GigabitEthernet 0/0
ip address 10.2.3.2 255.255.255.0
no shutdown
exit
interface GigabitEthernet 0/1
ip address 100.1.2.2 255.255.255.0
no shutdown
exit
!
end
write
  • R3
enable
configure terminal
!
hostname R3
no ip domain-lookup
line console 0
exec-timeout 0 0
logging synchronous
exit
!
interface GigabitEthernet 0/0
ip address 100.3.4.3 255.255.255.0
no shutdown
exit
interface GigabitEthernet 0/1
ip address 10.2.3.3 255.255.255.0
no shutdown
exit
!
end
write
  • R4
enable
configure terminal
!
hostname R4
no ip domain-lookup
line console 0
exec-timeout 0 0
logging synchronous
exit
!
interface Loopback 1
ip address 3.0.0.4 255.0.0.0
no shutdown
exit
interface GigabitEthernet 0/1
ip address 100.3.4.4 255.255.255.0
no shutdown
exit
!
end
write

Basic BGP Configuration

Project name: ccna-bgp26-community-well-known

  • R1
configure terminal
!
router bgp 10
network 1.0.0.0 mask 255.0.0.0
neighbor 100.1.2.2 remote-as 20
exit
!
end
  • R2
configure terminal
!
router bgp 20
neighbor 100.1.2.1 remote-as 10
neighbor 10.2.3.3 remote-as 20
neighbor 10.2.3.3 next-hop-self
exit
!
end
  • R3
configure terminal
!
router bgp 20
neighbor 10.2.3.2 remote-as 20
neighbor 10.2.3.2 next-hop-self
neighbor 100.3.4.4 remote-as 30
exit
!
end
  • R4
configure terminal
!
router bgp 30
network 3.0.0.0 mask 255.0.0.0
neighbor 100.3.4.3 remote-as 20
exit
!
end
R1#ping 3.0.0.4 source 1.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.0.0.4, timeout is 2 seconds:
Packet sent with a source address of 1.0.0.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/5/6 ms

✔Well-known COMMUNITY Configuration

  • R1
configure terminal
!
access-list 1 permit 1.0.0.0
!
route-map R-COMMUNITY permit 10
match ip address 1
set community no-export
exit
route-map R-COMMUNITY permit 20
exit
!
router bgp 10
neighbor 100.1.2.2 send-community
neighbor 100.1.2.2 route-map R-COMMUNITY out
exit
!
end
  • R2
configure terminal
!
router bgp 20
neighbor 10.2.3.3 send-community
exit
!
end

Topology

IP

Project name: ccna-bgp24-community-topology-star

  • R1
enable
configure terminal
!
hostname R1
no ip domain-lookup
line console 0
exec-timeout 0 0
logging synchronous
exit
!
interface Loopback 1
ip address 1.1.1.1 255.255.255.0
no shutdown
exit
interface Loopback 2
ip address 1.1.2.1 255.255.255.0
no shutdown
exit
interface Loopback 3
ip address 1.1.3.1 255.255.255.0
no shutdown
exit
interface Loopback 4
ip address 1.1.4.1 255.255.255.0
no shutdown
exit
interface Loopback 5
ip address 2.1.1.1 255.255.255.0
no shutdown
exit
interface Loopback 6
ip address 2.1.2.1 255.255.255.0
no shutdown
exit
interface Loopback 7
ip address 2.1.3.1 255.255.255.0
no shutdown
exit
interface Loopback 8
ip address 2.1.4.1 255.255.255.0
no shutdown
exit
interface GigabitEthernet 0/0
ip address 100.1.2.1 255.255.255.0
no shutdown
exit
!
end
write
  • R2
enable
configure terminal
!
hostname R2
no ip domain-lookup
line console 0
exec-timeout 0 0
logging synchronous
exit
!
interface GigabitEthernet 0/0
ip address 100.1.2.2 255.255.255.0
no shutdown
exit
interface GigabitEthernet 0/1
ip address 100.2.3.2 255.255.255.0
no shutdown
exit
interface GigabitEthernet 0/2
ip address 100.2.4.2 255.255.255.0
no shutdown
exit
!
end
write
  • R3
enable
configure terminal
!
hostname R3
no ip domain-lookup
line console 0
exec-timeout 0 0
logging synchronous
exit
!
interface Loopback 1
ip address 3.3.1.3 255.255.255.0
no shutdown
exit
interface GigabitEthernet 0/0
ip address 100.2.3.3 255.255.255.0
no shutdown
exit
!
end
write
  • R4
enable
configure terminal
!
hostname R4
no ip domain-lookup
line console 0
exec-timeout 0 0
logging synchronous
exit
!
interface Loopback 1
ip address 4.4.1.4 255.255.255.0
no shutdown
exit
interface GigabitEthernet 0/0
ip address 100.2.4.4 255.255.255.0
no shutdown
exit
!
end
write

Basic BGP Configuration

Project name: ccna-bgp27-community-generic

  • R1
configure terminal
!
router bgp 100
network 1.1.1.0 mask 255.255.255.0
network 1.1.2.0 mask 255.255.255.0
network 1.1.3.0 mask 255.255.255.0
network 1.1.4.0 mask 255.255.255.0
network 2.1.1.0 mask 255.255.255.0
network 2.1.2.0 mask 255.255.255.0
network 2.1.3.0 mask 255.255.255.0
network 2.1.4.0 mask 255.255.255.0
neighbor 100.1.2.2 remote-as 200
exit
!
end
  • R2
configure terminal
!
router bgp 200
neighbor 100.1.2.1 remote-as 100
neighbor 100.2.3.3 remote-as 300
neighbor 100.2.4.4 remote-as 400
exit
!
end
  • R3
configure terminal
!
router bgp 300
network 3.3.1.0 mask 255.255.255.0
neighbor 100.2.3.2 remote-as 200
exit
!
end
  • R4
configure terminal
!
router bgp 400
network 4.4.1.0 mask 255.255.255.0
neighbor 100.2.4.2 remote-as 200
exit
!
end
ping 1.1.1.1 source 3.3.1.3
ping 1.1.2.1 source 3.3.1.3
ping 1.1.3.1 source 3.3.1.3
ping 1.1.4.1 source 3.3.1.3
ping 2.1.1.1 source 3.3.1.3
ping 2.1.2.1 source 3.3.1.3
ping 2.1.3.1 source 3.3.1.3
ping 2.1.4.1 source 3.3.1.3
ping 1.1.1.1 source 4.4.1.4
ping 1.1.2.1 source 4.4.1.4
ping 1.1.3.1 source 4.4.1.4
ping 1.1.4.1 source 4.4.1.4
ping 2.1.1.1 source 4.4.1.4
ping 2.1.2.1 source 4.4.1.4
ping 2.1.3.1 source 4.4.1.4
ping 2.1.4.1 source 4.4.1.4

✔AA:NN format COMMUNITY Configuration

  • R1
configure terminal
!
access-list 1 permit 1.1.1.0 0.0.0.255
access-list 1 permit 1.1.2.0 0.0.0.255
access-list 1 permit 1.1.3.0 0.0.0.255
access-list 1 permit 1.1.4.0 0.0.0.255
!
access-list 2 permit 2.1.1.0 0.0.0.255
access-list 2 permit 2.1.2.0 0.0.0.255
access-list 2 permit 2.1.3.0 0.0.0.255
access-list 2 permit 2.1.4.0 0.0.0.255
!
ip bgp-community new-format
!
route-map R-COMMUNITY permit 10
match ip address 1
set community 100:1
exit
route-map R-COMMUNITY permit 20
match ip address 2
set community 100:2
exit
route-map R-COMMUNITY permit 30
exit
!
router bgp 100
neighbor 100.1.2.2 send-community
neighbor 100.1.2.2 route-map R-COMMUNITY out
exit
!
end
  • R2
configure terminal
!
ip bgp-community new-format
!
ip community-list 1 permit 100:1
ip community-list 2 permit 100:2
!
route-map R-COMMUNITY-TOR3 deny 10
match community 1
exit
route-map R-COMMUNITY-TOR3 permit 20
exit
!
route-map R-COMMUNITY-TOR4 permit 10
match community 2
set as-path prepend 100
exit
route-map R-COMMUNITY-TOR4 permit 20
exit
!
router bgp 200
neighbor 100.2.3.3 route-map R-COMMUNITY-TOR3 out
neighbor 100.2.4.4 route-map R-COMMUNITY-TOR4 out
exit
!
end

References

tech/network/cisco/bgp/bgp/community/community.txt · Last modified: 2019/02/13 14:11 by wnoguchi