1.5c Routing Policies
1.5.c i Attribute manipulation
In BGP, there are two main options to manipulate the Weight attribute:
- per-neighbor basis
- per-prefix basis.
Note: The BGP’s Weight Path attribute is the first path attribute BGP checks in the election of the best path in the BGP table on Cisco IOS Routers. BGP prefers the path for the entry with the highest Weight. Weight is a Cisco-specific parameter and it is only locally significant in the Router where it is configured
Neighbor Method
The next commands set the Weight path attribute to 20000 for ALL routes received from the BGP peer.
router bgp 100
neighbor 10.1.2.2 weight 20000
You can also use the route-map command to set the Weigh Path attribute:
route-map FROM-WAN permit 10
set weight 20000
!
router bgp 100
neighbor 10.1.2.2 route-map FROM-WAN in
If you want the change the weight of a specific prefix you can extend the route-map:
ip prefix-list NETWORKS permit 192.168.1.0/24
!
route-map FROM-WAN permit 10
match ip address prefix NETWORKS
set weight 20000
route-map FROM-WAN permit 100
!
router bgp 100
neighbor 10.1.2.2 route-map FROM-WAN in
Prefix Method
Use an ACL to identify the prefixes you are interested in:
access-list 1 permit <ip range> <wildcard mask>
Then define this in BGP:
router bgp 100
ip as-path access-list 1 permit <AS regex filter>
1.5.c ii Conditional advertisement
A feature of BGP that can be used in a network that is multihomed to two ISPs. It is possible to advertise your local prefixes to a router, only if a certain route is/is not being learned, in other words a Conditional Advertisement. Conditional advertisement can be configured in two methods:
neighbor advertise-map <route-map name> non-exist-map <route-map name>
Or
neighbor advertise-map <route-map name> exist-map <route-map name>
1.5.c ii + Conditional route injection
The goal of the conditional route injection is that if (in this example) we see the aggregate address 155.1.8.0/22 coming from neighbor 150.1.5.5, we should advertise the more specific route of 155.1.8.0/24 to our neighbors.
The first step is to define the exist condition. In this example we want to see the aggregate route 155.1.8.0/22 coming from the neighbor 150.1.5.5. Therefor we define the following prefix-list:
ip prefix-list AGGREGATE-ROUTE seq 5 permit 155.1.8.0/22
!
ip prefix-list NEIGHBOR seq 5 permit 150.1.5.5/32
The next step is to define the route we want to inject:
ip prefix-list INJECTED-ROUTE seq 5 permit 155.1.8.0/24
Now we need to tie it together in two route-maps
route-map INJECT permit 10
set ip address prefix-list INJECTED-ROUTE
!
route-map AGGREGATE-EXISTS permit 10
match ip route-source prefix-list NEIGHBOR
match ip address prefix-list AGGREGATE-ROUTE
And finally apply it to the BGP Process:
router bgp 100
bgp inject-map INJECT exist-map AGGREGATE-EXISTS
1.5.c iii Outbound Route Filtering
A feature that minimizes the number of BGP updates sent between BGP peers. ORF allows a BGP router to send a prefix-list to a peer that should be applied facing back toward the originating router.
Use command:
router bgp 100
neighbor <ip address> capability orf prefix-list <prefix-list name> <send | receive | both>
This should be configured on both routers. Note that in a peer-group, a router may only send and not receive.
1.5.c iv Standard and extended communities
BGP communities allow for additional capability to tag routes and to modify routing policy on upstream and downstream routers. Communities are used to group prefixes together for advertisement, filtering or best path selection policies.
Communities are not exchanged between peers by default, but can be with the command:
router bgp 100
neighbor <IP address> send-community
Extended BGP communities provide a structure for various classes of information and are commonly used for VPN services.
Well know BGP communities
There are 4 well known BGP communities that you can use or you can pick a numeric value that you can use for your own policies. Here are the 4 well known BGP communities:
- Internet: advertise the prefix to all BGP neighbors.
- No-Advertise: don’t advertise the prefix to any BGP neighbors.
- No-Export: don’t advertise the prefix to any eBGP neighbors.
- Local-AS: don’t advertise the prefix outside of the sub-AS (this one is used for BGP confederations).
Configuration example (no-advertise)
Define prefix-list –> create route-map –> attach to neighbor
ip prefix-list R10_HOST seq 5 permit 155.1.10.0/24
!
route-map BGP_OUT permit 10
match ip address prefix-list R10_HOST
set community no-advertise
!
route-map BGP_OUT permit 20
!
router bgp 8.10
neighbor 155.1.58.5 send-community
neighbor 155.1.58.5 route-map BGP_OUT out
!
BGP Community Formats
A standard community is a 32-bit (4-Byte) number that can be included with a route. They can be expressed as a plain decimal number or as a two-part 16-bit number in the format: <0-65535>:<0-65535>.
The decimal format looks like this:
! DECIMAL FORMAT
R3# show bgp 192.168.1.1
! Output omitted for brevity
BGP routing table entry for 192.168.1.1/32, version 6
Community: 6553602 6577023
The format can be changed by applying the following command globally:
ip bgp-community new-format
The same output as above, but wit the new format:
! New-Format
R3# show bgp 192.168.1.1
! Output omitted for brevity
BGP routing table entry for 192.168.1.1/32, version 6
Community: 100:2 100:23423
Configuration
BGP Traffic Engineering with Communities (Diagram: INE LAB)
Set the communities on R7
#R7
router bgp 200
neighbor 155.1.67.6 remote-as 100
neighbor 155.1.67.6 send-community both
neighbor 155.1.67.6 route-map BGP_OUT out
!
ip prefix-list HOST7 seq 5 permit 155.1.7.0/24
!
ip prefix-list HOST9 seq 5 permit 155.1.9.0/24
!
ip bgp-community new-format
!
route-map BGP_OUT permit 10
match ip address prefix-list HOST7
set community 100:150
!
route-map BGP_OUT permit 20
match ip address prefix-list HOST9
set community 100:50
Use the communities on R6 to set the local-preference (just an example):
#R6
!
router bgp 100
neighbor 155.1.67.7 remote-as 200
neighbor 155.1.67.7 route-map BGP_IN in
!
ip bgp-community new-format
!
ip community-list 1 permit 100:150
ip community-list 2 permit 100:50
!
route-map BGP_IN permit 10
match community 1
set local-preference 150
!
route-map BGP_IN permit 20
match community 2
set local-preference 50
1.5.c v Multi-homing
The simplest method of providing redundancy to a network is to provide a second circuit. The process of adding a 2nd circuit and a 2nd BGP session is called Multi-Homing. By default, BGP only adds the best path to a destination into the RIB.
If an enterprise uses BGP to connect with more than one service provider, it runs the risk of its AS becoming a transit AS. This can be overcome by using Outbound Route Filtering described earlier.
Multihomed networks should be configured as such that branch routers cannot act as transit routers.
Comments
So empty here ... leave a comment!