Created on
10-06-2020
09:59 AM
Edited on
07-21-2025
08:54 PM
By
Anthony_E
Description
This article describes how to control inbound and outbound prefix advertisements using prefix-lists with BGP. Prefix-lists can be used standalone (which is the case for this article), or they can be used as a component a route-map rule (see also: Technical Tip: How to Block Advertising and Receiving of Specific Routes to and from BGP Peer using ...). Access lists can also be used for this purpose, although this article does not discuss this topic.
Scope
FortiGate, BGP.
Solution
A scenario will be used to demonstrate the use of prefix lists. First, the following topology will be used in this example:
In this scenario, the administrator wants to configure FortiGate-A to block prefix 10.10.1.0/24 from being advertised to FortiGate-B while still allowing all other prefixes to be shared. Since there are no additional requirements (such as community tagging or adjusting BGP attributes like AS_PATH), the administrator has opted to use a simple outbound prefix-list to perform this filtering. Assume that the BGP peering is already working and in an Established state.
To accomplish this task, the administrator can perform the following steps on FortiGate-A:
Note the following key points for the prefix-list configuration:
FortiGate-A # get router info bgp neighbors 10.5.20.160 advertised-routes
VRF 0 BGP table version is 2, local router ID is 172.31.135.228
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight RouteTag Path
*> 192.168.1.0 10.5.23.228 100 32768 0 i <-/->
*> 192.168.2.0 10.5.23.228 100 32768 0 i <-/->
Total number of prefixes 2
Troubleshooting:
The BGP debugging will share that the outgoing prefix list is being applied:
diagnose ip router bgp all en
diagnose ip router bgp level info
diagnose debug en
BGP: Router_ID-Outgoing [FSM] State: OpenConfirm Event: 26
id=20300 msg="BGP: %BGP-5-ADJCHANGE: VRF 0 neighbor Router_ID Up "
BGP: Router_ID-Outgoing [RIB] Announce Check: 10.10.1.0/24 is filtered
BGP: [RIB] Scanning BGP Network Routes for VRF 0...
BGP: Router_ID-Outgoing [FSM] State: Established Event: 5
To stop the debugging:
diagnose debug disable
diagnose ip router bgp all disable
diagnose ip router bgp level none
Related articles:
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.