Description |
The article describes the advertisement of BGP routes with the 'network' command and the importance of making the route prefix the same as in the routing table. |
Scope | All FortiGate or VDOM running in NAT mode. |
Solution |
The following is a simple BGP configuration with no additional settings and neighbor information:
config router bgp config neighbor end
For example, the following directly connected networks are in the routing table:
get router info routing-table all Routing table for VRF=0
When advertising the 10.109.16.0/20 network using a different subnet (/16 in this example), the following will be seen:
config router bgp config network end
get router info bgp neighbors 10.109.49.20 advertised-routes
get router info bgp network
In this case, there are two options:
config router bgp config network edit 1 set prefix 10.109.16.0 255.255.240.0 next end end
get router info bgp neighbors 10.109.49.20 advertised-routes Network Next Hop Metric LocPrf Weight RouteTag Path Total number of prefixes 1
get router info bgp network Network Next Hop Metric LocPrf Weight RouteTag Path Total number of prefixes 1
config router bgp config aggregate-address edit 1 set prefix 10.109.0.0 255.255.0.0 set summary-only enable next end end
get router info bgp neighbors 10.109.49.20 advertised-routes Network Next Hop Metric LocPrf Weight RouteTag Path Total number of prefixes 1
get router info bgp network VRF 0 BGP table version is 2, local router ID is 10.109.49.1 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 *> 10.109.0.0/16 0.0.0.0 32768 0 i <-/1> s> 10.109.16.0/20 0.0.0.0 100 32768 0 i <-/1>
Here, the āsā in front of the /20 network indicates this route is suppressed by BGP.
Related article: Technical Tip: How to implement BGP route summary (aggregation) on a FortiGate |