Description |
This article describes a use case demonstrating how BGP local preference and AS path prepending is used on incoming routes and advertised routes, thereby manipulating the routes as required.
The following diagram is used as the reference for this article:
As per the above diagram:
|
Scope | FortiGate, local preference and AS path prepending for route manipulation in BGP. |
Solution |
In this example, changes are performed on FGT1 only, assuming it is the CX router.
Assume CX needs to be capable of the following:
To achieve item 1, the local preference will be set to 200 for the incoming routes via the neighbor 10.56.241.57, where the other neighbor 10.56.245.57 will have the default local preference which is 100.
Configure the prefix-list:
config router prefix-list
Configure the routemap:
config router route-map edit "LocalPref200"
Configure the route-map-in under the relevant neighbor.
To achieve item 2, prepend more AS paths and apply them to the relevant BGP neighbor:
config router route-map edit "inside1_out" config rule edit 1 set set-aspath "65510 65510 65510 65510" <- Original setup, neighbor is 2 AS paths away. More AS paths are made. set set-ip-nexthop 0.0.0.0 set set-originator-id 0.0.0.0 next end
Apply this on relevant BGP neighbors as route-map-out. Below is the BGP config for both neighbors:
config router bgp set as 65500 config neighbor
edit "10.56.241.57" <- FGT1 only. set soft-reconfiguration enable set password ENC next end
edit "10.56.245.57" <- FGT2 only. set soft-reconfiguration enable next end
Verification of the configuration:
The following names were used in lab devices:
Local Preferences on the FGT1 side:
AS Path Prepending:
Advertised routes on FGT1 to the other end:
Received routes at the FGT2 end:
|
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 2024 Fortinet, Inc. All Rights Reserved.