Skip to main content
Esteemed Contributor III
Apr 8, 2009 8:23 AM UTC

Technical Tip: How to configure a FortiGate interface to use DHCP

  • Sep 28, 2026 5:47 AM UTC
  • 0 replies
  • 20471 views
  • Translate All

Description

 

This article describes how a user can configure a FortiGate interface to use DHCP (Dynamic Host Configuration Protocol). DHCP is a way to assign automatically an IP address to a network device.


In a FortiGate where an interface IP is assigned by an ISP, DHCP may have to be used.  In these scenarios an ISP will often also provide a Default Route and the DNS settings.


Scope

 

Applies only to:


Solution

 

Configuration (GUI):

  1. Log in to the FortiGate.

  2. From the navigation pane, go to Network -> Interfaces.

  3. Edit the interface connecting to the ISP by selecting the 'edit' icon.

  4. Change the addressing mode to DHCP.

  5. Enable 'Retrieve default gateway from server'. This will place a default route in the routing table with a distance as shown in the distance field. In this example, the distance is 5.

  6. If the ISP also provides DNS settings, enable 'Override internal DNS' to use the DNS addresses retrieved from the DHCP server instead of the DNS server IP addresses configured on the DNS page.

  7. Select OK.

  8. The 'Status' should change to connected and show the IP information obtained (IP address, default gateway, DNS).

GUI page: FortiGate Interface to use DHCP.

 

Picture1.png

 

Example configuration in the CLI: 

 

config system interface
    edit "port1"
        set mode dhcp
        set defaultgw enable
        set dns-server-override enable
    next
end

 

Note: When 'Retrieve default gateway from server' is enabled on a DHCP interface, the default route has a priority of 1. When multiple routes have the same administrative distance, the route with the lower priority value takes precedence. The administrative distance can be changed in the GUI, but the route priority cannot. To change the route priority, run the following commands in the CLI:

 

 config system interface
     edit "port1"
        set priority 25
     next
end

    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