Created on
02-23-2010
03:06 AM
Edited on
01-12-2026
10:03 PM
By
Jean-Philippe_P
| Description | This article describes using AS-PATH prepending with BGP multi-homed configurations to influence inbound traffic when announcing a subnet to multiple providers. |
| Scope | FortiGate. |
| Solution |
Purpose:
Even though there is a higher local preference on the Primary ISP router and lower on the secondary ISP router, some reverse traffic may hit the FortiGate via the secondary ISP link. In this case, BGP route selection can be influenced by using the AS_PATH attribute with multiple copies of the local AS number (AS-path prepending).
Expectations, Requirements:
Configuration:
config system interface edit "port2" set vdom "root" next set vdom "root" next edit "DMZ" set vdom "root" next end
config router route-map edit "Secondary_ISP" config rule edit 1 set set-aspath "65301 65301 65301" next end next end
Route-map that sets a higher local preference for prefixes received from the Primary ISP:
config router route-map edit "Primary_ISP" config rule edit 1 set set-local-preference 200 next end next end
The route-maps are applied to both BGP neighbors:
config router bgp set as 65301 config neighbor edit "202.1.1.2" set remote-as 65101 next set remote-as 65201 next end config network edit 1 set prefix 93.184.216.34 255.255.255.255 next end set router-id 3.3.3.3 end
Verification: The following output shows on the Secondary ISP router before the pre-pending technique is applied, the best path to reach 93.184.216.34/32 is via 202.2.2.1: ISP2-R1 # get router info bgp network Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight RouteTag Path *> 93.184.216.34/32 202.2.2.1 0 0 0 65301 i * i 10.1.1.1 0 100 0 0 65101 65301 i *> 202.2.2.0/28 0.0.0.0 100 32768 0 i
The following output shows on the Secondary ISP router after the pre-pending technique was applied, the best path to reach 93.184.216.34/32 is via 101.1.1.1 now: ISP2-R1 # get router info bgp network Network Next Hop Metric LocPrf Weight RouteTag Path
Technical Tip: BGP dual-home example - solution to avoid RPF problem in asymetric routing scenario |
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 2026 Fortinet, Inc. All Rights Reserved.