- Products
- Learn
- Local User Groups
- Partners
- More
Firewall Uptime, Reimagined
How AIOps Simplifies Operations and Prevents Outages
Introduction to Lakera:
Securing the AI Frontier!
Check Point Named Leader
2025 Gartner® Magic Quadrant™ for Hybrid Mesh Firewall
HTTPS Inspection
Help us to understand your needs better
CheckMates Go:
SharePoint CVEs and More!
Wondering if anyone has any BGP route-map examples to block learning any routes that has a select BGP ASN in its path.
I have a cloudguard FW deployed where I am peering with an Azure route server (ARS) (ASN 65515) and that ARS also is learning routes from an expressroute circuit (ASN 12076). The ARS has some very limited capabilities and can't put any real filters in place when you redistrobute routes there.
In this example, I want my cloudguard FW to accept routes that come from the ARS and its direct vnets (65515) but any routes being learned from the expressroute (i.e. has asn 12076 in its aspath), i want to reject.
I have a feeling i can do this with a import route-map configuration on my peer with the ARS using an aspath-regex.
Example:
set routemap ARS-Peer-In id 100 on
set routemap ARS-Peer-In id 100 restrict
set routemap ARS-Peer-In id 100 match aspath-regex "_12076_" origin any
set routemap ARS-Peer-In id 200 on
set routemap ARS-Peer-In id 200 allow
set routemap ARS-Peer-In id 200 match as 65515 on
set routemap ARS-Peer-In id 200 action nexthop ip 10.1.1.1 <= this being the ip of the GW cluster; 10.1.1.2 used on other cluster.
set bgp external remote-as 65515 import-routemap ARS-Peer-In preference 1 on
Is this an ample way to address this? (## Note: question relating to ability to block a ASN in a path for check point but accept others; we have confirmed with Microsoft Azure engineering teams that this restriction of ASN 12076 will address our issue)
The other validation I wanted to ask was the use of the routemap IDs and preferences.
In regards to the route map preferences, can you do this same retriction type with various route maps and place in the preference order?
Example:
set routemap ARS-Peer-restrict id 100 on
set routemap ARS-Peer-restrict id 100 restrict
set routemap ARS-Peer-restrict id 100 match aspath-regex "_12076_" origin any
set routemap ARS-Peer-In id 200 on
set routemap ARS-Peer-In id 200 allow
set routemap ARS-Peer-In id 200 match as 65515 on
set routemap ARS-Peer-In id 200 action nexthop ip 10.1.1.1 <= this being the ip of the GW cluster
set bgp external remote-as 65515 import-routemap ARS-Peer-restrict preference 1 on
set bgp external remote-as 65515 import-routemap ARS-Peer-In preference 2 on
It feels normal to me for any vendor BGP configuration to have one set of routemaps on a peer and set the order of operations with the route map IDs. But I wanted to know if i understand the processing here with the multiple map options and preference order if both would indeed be 'inspected' at all times and the preference just is setting the map 'order'. (a.k.a 'best practice' for routemaps with checkpoint 😉 )
Thanks in advance for any assistance
I hear ya there, BGP with Check Point is WAYYY different than Cisco lol
Anyway, I wish there was way to do routemaps in web UI, hope it becomes available in R82, but for now, here is what I can tell you from my experience. When my colleague and I did this for a customer of ours, restricting via a routemap did not have anything to do with routemap ID. Once I find the fw config, I can send you the example of it, probably tomorrow or Monday.
Best,
Andy
Thanks @the_rock 🙂
Sorry mate, cant find it in client's config, I guess we never ended up doing restrict option, but its essentially how you mentioned in the post itself.
Andy
All good @the_rock 🙂
Searching around and may have found some of my own answers.
I'll review internally and also with my internal checkpoint team on the best path here to go. The additional route-map here might be the easiest and cleanest path since my existing ones are using a preference of 8 today (i.e. a lower one is available) and might allow for a nice clean route map name that has some context
(note: it would be nice to have a 'comment' field to use on routemaps so we can note what each map or ID entry is intended for 😉 )
I feel like I would know that sk number in my dreams lol. Heard it so many times from TAC people when my colleague and I were helping a customer couple of years back for BGP issue.
Here is section I always found was most relevant as far as route restrict.
Best,
Andy
Create a routemap to export a set of routes that you wish to restrict a subset of (see the"Exporting all routes from one or more protocols" section or "Exporting only selected routes" section above).
Create a separate new routemap, and create one routemap ID belonging to it for each set of match conditions you wish to specify:
HostName> set routemap ROUTEMAP_NAME id ID_NUMBER on
For each ID, set the ID type to "Restrict
" to block the routes matched:
HostName> set routemap ROUTEMAP_NAME id ID_NUMBER restrict
Set the export routemap on the protocol, to which you wish to export the routes:
HostName> set PROTOCOL export-routemap ROUTEMAP_NAME preference ROUTEMAP_PREFERENCE_NUMBER on
Notes:
Save Gaia configuration:
HostName> save config
Example:
Using the following routemaps:
bgp_export
' from the "Exporting only selected routes" section as the "Allow
" routemapRestrict
" routemapNotes:
Allow"
routemap is higher than the preference value for the "Restrict
" routemap, so the restrict routes are matched first.Allow
" routemap for BGP is re-stated here. This restrict routemap will restrict routes from BGP AS 100 that are in the prefix 192.168.0.0/16.Commands:
HostName> set routemap bgp_restrict id 1 on HostName> set routemap bgp_restrict id 1 match as 100 HostName> set routemap bgp_restrict id 1 match network 192.168.0.0/16 all HostName> set routemap bgp_restrict id 1 restrict HostName> set bgp external remote-as 1 export-routemap bgp_restrict preference 1 on HostName> set bgp external remote-as 1 export-routemap bgp_export preference 2 on HostName> save config
Just a quick update:
Was able to deploy this restriction safely last week and it did work as designed. After review of the existing routemaps, we ended up adjusting with a lower ID within the existing maps verses creating a new one with different preferences.
There was also a need to tag some 'no-advertise' communities on our exports that worked out as planned.
A couple of notes and lessons learned:
Honestly, the lack of grep type of commands where you can look granular would have been a huge help (GAIA OS cli request 😉 ).
Dumping the outputs to comb through was a bigger drag that it should have but noted for future deployments at this time 🙂
Thanks for everyone's help and insights......hope this helps out others with similar deployments 🙂
Thanks for sharring @Scottc98 , appreciated. I get what you mean by grep, I always found that super challenging as well.
Best,
Andy
Hi @the_rock ,
Do you think that commands below:
HostName> set routemap bgp_restrict id 1 on
HostName> set routemap bgp_restrict id 1 match as 100
HostName> set routemap bgp_restrict id 1 match network 192.168.0.0/16 all
HostName> set routemap bgp_restrict id 1 restrict
HostName> set bgp external remote-as 1 export-routemap bgp_restrict preference 1 on
HostName> set bgp external remote-as 1 export-routemap bgp_export preference 2 on
HostName> save config
can be written like this:
HostName> set routemap bgp_restrict_and_export id 1 on
HostName> set routemap bgp_restrict_and_export id 1 match as 100
HostName> set routemap bgp_restrict_and_export id 1 match network 192.168.0.0/16 all restrict on
HostName> set routemap bgp_restrict_and_export id 2 on
HostName> set routemap bgp_restrict_and_export id 2 match protocol ospf2
HostName> set routemap bgp_restrict_and_export id 2 match network 10.0.0.0/8 between 24 and 32
HostName> set routemap bgp_restrict_and_export id 2 allow
HostName> set routemap bgp_restrict_and_export id 3 on
HostName> set routemap bgp_restrict_and_export id 3 match as 100 on
HostName> set routemap bgp_restrict_and_export id 3 allow
HostName> set bgp external remote-as 1 export-routemap bgp_restrict_and_export preference 1 on
HostName> save config
or like this:
HostName> set routemap bgp_restrict_and_export id 1 on
HostName> set routemap bgp_restrict_and_export id 1 match as 100
HostName> set routemap bgp_restrict_and_export id 1 match network 192.168.0.0/16 all
HostName> set routemap bgp_restrict_and_export id 1 restrict
HostName> set routemap bgp_restrict_and_export id 2 on
HostName> set routemap bgp_restrict_and_export id 2 match protocol ospf2
HostName> set routemap bgp_restrict_and_export id 2 match network 10.0.0.0/8 between 24 and 32
HostName> set routemap bgp_restrict_and_export id 2 allow
HostName> set routemap bgp_restrict_and_export id 3 on
HostName> set routemap bgp_restrict_and_export id 3 match as 100 on
HostName> set routemap bgp_restrict_and_export id 3 allow
HostName> set bgp external remote-as 1 export-routemap bgp_restrict_and_export preference 1 on
HostName> save config
Yes, but slightly different...see below.
Andy
test-fw> set routemap bgp_restrict_and_export id 2 match network 10.0.0.0/8 between
Configures the Route Map to match routes that are within the given
IPv4 or IPv6 subnet and which have a mask length that is between
the given range of values.
Value: 1 - 32 (IPv4 subnet mask length)
(or)
1 - 128 (IPv6 subnet mask length)
For a given Route Map ID, only one match condition for a given subnet
can exist. E.g., the following command sequence will cause the first
command to be overwritten by the second:
set routemap A id 1 match network 10.1.3.0/24 between 24 and \
27 restrict on
set routemap A id 1 match network 10.1.3.0/24 between 28 and \
32
Leaderboard
Epsum factorial non deposit quid pro quo hic escorol.
User | Count |
---|---|
12 | |
12 | |
11 | |
7 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 |
Tue 07 Oct 2025 @ 10:00 AM (CEST)
Cloud Architect Series: AI-Powered API Security with CloudGuard WAFThu 09 Oct 2025 @ 10:00 AM (CEST)
CheckMates Live BeLux: Discover How to Stop Data Leaks in GenAI Tools: Live Demo You Can’t Miss!Thu 09 Oct 2025 @ 10:00 AM (CEST)
CheckMates Live BeLux: Discover How to Stop Data Leaks in GenAI Tools: Live Demo You Can’t Miss!Wed 22 Oct 2025 @ 11:00 AM (EDT)
Firewall Uptime, Reimagined: How AIOps Simplifies Operations and Prevents OutagesAbout CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY