Tuesday, 18 April 2017

Additive community configuration example - BGP



R1:-

interface Loopback0
 ip address 1.1.1.1 255.255.255.255

interface FastEthernet2/0
Description “ Connected to R2”
 ip address 12.12.12.1 255.255.255.0
 no shut

router bgp 1
 no synchronization
 bgp log-neighbor-changes
 network 1.1.1.1 mask 255.255.255.255
 neighbor 12.12.12.2 remote-as 2
 neighbor 12.12.12.2 send-community both
 neighbor 12.12.12.2 route-map setCommunity out  \\Setting community value to all R1 Routes\\
 no auto-summary

route-map setCommunity permit 10 
 set community 1:1 11:11 111:111   --<<<Community will attach to routes

ip bgp-community new-format

R2:-

interface Loopback0
 ip address 2.2.2.2 255.255.255.255

interface FastEthernet0/0
Description “ Connected to R3”
 ip address 23.23.23.2 255.255.255.0
no shut

interface FastEthernet1/0
Description “ Connected to R5”
 ip address 25.25.25.2 255.255.255.0
no shut

interface FastEthernet2/0
Description “ Connected to R1”
 ip address 12.12.12.2 255.255.255.0
no shut

router eigrp 2
 network 23.23.23.2 0.0.0.0

router bgp 2
 no synchronization
 bgp log-neighbor-changes
 network 2.2.2.2 mask 255.255.255.255
 neighbor 12.12.12.1 remote-as 1
 neighbor 12.12.12.1 route-map set_metric in   \\Add 2:2 community to existing list \\
 neighbor 23.23.23.3 remote-as 2
 neighbor 23.23.23.3 next-hop-self
 neighbor 23.23.23.3 send-community both
 neighbor 25.25.25.5 remote-as 3
neighbor 25.25.25.5 send-community both
 no auto-summary

ip bgp-community new-format

ip community-list standard set_metric_list permit 1:1 \\ Can match any or all community \\

route-map set_metric permit 10
R2(config)#ip community-list ?    \\ cannot match community directly, need to create list\\
  <1-99>     Community list number (standard)
  <100-500>  Community list number (expanded)
  expanded   Add an expanded community-list entry
  standard   Add a standard community-list entry

 match community set_metric_list
set community 2:2 additive   \\ Add 2:2 to the community set by R1 \\
 set metric 500                   \\ Optional \\

R3:-

interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
 Description “ Connected to R2”
 ip address 23.23.23.3 255.255.255.0
no shut

interface FastEthernet0/1
 Description “ Connected to R4”
 ip address 34.34.34.3 255.255.255.0
no shut

interface FastEthernet1/0
 Description “ Connected to R5”
 ip address 25.25.25.2 255.255.255.0
 no shut

interface FastEthernet2/0
 description "Connected to R1"
 ip address 12.12.12.2 255.255.255.0
no shut

router eigrp 2
 network 23.23.23.3 0.0.0.0
 network 34.34.34.3 0.0.0.0

router bgp 2
 no synchronization
 bgp log-neighbor-changes
 network 3.3.3.3 mask 255.255.255.255
 neighbor 23.23.23.2 remote-as 2
 neighbor 23.23.23.2 route-reflector-client
 neighbor 34.34.34.4 remote-as 2
 neighbor 34.34.34.4 route-reflector-client
 neighbor 34.34.34.4 send-community both
 no auto-summary

ip bgp-community new-format

R4:-

interface Loopback0
 ip address 4.4.4.4 255.255.255.255

interface FastEthernet0/1
Description “ Connected to R3”
 ip address 34.34.34.4 255.255.255.0
no shut

router eigrp 2
 network 34.34.34.4 0.0.0.0

router bgp 2
 no synchronization
 bgp log-neighbor-changes
 network 4.4.4.4 mask 255.255.255.255
 neighbor 34.34.34.3 remote-as 2
 no auto-summary

ip bgp-community new-format

R5:-

interface Loopback0
 ip address 5.5.5.5 255.255.255.255


