Skip to main content
agodbole
Staff
Staff
Feb 14, 2018 7:40 AM UTC

Technical Tip: Basic OSPF configuration and MTU settings in OSPF

  • Oct 14, 2026 6:24 AM UTC
  • 0 replies
  • 15217 views
  • Translate All

Description

 

This article describes basic OSPFv2 configuration on FortiGate, the purpose and concepts of OSPF's MTU configuration.

 

Scope

 

FortiGate.

 

Solution

 

Default OSPF configuration

 

When configuring OSPF on the FortiGate, there are four core components that must be configured:

  1. OSPF router ID (set router-id)

  2. Area configuration (config area)

  3. Network Configuration (config network)

  4. OSPF Interface Configuration (config ospf-interface)

 

Notably, the network entries are used to map the associated interface to a given OSPF area, and the OSPF interface entry is used to customize interface specific settings, such as MTU, cost, network type.

 

config router ospf
    set router-id 10.255.255.1
    config area
        edit 0.0.0.0
        next
    end
    config network
        edit 1
            set prefix 192.0.2.0 255.255.255.0
            set area 0.0.0.0
        next
    end
    config ospf-interface
        edit "OSPF-port1"
            set interface "port1"
        next
    end
end

 

MTU and OSPF adjacency

  • The IP MTU is the largest IP packet that an interface can transmit without fragmentation. Standard Ethernet commonly uses an IP MTU of 1500 bytes; this excludes the Ethernet header and frame check sequence.

  • OSPFv2 carries the Interface MTU field in Database Description (DBD/DD) packets. According to RFC 2328, Section 10.6, a router rejects a received DBD packet when the advertised MTU exceeds the receiving interface's capacity to accept the IP datagram without fragmentation.

  • An MTU mismatch can therefore prevent database synchronization and leave an adjacency in ExStart or Exchange. Matching the relevant MTUs on both neighbors avoids this cause of adjacency failure, although other OSPF parameters must also be compatible.

 

Default MTU value and CLI option to change it.

OSPF can only establish an adjacency when the MTU values of the two peer routers are matching. By default, the MTU configuration option is available under config router ospf -> config ospf-interface hierarchy, with FortiOS specifying a default MTU value of 1500 on all FortiOS versions.

 

Distinguish interface MTU from OSPF MTU settings

  • Interface-level MTU values can be set with set mtu-override enable and set mtu <value> under config system interface (default is 1500 bytes):

config system interface
    edit "LAG.Test"
        set mtu-override enable
        set mtu 9000
    next
end


  • The OSPF configuration can also directly define an MTU value that is advertised in the OSPF DBD packets. This does not increase the underlying interface's MTU but does take precedence over it for OSPF adjacency purposes:

config router ospf
    config ospf-interface
        edit "OSPF-port1"
            set interface "port1"
            set mtu 1436
        next
    end
end


  • Alternatively, the OSPF interface configuration can use set mtu-ignore enable to bypass the MTU check on that OSPF interface. This allows OSPF to potentially establish an adjacency regardless of the link MTU for each router, but larger packets may still encounter fragmentation/drops. It is recommended to match MTUs where possible as best practice.

config router ospf
    config ospf-interface
        edit "OSPF-port1"
            set interface "port1"
            set mtu-ignore enable
        next
    end
end

 

Examples to manually configure MTU value in OSPF:

 

The default values of all the parameters can be seen by checking the 'full-configuration'. For example:

 

FGT (ospf) # show full-configuration 
config ospf-interface
    edit "ospf"
        ...
            set mtu 0
        ...
    next
end

 

The default value of MTU size under the OSPF interface is seen as '0'. This implies that ospf-interface does not change the default MTU value of 1500.

To change this value, modify set mtu for the entry under config ospf-interface. For example:

 

config ospf-interface
    edit <name>
        set mtu <1436>
    next
end

 

MTU can also be ignored:

 

config router ospf
    config ospf-interface
        edit int_1
            set mtu-ignore enable
        next
    end
end

 

Note:

This configuration is necessary when jumbo frame is enabled on the neighbor's interface. Since FortiGate does not support Jumbo frames by default (as the default MTU is 1500), it has to be enabled at the interface level by using an MTU size of 9000 for instance on the interface that is participating in the OSPF configuration.

 

config system interface
    edit port <x>
        set mtu-override enable
        set mtu 9216 <----- MTU Value.
    next
end

 

Considerations for increasing interface MTU value on parent interface:

 

When the MTU of a parent interface, such as a LAG, is increased to support jumbo frames, dependent virtual interfaces such as VLAN interfaces inherit the updated value unless an explicit MTU override is configured.

 

For example, consider a LAG interface with associated VLAN interfaces running OSPF. The parent interface is configured with an MTU of 9216 bytes. When no explicit OSPF MTU override is configured, OSPF uses the effective interface MTU in its DBD packets sent over that VLAN interface to its OSPF neighbor. If this value exceeds the MTU accepted by a neighboring router inside the VLAN, the adjacency fails and remain in the ExStart or Exchange state. Before changing the parent interface MTU, verify MTU compatibility across the affected VLAN interfaces and their OSPF neighbors.

 

In this example, the LAG.Test interface MTU has been increased to 9216, which has impacted OSPF adjacency for the connected vlan.20 interface due to MTU mismatch:

FortiGate # show system interface LAG.Test
config system interface
    edit "LAG.Test"
        [...]
        set mtu-override enable
        set mtu 9216
        [...]
    next
end

FortiGate # diagnose netlink interface list LAG.Test
if=LAG.Test family=00 type=1 index=32 mtu=9216 link=0 master=0
if=vlan.20 family=00 type=1 index=34 mtu=9216 link=0 master=0
ref=14 state=start present no_carrier fw_flags=0 flags=up broadcast multicast 

FortiGate # get router info ospf interface vlan.20
vlan.20 is down, line protocol is down
  Internet Address 10.75.47.1/24, Area 0.0.0.75, MTU 9216
[...]

 

To resolve the issue, the MTU advertised by the OSPF interface should be lowered to match the other peers:

config router ospf
    config ospf-interface
        edit "vlan.20"
            set interface "vlan.20"
            set mtu 1500
        next
    end
end

 

Which, resolves the adjacency issue by separating the OSPF-advertised interface MTU from the real network interface MTU:

FortiGate # get router info ospf interface vlan.20
vlan.20 is up, line protocol is up
  Internet Address 10.75.47.1/24, Area 0.0.0.75, MTU 1500
[...]

FortiGate # diagnose netlink interface list vlan.20
if=vlan.20 family=00 type=1 index=34 mtu=9216 link=0 master=0

 

Related articles:

Technical Note: MTU size and Jumbo frames support on FortiGate devices 

Technical Tip: Set up a jumbo frame in the IPsec VPN interface 

Technical Tip: How to configure OSPF with virtual-link

Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024