Saturday, 26 January 2019

BGP Communities_No-advertise configuration


BGP Communities

The community attribute is a transitive optional attribute. Communities can be used to mark a set of prefixes that share a common property. Any BGP router can tag routes in incoming and outgoing routing updates or when doing redistribution.By default, communities are stripped in outgoing bgp update.

BGP community types:-

Well known (pre-defined
Own communities

Well known communities (predefined)

  • Internet: advertise this route to the internet community, any route belong to this community
  • No-export: do not advertise to EBGP peers; keep this route an AS only.
  • No-advertise: do not advertise this route to any peer, internal or external.
  • Local-AS: use in confederation scenarios, prevent the transmit of packet outside the local sub AS.








Lets see the configuration for better understanding:-

Topology:

Goal:-

  • configure the topology as per the diagram and assign the IP addresses.
  • configure routers in their respective ASs, 
  • configure iBGP and EBGP configuration.
  • advertise all in the interfaces in BGP
  • configure No-advertise on router 5. make sure 15.0.0.1/25 network router 1 do not advertise to any iBGP and EBGP neighbor.



R1#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        10.1.1.1        YES manual up                    up
Serial3/0                    1.1.1.1         YES manual up                    up
Serial3/3                    4.1.1.2         YES manual up                    up
Loopback0               11.0.0.1        YES manual up                    up


R2#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        20.1.1.1        YES manual up                    up
Serial3/0                     1.1.1.2         YES manual up                    up
Serial3/1                     2.1.1.1         YES manual up                    up
Loopback0               12.0.0.1        YES manual up                    up

R3#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        30.1.1.1        YES manual up                    up
Serial3/1                    2.1.1.2         YES manual up                    up
Serial3/2                    3.1.1.1         YES manual up                    up
Loopback0               13.0.0.1        YES manual up                    up



R4#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        40.1.1.1        YES manual up                    up
Serial3/2                    3.1.1.2         YES manual up                    up
Serial3/3                    4.1.1.1         YES manual up                    up
Loopback0               14.0.0.1        YES manual up                    up


R5#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        10.1.1.2        YES manual up                    up
Loopback0               15.0.0.1        YES manual up                    up


R6#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        30.1.1.2        YES manual up                    up
Loopback0              16.0.0.1        YES manual up                    up



R1(config)#router bgp 650123
R1(config-router)#neighbor 1.1.1.2 remote-as 650123
R1(config-router)#neighbor 10.1.1.2 remote-as 650005
R1(config-router)#neighbor 4.1.1.1 remote-as 650004
R1(config-router)#neighbor 2.1.1.2 remote-as 650123

R1(config-router)#neighbor 2.1.1.2 next-hop-self
R1(config-router)#neighbor 1.1.1.2 next-hop-self

R1(config-router)#network 10.0.0.0
R1(config-router)#network 1.0.0.0
R1(config-router)#network 4.0.0.0
R1(config-router)#network 11.0.0.0 mask 255.255.255.0
R1(config-router)#no auto-summary
R1(config-router)#no synchronization
R1(config-router)#exit


R2(config)#router bgp 650123
R2(config-router)#neighbor 1.1.1.1 remote-as 650123

*Jan 26 13:34:05.043: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up

R2(config-router)#neighbor 2.1.1.2 remote-as 650123
R2(config-router)#network 20.0.0.0
R2(config-router)#network 2.0.0.0
R2(config-router)#network 1.0.0.0
R2(config-router)#network 12.0.0.0 mask 255.255.255.0
R2(config-router)#no synchronization
R2(config-router)#no auto-summary
R2(config-router)#exit



R3(config)#router bgp 650123
R3(config-router)#neighbor 2.1.1.1 remote-as 650123

*Jan 26 13:36:03.887: %BGP-5-ADJCHANGE: neighbor 2.1.1.1 Up

R3(config-router)#neighbor 30.1.1.2 remote-as 650006
R3(config-router)#neighbor 1.1.1.1 remote-as 650123


*Jan 26 14:00:00.539: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up

R3(config-router)#neighbor 1.1.1.1 next-hop-self
R3(config-router)#neighbor 2.1.1.1 next-hop-self

R3(config-router)#network 2.0.0.0
R3(config-router)#network 3.0.0.0
R3(config-router)#network 30.0.0.0
R3(config-router)#network 13.0.0.0 mask 255.255.255.0
R3(config-router)#no synchronization
R3(config-router)#no auto-summary
R3(config-router)#exit

R4(config)#router bgp 650004
R4(config-router)#neighbor 3.1.1.1 remote 650123

*Jan 26 13:30:57.211: %BGP-5-ADJCHANGE: neighbor 3.1.1.1 Up

R4(config-router)#neighbor 4.1.1.2 remote 650123

*Jan 26 13:31:14.247: %BGP-5-ADJCHANGE: neighbor 4.1.1.2 Up

R4(config-router)#network 4.0.0.0
R4(config-router)#network 3.0.0.0
R4(config-router)#network 40.0.0.0
R4(config-router)#network 14.0.0.0 mask 255.255.255.0
R4(config-router)#no auto-summary
R4(config-router)#no synchronization
R4(config-router)#exit



R5(config)#router bgp 650005
R5(config-router)#neighbor 10.1.1.1 remote-as 650123
R5(config-router)#network 10.0.0.0

*Jan 26 13:31:08.975: %BGP-5-ADJCHANGE: neighbor 10.1.1.1 Up

R5(config-router)#network 15.0.0.0 mask 255.255.255.0
R5(config-router)#no auto-summary
R5(config-router)#no synchronization
R5(config-router)#exit


R6(config)#router bgp 650006
R6(config-router)#neighbor 30.1.1.1 remote-as 650123

*Jan 26 13:31:00.731: %BGP-5-ADJCHANGE: neighbor 30.1.1.1 Up

R6(config-router)#network 16.0.0.0 mask 255.255.255.0
R6(config-router)#network 30.0.0.0
R6(config-router)#no auto-summary
R6(config-router)#no synchronization
R6(config-router)#exit


R1#show ip bgp summary
BGP router identifier 11.0.0.1, local AS number 650123
BGP table version is 24, main routing table version 24
14 network entries using 2016 bytes of memory
21 path entries using 1680 bytes of memory
6/5 BGP path/bestpath attribute entries using 816 bytes of memory
3 BGP AS-PATH entries using 72 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 4584 total bytes of memory
BGP activity 14/0 prefixes, 30/9 paths, scan interval 60 secs


Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.2         4       650123      40      45       24    0    0 00:30:07        4
2.1.1.2         4       650123      10      11       24    0    0 00:01:10        7
4.1.1.1         4       650004      34      33       24    0    0 00:22:46        4
10.1.1.2        4       650005      27      35       24    0    0 00:20:32        2



R2#show ip bgp summary
BGP router identifier 12.0.0.1, local AS number 650123
BGP table version is 20, main routing table version 20
14 network entries using 2016 bytes of memory
19 path entries using 1520 bytes of memory
5/5 BGP path/bestpath attribute entries using 680 bytes of memory
3 BGP AS-PATH entries using 72 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 4288 total bytes of memory
BGP activity 14/0 prefixes, 23/4 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4       650123      46      41       20    0    0 00:31:05        7
2.1.1.2         4       650123      46      38       20    0    0 00:29:07        8

R3#show ip bgp summary
BGP router identifier 13.0.0.1, local AS number 650123
BGP table version is 38, main routing table version 38
14 network entries using 2016 bytes of memory
21 path entries using 1680 bytes of memory
6/5 BGP path/bestpath attribute entries using 816 bytes of memory
3 BGP AS-PATH entries using 72 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 4584 total bytes of memory
BGP activity 14/0 prefixes, 38/17 paths, scan interval 60 secs


Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4       650123      10      10       38    0    0 00:00:08        7
2.1.1.1         4       650123      40      48       38    0    0 00:30:12        4
3.1.1.2         4       650004      33      39       33    0    0 00:25:07        4
30.1.1.2        4       650006      27      37       33    0    0 00:20:53        2


R4#show ip bgp summary
BGP router identifier 14.0.0.1, local AS number 650004
BGP table version is 17, main routing table version 17
14 network entries using 2016 bytes of memory
24 path entries using 1920 bytes of memory
5/5 BGP path/bestpath attribute entries using 680 bytes of memory
3 BGP AS-PATH entries using 72 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 4688 total bytes of memory
BGP activity 14/0 prefixes, 36/12 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
3.1.1.1         4       650123      41      33       17    0    0 00:25:28        8
4.1.1.2         4       650123      40      37       17    0    0 00:25:11       12



R5#show ip bgp summary
BGP router identifier 15.0.0.1, local AS number 650005
BGP table version is 32, main routing table version 32
14 network entries using 2016 bytes of memory
15 path entries using 1200 bytes of memory
5/5 BGP path/bestpath attribute entries using 680 bytes of memory
3 BGP AS-PATH entries using 72 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 3968 total bytes of memory
BGP activity 20/6 prefixes, 21/6 paths, scan interval 60 secs


Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.1.1        4       650123      41      30       32    0    0 00:23:19       13


R1#show ip bgp 15.0.0.1
BGP routing table entry for 15.0.0.0/24, version 12
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     2          3
  Refresh Epoch 1
  650005
    10.1.1.2 from 10.1.1.2 (15.0.0.1)
      Origin IGP, metric 0, localpref 100, valid, external, best
      rx pathid: 0, tx pathid: 0x0


R2#show ip bgp 15.0.0.1
BGP routing table entry for 15.0.0.0/24, version 19
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  Refresh Epoch 1
  650005
    1.1.1.1 from 1.1.1.1 (11.0.0.1)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      rx pathid: 0, tx pathid: 0x0

R3#show ip bgp 15.0.0.1
BGP routing table entry for 15.0.0.0/24, version 122
Paths: (1 available, no best path)
Flag: 0x820
  Not advertised to any peer
  Refresh Epoch 2
  650005
    1.1.1.1 (inaccessible) from 1.1.1.1 (11.0.0.1)
      Origin IGP, metric 0, localpref 100, valid, internal
      rx pathid: 0, tx pathid: 0


R5(config)#access-list 1 permit 15.0.0.0 0.0.0.255

R5(config)#route-map community permit 1
R5(config-route-map)#match ip address 1
R5(config-route-map)#set community ?
  <1-4294967295>  community number
  aa:nn           community number in aa:nn format
  gshut           Graceful Shutdown (well-known community)
  internet        Internet (well-known community)
  local-AS        Do not send outside local AS (well-known community)
  no-advertise    Do not advertise to any peer (well-known community)
  no-export       Do not export to next AS (well-known community)
  none            No community attribute


R5(config-route-map)#set community no-advertise
R5(config-route-map)#exit

R5(config)#route-map community permit 2
R5(config-route-map)#exit

R5(config)#router bgp 650005
R5(config-router)#neighbor 10.1.1.1 route-map community ?
  in   Apply map to incoming routes
  out  Apply map to outbound routes

R5(config-router)#neighbor 10.1.1.1 route-map community out
R5(config-router)#neighbor 10.1.1.1 send-community
R5(config-router)#end

(neighbor send-community BGP subcommand tells BGP to include the community PATH_ATTRIBUTE in the update)

R1#show ip bgp 15.0.0.0
BGP routing table entry for 15.0.0.0/24, version 129
Paths: (1 available, best #1, table default, not advertised to any peer)
  Not advertised to any peer
  Refresh Epoch 1
  650005
    10.1.1.2 from 10.1.1.2 (15.0.0.1)
      Origin IGP, metric 0, localpref 100, valid, external, best
      Community: no-advertise
      rx pathid: 0, tx pathid: 0x0


R2#show ip bgp 15.0.0.1
% Network not in table

R3#show ip bgp 15.0.0.1
% Network not in table

(comment below for all well_known predefined community configuration) 

No comments:

PIM Sparse Mode

PIM Sparse Mode  ( PIM-SM )  PIM  Sparse Mode explicitly builds unidirectional shared trees rooted at a ( RP ) rendezvous point per...