Fortinet FortiGate BGP Configuration
BGP routing configuration for FortiGate: eBGP and iBGP peers, route-maps, prefix lists, redistribution, and community settings via FortiOS CLI.
What is it?
FortiGate BGP runs within the 'config router bgp' block and supports eBGP and iBGP peering, route redistribution, and import/export route maps. FortiGate is commonly deployed as a dual-ISP edge firewall using eBGP to receive default routes (or full tables) from two ISPs, with SD-WAN health checks selecting the active path. FortiOS BGP supports MD5 authentication, graceful restart, and BFD for fast failure detection. Route policies use FortiGate route-maps and prefix-lists for filtering.
When to use
- ·Dual-ISP deployments where ISP peering with BGP provides failover and traffic engineering
- ·Data center deployments where FortiGate peers with spine switches for routing
- ·SD-WAN underlay where BGP dynamically advertises WAN prefixes
- ·Receiving a default route from ISP via BGP instead of static (enables ISP-side failover)
When NOT to use
- ·Single-ISP environments — a static default route is simpler and more stable
- ·Internal routing only — use OSPF inside your network; BGP for ISP/external peering
How it compares
Prerequisites
- →WAN interface IP must be reachable by the ISP peer (TCP 179)
- →AS number obtained from ISP for eBGP peering, or private AS (64512-65534) for iBGP
- →Route-maps and prefix-lists created before referencing them in neighbor config
- →Ensure firewall policy allows TCP 179 between the BGP peering IPs
Config Generator
Verification commands
get router info bgp summaryShow BGP peer status and prefix counts
ExpectedPeers show 'Established' state with non-zero MsgRcvd/MsgSent. 'Active' or 'Connect' means peering is not up.
get router info routing-table bgpShow BGP routes installed in the routing table
ExpectedLists BGP routes with 'B' prefix, next-hop, and metric. Missing routes indicate filtering.
get router info bgp neighbors <peer-ip> received-routesShow all routes received from a specific BGP peer
ExpectedLists all prefixes the peer is advertising. If empty, peer is not sending any routes.
Debug commands
diagnose ip router bgp level infoEnable BGP debug logging
WarningUse with caution. Disable after: 'diagnose ip router bgp level none'
Common mistakes & fixes
Further learning
Recommended books to go deeper on this topic.
BGP Design and Implementation
Randy Zhang & Micah Bartell · Cisco Press · The practical BGP bible — iBGP, eBGP, policies, communities, design patterns
Internet Routing Architectures
Sam Halabi · Cisco Press · BGP for ISPs and large enterprise — AS path, route reflectors, confederation