Understand and Configure BGP Table-Map

Rashmi Bhardwaj | Blog,Config & Troubleshoot,Protocol,Routing & Switching
Advertisements

There are various situations where you would want to optimize the performance of your route-reflector in BGP network. By default BGP downloads all the routes in RIB. BGP Table-Map is one of the methods to achieve BGP selective route download particularly used on the Route-Reflectors.

Understanding BGP Table-Map

BGP Table-map is primary used to suppress the unnecessary downloading of certain BGP routes to the RIB or Forwarding Information Base (FIB) on a dedicated route reflector, which propagates BGP updates without carrying transit traffic.

Suppressing/Filtering the routes in RIB/FIB on the dedicated route-reflectors provides essential saving on the memory and CPU resources on the router.

Advertisements

Note that the Selective Route Download feature is not applicable to Multiprotocol Label Switching (MPLS) Layer 3 VPN because the route download is already automatically suppressed on a route reflector.

The table-map command is configured under route BGP process and is applied on the router as a whole and not on per neighbor basis as route-maps.

It is important to understand the use of the filter keyword in the BGP table-map command:

  • When the table-map command is used without the filter keyword, the route map referenced in the table-map command is used to set certain properties (such as the traffic index) of the routes for installation into the RIB. The route is always downloaded, regardless of whether it is permitted or denied by the route map.
  • When the table-map command is used with the filter keyword, the route map referenced is also used to control whether a BGP route is to be downloaded to the RIB (hence the filter). A BGP route is not downloaded to the RIB if it is denied by the route map.

We can create a route-map to permit or deny the routes to be downloaded in the RIB or FIB and then use this route-map with the table-map command.

Related- BGP Suppress MAP and Attribute MAP

Example Scenario: Use of BGP Table-Map

Let’s use the below topology to understand the use of BGP Table-Map

understand-and-configure-bgp-table-map

In the topology diagram above R1 is advertising a route of its loopback 1 i.e. 1.1.1.1 to Route-Reflector. We have applied a route-map on Route-Reflector to deny everything and then this route-map is called in the table-map command so avoid the installation of the route in the RIB and FIB on the RR.

Though RR doesn’t install the route in its RIB & FIB it still reflects the route to R2.

Configuration:

R1:

interface Loopback0ip address 9.9.0.1 255.255.255.255

ip ospf 1 area 0

!

interface Loopback1

ip address 1.1.1.1 255.255.255.255

!

interface FastEthernet0/0

ip address 9.9.13.1 255.255.255.0

ip ospf 1 area 0

!

router bgp 100

network 1.1.1.1 mask 255.255.255.255

neighbor 9.9.0.3 remote-as 100

neighbor 9.9.0.3 update-source Loopback0

R2:

interface Loopback0ip address 9.9.0.2 255.255.255.255

ip ospf 1 area 0

!

interface FastEthernet0/0

ip address 9.9.23.2 255.255.255.0

ip ospf 1 area 0

!

router bgp 100

neighbor 9.9.0.3 remote-as 100

neighbor 9.9.0.3 update-source Loopback0

R3:

interface Loopback0ip address 9.9.0.3 255.255.255.255

ip ospf 1 area 0

!

interface FastEthernet0/0

ip address 9.9.13.3 255.255.255.0

ip ospf 1 area 0

!

interface FastEthernet1/0

ip address 9.9.23.3 255.255.255.0

ip ospf 1 area 0

l!

router bgp 100

table-map tmap filter

bgp log-neighbor-changes

neighbor 9.9.0.1 remote-as 100

neighbor 9.9.0.1 update-source Loopback0

neighbor 9.9.0.1 route-reflector-client

neighbor 9.9.0.2 remote-as 100

neighbor 9.9.0.2 update-source Loopback0

neighbor 9.9.0.2 route-reflector-client

!

route-map tmap deny 10

Test Results:

Scenario 1: Table-Map isn’t applied 

As of now we are able to see the route of 1.1.1.1 on R3 in RIB and FIB.

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, l – LISP

       + – 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/0] via 9.9.0.1, 00:00:05

   9.0.0.0/8 is variably subnetted, 7 subnets, 2 masks

O       9.9.0.1/32 [110/2] via 9.9.13.1, 00:13:06, FastEthernet0/0

O       9.9.0.2/32 [110/2] via 9.9.23.2, 00:13:06, FastEthernet1/0

C       9.9.0.3/32 is directly connected, Loopback0

C       9.9.13.0/24 is directly connected, FastEthernet0/0

L       9.9.13.3/32 is directly connected, FastEthernet0/0

C       9.9.23.0/24 is directly connected, FastEthernet1/0

L       9.9.23.3/32 is directly connected, FastEthernet1/0

Route for 1.1.1.1 is also received on R2 from R3.

R2#sh ip route 1.1.1.1

Routing entry for 1.1.1.1/32Known via “bgp 100”, distance 200, metric 0, type internal

Last update from 9.9.0.1 00:02:22 ago

Routing Descriptor Blocks:

* 9.9.0.1, from 9.9.0.3, 00:02:22 ago

     Route metric is 0, traffic share count is 1

     AS Hops 0

     MPLS label: none

Scenario 2: Table-Map is applied under router BGP 

Now we have configured table-map to deny the suppress route for 1.1.1.1 in RIB and FIB.

route-map tmap deny 10!

router bgp 100

table-map tmap filter

R1 sends the route to R3.

R1#sh ip bgp neighbors 9.9.0.3 advertised-routes

BGP table version is 2, local router ID is 9.9.13.1Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,

             r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,

             x best-external, a additional-path, c RIB-compressed,

Origin codes: i – IGP, e – EGP, ? – incomplete

RPKI validation codes: V valid, I invalid, N Not found

     Network         Next Hop            Metric   LocPrf   Weight   Path

*> 1.1.1.1/32       0.0.0.0                 0                             32768    i

Total number of prefixes 1

R3 doesn’t install the route in its RIB & FIB as the route-map tmap is configured to deny all the routes.

Note that under the route-map we can allow or deny the routes if required.

R3#sh ip route 1.1.1.1

% Network not in table

 R3#sh ip cef 1.1.1.1

0.0.0.0/0no route

 R2 still gets the route of 1.1.1.1 via R3:

R2#sh ip route 1.1.1.1

Routing entry for 1.1.1.1/32Known via “bgp 100”, distance 200, metric 0, type internal

Last update from 9.9.0.1 00:06:01 ago

Routing Descriptor Blocks:

* 9.9.0.1, from 9.9.0.3, 00:06:01 ago

     Route metric is 0, traffic share count is 1

     AS Hops 0

     MPLS label: none

Related- Non-Exist-Map & BGP Advertise-Map

ABOUT THE AUTHOR


Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart