BGP Routing using Policy Controls

  • Service Provider should filter some IP prefixes in incoming updates, such as RFC1918. Because a customer should only advertise its global networks to the Service Provider.
  • Multihomed Customers should avoid becoming a Transit-AS. As by default in most of the cases the tie breaker for BGP is the Shortest AS-Path, so the providers connected to the to customer will use the customer link as a Transit-AS to reach each other.
  • Service Providers should filter Private addresses in incoming updates of Customers.
  • In a scenario where a customer has two border routers without IBGP, and IGP inside the AS, there will be no loops, but if running IBGP between the border routers, special care should be taken or a direct link between the two border routers is required.
  • Policy Routing only affects the Next-Hop. The destination is unchanged!
  • Policy Routing is CPU intensive, because it is based on the source unlike Dynamic and static routing. So, when routing based on the destination there is no need of Policy Routing.
  • Customers can only affect their outgoing traffic, and can’t directly affect incoming traffic.
    (config)# ip as-path access-list# [permit/deny] regexp
    (config-router)# neighborip-address filter-list as-path-filter# [in/out]

Sample Regular Expression (regex)

#show ip bgp regexp expression
#show ip as-path-access-listfilter-list#
#show ip bgpfilter-list # access-list#
(config-router)# neighbor [IP-address/peer-group] prefix-listlist [in/out
(config-router)# distribute-list prefix-listlist out routing-process
  • Router(config)# ip prefix-list Example seq 10 permit 192.168.1.0/24 ge 25
    This statement is like saying, “match any address that starts with 192.168.1.0, but has a subnet mask of 25 bits or greater.” This would effectively match any subnet of the classful address 192.168.1.0/24.
  • refcount” in the output of “show ip prefix-list detail” means how many routes matched that entry.
(config-router)# neighborIP-address capibility orf prefix-list [both/send/receive]
# show ip bgp neighborIP-address
# clear ip bgpneighbor in prefix-list
  • ORF Send” on one router, needs “Receive” on the neighboring router.
# debug ip bgp update

(config-router)# neighbor IP-address soft-reconfiguration inbound //stores a copy of neighbor routing-table in the memory, and processes the new policies on it.
clear ip bgp IP-address soft in

# clear ip bgp IP-address soft out // Applying the new policies and sends the new routes to the neighbor
show ip bgp neighbor IP-address received/advertised

# clear ip bgp neighbor IP-address in // It’s called route-refresh and is better and soft-reconfig. This features is depended on the capability of Route-Refresh. This capability is mentioned in the “show ip bgp neighbor ip-address
Share this!

Author: Mo Moghaddas

Traveler. Casual investor. Hobbyist landscape photographer loving Networks. Blockchain/Cryptocurrency enthusiast. Internet citizen!

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.