How to configure BGP route filtering using Route-map and Prefix-list on the Advanced Routing Engine
Objective
Using the network diagram shown below, the goal is to establish specific routing policies:
- Ensure the default route (0.0.0.0/0) from both ISPs is installed in the routing table for redundancy.
- Traffic destined for the 192.168.0.0/16 network must exit through ISP1.
- Traffic destined for the 10.0.0.0/8 network must exit through ISP2.
- Filter all routes advertised for the 172.16.0.0/12 network from being installed in the routing table.
- Configure the NGFW to increase its maximum prefix limit to prevent it from dropping routes.
- This will resolve the current issue shown in the logs (e.g., "Maximum prefix limit being hit").
10:57:11 BGP: [MCWSV-FHNYK] %MAXPFX: No. of IPv4 Unicast prefix received from neighbor vm100-2(192.168.1.2) reaches 1, max 7
10:57:11 BGP: [QAZ2C-BZRW5] %MAXPFXEXCEED: No. of IPv4 Unicast prefix received from neighbor vm100-2(192.168.1.2) 8 exceed, limit 7
10:57:11 BGP: [HZN6M-XRM1G] %NOTIFICATION(Hard Reset): sent to neighbor vm100-2 6/1 (Cease/Maximum Number of Prefixes Reached) 7 bytes 00 01
Environment
- Advanced Routing Engine
- Logical Router
- BGP
- Prefix-list
- Route-map
- PAN-OS version
- Routing table prior to implementation of solution
- Default Route
- 192.168.0.0/16
- 10.0.0.0/8
- 172.16.0.0/12
Procedure
I. Configurating Prefix-List
A. Create filters for ISP1:
- Define the name of the prefix-list filter by going to Network > Routing > Routing Profiles > Filters > Filters Prefix List > Add > Name, in this sample we'll be using 2_ISP1
- Allow the default route from ISP1 to be installed in BGP's RIB table, as highlighted above click Add and use the following parameters:
-
- Seq: 10
- Action: Permit
- Prefix: Network
- Network: 0.0.0.0/0
Note: Since we are trying to match just the default route, we don't need to use the Greater Than Or Equal or Less Than Or Equal Options.
- Click OK to save
- Allow routes for 192.168.0.0/16 that have a subnet of /24 and its supernetworks , click Add once again under Filter Prefix List 2_ISP1, and use the following values:
- Seq: 20
- Action: Permit
- Prefix: Network
- Network: 192.168.0.0/16
- Les Than Or Equal: 24
Note: We don't need to use the Greater Than or Equal option to prevent any networks that are part of 192.168.0.0/16 from having a subnet smaller than /24 accepted by BGP.
- Click OK to save
- As a result, at this point we should have something like the following:
- Click OK to save
B. Create filters for ISP2
- Define the name of the prefix-list filter by going to Network > Routing > Routing Profiles > Filters > Filters Prefix List > Add > Name, in this sample we'll be using 2_ISP2
- Allow the default route from ISP2 to be installed in BGP's RIB table, as highlighted above click Add and use the following parameters:
- Seq: 10
- Action: Permit
- Prefix: Network
- Network: 0.0.0.0/0
- Click OK to save
- Allow routes for 10.0.0.0/8 that have a subnet of /16 and its supernetworks , click Add once again under Filter Prefix List 2_ISP2, and use the following values:
- Seq: 20
- Action: Permit
- Prefix: Network
- Network: 10.0.0.0/8
- Les Than Or Equal: 16
Note: We don't need to use the Greater Than or Equal option to prevent any networks that are part of 10.0.0.0/8 from having a subnet smaller than /16 accepted by BGP.
- Click OK to save
- As a result, at this point we should have something like the following:
- Click OK to save
II. Configuring Route-map
- Define the name of the route-map filter by going to Network > Routing > Routing Profiles > Filters > Filters Route Maps BGP > Add > Name, in this sample we'll be using My_BGP_Route_Map
- Assign the Prefix-list created for ISP1 to the route-map by clicking Add as highlighted above, and use the following parameters
- Entry (tab):
- Seq: 10
- Action: Permit
- Entry (tab):
- Match (tab):
- Peer: ISP1
- Prefix List: 2_IPS1
- Click OK to save
- Assign the Prefix-list created for ISP2 to the route-map by clicking Add as highlighted above (Step II.1), and use the following parameters
- Entry (tab):
- Seq: 20
- Action: Permit
- Entry (tab):
- Match (tab):
- Peer: ISP2
- Prefix List: 2_IPS2
- Click OK to save
- Result, at this point we should have something like the below:
- Click OK to save
III. Configuring BGP Filtering Profile
- Apply the above Route-map filter to the BGP Filtering Profile by going to Network > Routing > Routing Profiles > BGP > BGP Filtering Profile > Add, and use the following parameters:
- Name: My_BGP_Filtering_Profile
- Inbound Route Map: My_BGP_Route_Map
-
- Click OK to save
1V. Applying the BGP Filtering Profile to the Logical Router
- Implement the BGP filter Profile by going to Network > Routing > Logical Router > [Logical_Router_Name] > BGP > Peer Group > [Peer_Group_Name] > IPv4 Filtering Profile > My_BGP_Filtering_Profile
- Click OK twice then Commit to save
V. Viewing the results from the Routing Table
To verify the routing table go to, Network > Routing > Logical Routers > More Runtime Stats
- Default Route (First Objective)
- 192.168.0.0/16 (Second Objective)
- 10.0.0.0/8 (Third Objective)
- 172.16.0.0/12 (Fourth and Fifth Objectives)
Additional Information
This Knowledge Based article is a build up from two previous ones which are: