FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
sselvam
Staff
Staff
Article Id 189436

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'.

 

kb 34.1.png

 

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: 

 

kb 34.2.png

 

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.