interface FastEthernet1/0
 ip address 25.25.25.5 255.255.255.0
 speed auto
 duplex auto

router bgp 3
 no synchronization
 bgp log-neighbor-changes
 network 5.5.5.5 mask 255.255.255.255
 neighbor 25.25.25.2 remote-as 2
 no auto-summary

ip bgp-community new-format

Verification:-

R1#        sh ip bgp summary
BGP router identifier 1.1.1.1, local AS number 1
BGP table version is 15, main routing table version 15
5 network entries using 640 bytes of memory
5 path entries using 260 bytes of memory
4/4 BGP path/bestpath attribute entries using 496 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1444 total bytes of memory
BGP activity 6/1 prefixes, 9/4 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.12.12.2      4            2     105     102       15    0    0 01:27:17        4   \\R2 neighborship\\

R1#sh ip bgp
BGP table version is 15, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, x best-external
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       0.0.0.0                  0         32768 i
*> 2.2.2.2/32       12.12.12.2               0             0 2 i
*> 3.3.3.3/32       12.12.12.2                             0 2 i
*> 4.4.4.4/32       12.12.12.2                             0 2 i
*> 5.5.5.5/32       12.12.12.2                             0 2 3 i

R1#sh ip bgp 1.1.1.1/32
BGP routing table entry for 1.1.1.1/32, version 3
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     2
  Local
    0.0.0.0 from 0.0.0.0 (1.1.1.1)
      Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local, best

R1#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
C        1.1.1.1 is directly connected, Loopback0
      2.0.0.0/32 is subnetted, 1 subnets
B        2.2.2.2 [20/0] via 12.12.12.2, 01:26:54
      3.0.0.0/32 is subnetted, 1 subnets
B        3.3.3.3 [20/0] via 12.12.12.2, 01:27:25
      4.0.0.0/32 is subnetted, 1 subnets
B        4.4.4.4 [20/0] via 12.12.12.2, 01:27:25
      5.0.0.0/32 is subnetted, 1 subnets
B        5.5.5.5 [20/0] via 12.12.12.2, 01:27:25
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.12.12.0/24 is directly connected, FastEthernet2/0
L        12.12.12.1/32 is directly connected, FastEthernet2/0
R1#

R2:-

R2#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
B        1.1.1.1 [20/500] via 12.12.12.1, 01:27:20
      2.0.0.0/32 is subnetted, 1 subnets
C        2.2.2.2 is directly connected, Loopback0
      3.0.0.0/32 is subnetted, 1 subnets
B        3.3.3.3 [200/0] via 23.23.23.3, 01:29:33
      4.0.0.0/32 is subnetted, 1 subnets
B        4.4.4.4 [200/0] via 34.34.34.4, 01:29:33
      5.0.0.0/32 is subnetted, 1 subnets
B        5.5.5.5 [20/0] via 25.25.25.5, 01:29:33
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.12.12.0/24 is directly connected, FastEthernet2/0
L        12.12.12.2/32 is directly connected, FastEthernet2/0
      23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        23.23.23.0/24 is directly connected, FastEthernet0/0
L        23.23.23.2/32 is directly connected, FastEthernet0/0
      25.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        25.25.25.0/24 is directly connected, FastEthernet1/0
L        25.25.25.2/32 is directly connected, FastEthernet1/0
      34.0.0.0/24 is subnetted, 1 subnets
D        34.34.34.0 [90/30720] via 23.23.23.3, 04:12:43, FastEthernet0/0

R2#sh ip bgp summary
BGP router identifier 2.2.2.2, local AS number 2
BGP table version is 7, main routing table version 7
5 network entries using 640 bytes of memory
5 path entries using 260 bytes of memory
5/4 BGP path/bestpath attribute entries using 620 bytes of memory
1 BGP rrinfo entries using 24 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
1 BGP community entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1616 total bytes of memory
BGP activity 10/5 prefixes, 10/5 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.12.12.1      4            1     105     107        7    0    0 01:29:37        1
23.23.23.3      4            2     105     108        7    0    0 01:29:37        2
25.25.25.5      4            3     104     106        7    0    0 01:29:37        1

