Description
This article describes information about the dynamic gateway for DHCP/PPPoE-type interfaces.
Scope
FortiGate.
Solution
To configure static route for the DHCP/PPPoE interface with dynamic gateway, follow the instructions below.
The routing table shows as below when the 'defaultgw' option from CLI is enabled on the interface, it is seen to have a default route installed in the routing table by itself.
Routing table for VRF=0
S* 0.0.0.0/0 [10/0] via 10.1.1.254, wan1, [1/0]
[10/0] via 10.2.2.254, ppp2, [10/0]
From the GUI the same option is known as 'retrieve default gateway'.
To add the static route manually for them, first, set the interface to not get the Dynamic Gateway by disabling the 'defaultgw' from the CLI or by disabling 'Retrieve default gateway from server' from the GUI:
config system interface
edit <wan interface name>
set role wan
set defaultgw disable
end
With the option 'defaultgw' disabled routing table shows the static route of the PPPoE interface is removed.
Routing table for VRF=0
S *> 0.0.0.0/0 [10/0] via 10.1.1.254, wan1, [1/0]
C *> 10.109.16.0/20 is directly connected, wan1
Now configure the static route either via the CLI or GUI:
CLI:
config router static
edit 1
set dynamic-gateway enable
set device <interface name>
end
GUI:
The picture shown above is for the example DHCP interface, and the routing table shown below is an example taken for the PPPoE interface.
The routing table shows the following entry after adding a static route entry:
Routing table for VRF=0
S* 0.0.0.0/0 [10/0] via 10.1.1.254, wan1, [1/0]
[10/0] via 10.2.2.254, ppp2, [1/0]
In this way, the dynamic-gateway hides the gateway variable for a dynamic interface, such as a DHCP or PPPoE interface.
When the interface connects or disconnects, the corresponding routing entries are updated to reflect the change by itself.
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 2025 Fortinet, Inc. All Rights Reserved.