Description | This article provides explanations on how to redistribute the default route in OSPF with different metrics, so the peer will get the route with a lower than the default metric of 10. |
Scope | FortiGate. |
Solution |
The following syntax is used to advertise a default route in OSPF on a FortiGate.
config router ospf(ospf) set default-information-originate <option>
Available options are as follows:
To prevent advertising a default route to some OSPF neighbors behind specific OSPF interfaces:
In the GUI, note the same options:
config router ospf set default-information-originate enable set default-information-metric 1 <- It is possible to use metric if needed. set default-information-metric-type type 1 | type2
The result is the following external LSA generated from the advertising FortiGate:
LS age: 551 Options: 0x2 (*|-|-|-|-|-|E|-) LS Type: AS-external-LSA Link State ID: 0.0.0.0 (External Network Number) Advertising Router: 172.16.20.2 LS Seq Number: 80000001 Checksum: 0xb475 Length: 36 Network Mask: /0 Metric Type: 2 <- Larger than any link state path. TOS: 0 Metric: 1 Forward Address: 10.200.1.1 External Route Tag: 0
In the routing table of the peer, it is possible to confirm that the route is with a metric of 1:
get router info routing-table data Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area > - selected route, * - FIB route, p - stale info
E2 0.0.0.0/0 [110/1] via 10.200.1.1, port1, 00:22:17 S *> 0.0.0.0/0 [10/0] via 172.16.31.254, port10
Run the following command to check if the default route is advertised:
show router ospf database external
Technical Tip: OSPF configuration guide for ABR and ASBR settings Technical Tip: simple OSPF configuration with 2 FortiGates in the same area Technical Tip: OSPF route summarization for LSAs Type 3 (on ABR) and Type5 (on ASBR) Technical Tip: OSPF static route redistribution example |