R2#sh ip bgp
BGP table version is 7, 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, m multipath, b backup-path, x best-external
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       12.12.12.1             500             0 1 i
*> 2.2.2.2/32       0.0.0.0                  0         32768 i
*>i3.3.3.3/32       23.23.23.3               0    100      0 i
*>i4.4.4.4/32       34.34.34.4               0    100      0 i
*> 5.5.5.5/32       25.25.25.5               0             0 3 i

R2# sh ip bgp 1.1.1.1/32
BGP routing table entry for 1.1.1.1/32, version 8
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     5          6
  1
    12.12.12.1 from 12.12.12.1 (1.1.1.1)
      Origin IGP, metric 500, localpref 100, valid, external, best
      Community: 1:1 2:2 11:11 111:111                       \\ R2 Community + Community set on R1 \\

R3:-

R3#          sh ip bgp
BGP table version is 13, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, x best-external
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i1.1.1.1/32       23.23.23.2             500    100      0 1 i
*>i2.2.2.2/32       23.23.23.2               0    100      0 i
*> 3.3.3.3/32       0.0.0.0                  0         32768 i
*>i4.4.4.4/32       34.34.34.4               0    100      0 i
*>i5.5.5.5/32       23.23.23.2               0    100      0 3 i

R3# sh ip bgp summ
BGP router identifier 3.3.3.3, local AS number 2
BGP table version is 13, main routing table version 13
5 network entries using 640 bytes of memory
5 path entries using 260 bytes of memory
4/4 BGP path/bestpath attribute entries using 496 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
1 BGP community entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1468 total bytes of memory
BGP activity 6/1 prefixes, 8/3 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
23.23.23.2      4            2     110     107       13    0    0 01:31:28        3
34.34.34.4      4            2     283     289       13    0    0 04:13:45        1

R3#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
B        1.1.1.1 [200/500] via 23.23.23.2, 01:29:17
      2.0.0.0/32 is subnetted, 1 subnets
B        2.2.2.2 [200/0] via 23.23.23.2, 01:31:25
      3.0.0.0/32 is subnetted, 1 subnets
C        3.3.3.3 is directly connected, Loopback0
      4.0.0.0/32 is subnetted, 1 subnets
B        4.4.4.4 [200/0] via 34.34.34.4, 04:12:52
      5.0.0.0/32 is subnetted, 1 subnets
B        5.5.5.5 [200/0] via 23.23.23.2, 01:31:30
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.12.12.0/24 is directly connected, FastEthernet2/0
L        12.12.12.2/32 is directly connected, FastEthernet2/0
      23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        23.23.23.0/24 is directly connected, FastEthernet0/0
L        23.23.23.3/32 is directly connected, FastEthernet0/0
      25.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        25.25.25.0/24 is directly connected, FastEthernet1/0
L        25.25.25.2/32 is directly connected, FastEthernet1/0
      34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        34.34.34.0/24 is directly connected, FastEthernet0/1
L        34.34.34.3/32 is directly connected, FastEthernet0/1

R3#sh 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)
  Advertised to update-groups:
     4
  1, (Received from a RR-client)
    23.23.23.2 from 23.23.23.2 (2.2.2.2)
      Origin IGP, metric 500, localpref 100, valid, internal, best
      Community: 1:1 2:2 11:11 111:111  \\ R2 Community i.e. 2:2 + Community set on R1 \\

R4:-

R4#      sh ip bgp summary
BGP router identifier 4.4.4.4, local AS number 2
BGP table version is 13, main routing table version 13
5 network entries using 640 bytes of memory
5 path entries using 260 bytes of memory
4/4 BGP path/bestpath attribute entries using 496 bytes of memory
1 BGP rrinfo entries using 24 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
1 BGP community entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1492 total bytes of memory
BGP activity 6/1 prefixes, 8/3 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
34.34.34.3      4            2     290     284       13    0    0 04:14:07        4


