Description | This article describes how to set wildcard and prefix options in access-list and call access list in route-map for route advertisement in BGP. |
Scope | FortiGate |
Solution |
Access-list is used to limit advertised routes and also to insert only specific routes of received routes in BGP using route-map.
To define the network, which needs to be matched, either wildcard or prefix options can be used in the access list rule.
Here is a scenario:
FortiGate is connected to Networks: n/w1,: 10.10.1.0/24, n/w2 :10.10.2.0/26, n/w3 :10.10.3.0/27, n/w4 :10.10.4.0/28, n/w5 :10.10.5.0/29 and n/w6 :10.10.6.0/30. All these connected routes get redistributed when redistribute 'connected' is enabled in BGP
config redistribute "connected"
If there is a need to block specific connected networks from getting advertised to the BGP neighbor, an access list needs to be created with a specific network ID; call it in Route-map and configure route-map-out in the BGP neighbor.
Example: Out of all connected networks, n/w4: 10.10.4.0/28 and n/w5: 10.10.5.0/29 are not supposed to be advertised. So need to create a rule using the prifix or wildcard option to filter the network.
Access-list with prefix option: here network ID and its subnet mask have to be defined.
config router access-list
Access-list with wildcard option: here network ID and wildcard subnet mask have to be defined similarly to the Cisco ACL rule.
config router access-list
Both will serve the same purpose but defining the network, and its subnet is different. Either prefix or wildcard in the single rule ID can be set, not both.
Fortinet # config router access-list Fortinet (access-list) # edit Block_n4_n5 Fortinet (Block_n4_n5) # config rule Fortinet (rule) # edit 1 Fortinet (1) #show full config rule
==========================
config router route-map
config router bgp
Fortinet # get router info bgp network Network Next Hop Metric LocPrf Weight RouteTag Path
Fortinet # get router info bgp neighbors 1.1.1.1 advertised-routes Network Next Hop Metric LocPrf Weight RouteTag Path
Router#show ip bgp summary Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
Router#show ip bgp neighbors 1.1.1.2 received-routes Network Next Hop Metric LocPrf Weight Path |
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.