Hello, I want to identify all BGP learned routes on a Fortigate and then apply a BGP Community attribute to them.
I am using an inbound route-map on the BGP peer for this purpose, however it does seem to work.
Is this the correct way to do this ?
config router route-map
edit "HG_CORP_ROUTE_MAP_IN"
config rule
edit 10
set match-origin egp***matching all learned incoming BGP routes
set set-community "7714:65100"***setting the community
Solved! Go to Solution.
You still need to apply the route-map to each neighbor. Then if you want to set a specific community to all routes from the neighbor, I wouldn't bother matching anything but just apply the community. Then for other neighbors you might want to apply different communities. Otherwise, what's the purpose of applying a community?
They would be useful only when the FGT advertises those community-attached routes to other neighboring routing devices, or other VDOMs because communities are preserved when the routes are forwarded until removed/overwritten by a router on the path.
Or further, I would attach the community on the advertising router side when it advertises them to the FGT, which would be simpler.
Toshi
You still need to apply the route-map to each neighbor. Then if you want to set a specific community to all routes from the neighbor, I wouldn't bother matching anything but just apply the community. Then for other neighbors you might want to apply different communities. Otherwise, what's the purpose of applying a community?
They would be useful only when the FGT advertises those community-attached routes to other neighboring routing devices, or other VDOMs because communities are preserved when the routes are forwarded until removed/overwritten by a router on the path.
Or further, I would attach the community on the advertising router side when it advertises them to the FGT, which would be simpler.
Toshi
Hello,
The route-map looks OK except the part that you are matching origin. That is not needed as you need to apply this route-map on neighbor on incoming direction. So all the routes will pass it automatically. But still, I would remove that origin criteria. Of course, after any change related to BGP, soft-clear the neighbor:
exec router clear bgp ip x.x.x.x soft
Then you can verify if the network received has community set:
get router info bgp network X.X.X.X/X
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1743 | |
1114 | |
760 | |
447 | |
241 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.