R4#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
B        1.1.1.1 [200/500] via 23.23.23.2, 01:30:38
      2.0.0.0/32 is subnetted, 1 subnets
B        2.2.2.2 [200/0] via 23.23.23.2, 01:32:46
      3.0.0.0/32 is subnetted, 1 subnets
B        3.3.3.3 [200/0] via 34.34.34.3, 04:13:14
      4.0.0.0/32 is subnetted, 1 subnets
C        4.4.4.4 is directly connected, Loopback0
      5.0.0.0/32 is subnetted, 1 subnets
B        5.5.5.5 [200/0] via 23.23.23.2, 01:32:51
      23.0.0.0/24 is subnetted, 1 subnets
D        23.23.23.0 [90/30720] via 34.34.34.3, 04:14:15, FastEthernet0/1
      34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        34.34.34.0/24 is directly connected, FastEthernet0/1
L        34.34.34.4/32 is directly connected, FastEthernet0/1
      45.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        45.45.45.0/24 is directly connected, FastEthernet2/0
L        45.45.45.4/32 is directly connected, FastEthernet2/0

R4#sh ip bgp
BGP table version is 13, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, x best-external
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i1.1.1.1/32       23.23.23.2             500    100      0 1 i
*>i2.2.2.2/32       23.23.23.2               0    100      0 i
*>i3.3.3.3/32       34.34.34.3               0    100      0 i
*> 4.4.4.4/32       0.0.0.0                  0         32768 i
*>i5.5.5.5/32       23.23.23.2               0    100      0 3 i

R4#sh ip bgp 1.1.1.1/32
BGP routing table entry for 1.1.1.1/32, version 19
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  1
    23.23.23.2 (metric 30720) from 34.34.34.3 (3.3.3.3)
      Origin IGP, metric 500, localpref 100, valid, internal, best
      Community: 1:1 2:2 11:11 111:111
      Originator: 2.2.2.2, Cluster list: 3.3.3.3      \\ R2 Community + Community set on R1 \\

R5:-

R5# sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
B        1.1.1.1 [20/0] via 25.25.25.2, 01:34:00
      2.0.0.0/32 is subnetted, 1 subnets
B        2.2.2.2 [20/0] via 25.25.25.2, 01:33:29
      3.0.0.0/32 is subnetted, 1 subnets
B        3.3.3.3 [20/0] via 25.25.25.2, 01:34:00
      4.0.0.0/32 is subnetted, 1 subnets
B        4.4.4.4 [20/0] via 25.25.25.2, 01:34:00
      5.0.0.0/32 is subnetted, 1 subnets
C        5.5.5.5 is directly connected, Loopback0
      25.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        25.25.25.0/24 is directly connected, FastEthernet1/0
L        25.25.25.5/32 is directly connected, FastEthernet1/0

R5# sh ip bgp summary
BGP router identifier 5.5.5.5, local AS number 3
BGP table version is 14, main routing table version 14
5 network entries using 640 bytes of memory
5 path entries using 260 bytes of memory
4/4 BGP path/bestpath attribute entries using 496 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1444 total bytes of memory
BGP activity 6/1 prefixes, 9/4 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
25.25.25.2      4            2     111     109       14    0    0 01:34:04        4

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, m multipath, b backup-path, x best-external
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       25.25.25.2                             0 2 1 i
*> 2.2.2.2/32       25.25.25.2               0             0 2 i
*> 3.3.3.3/32       25.25.25.2                             0 2 i
*> 4.4.4.4/32       25.25.25.2                             0 2 i
*> 5.5.5.5/32       0.0.0.0                  0         32768 i

R5#sh ip bgp 1.1.1.1/32
BGP routing table entry for 1.1.1.1/32, version 16
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  2 1
    25.25.25.2 from 25.25.25.2 (2.2.2.2)
      Origin IGP, localpref 100, valid, external, best
      Community: 1:1 2:2 11:11 111:111                       \\ R2 Community + Community set on R1 \\


No comments:

Post a Comment