Created on
03-17-2021
06:24 AM
Edited on
08-31-2025
09:30 PM
By
Anthony_E
Description
This article describes an example of configuring an interface and firewall policies on a FortiGate.
Scope
FortiGate.
Solution
Basic Topology.
Configuring LAN interfaces.
<Optional> To assign IP addresses to devices on the internal network, enable DHCP Server.
config system interface
edit "lan"
set secondary-IP enable
config secondaryip
edit 1
set ip 192.168.98.99 255.255.255.0
Set allowaccess {http https ping snmp ssh telnet}
next
end
next
end
GUI:
DNS Configuration:
Configuring DNS is necessary for internet access. Users can go to Network -> DNS to set FortiGuard DNS servers or any preferred DNS servers, ensuring name resolution for internal devices.
Adding a default route.
From CLI to change 'distance' and 'priority':
config system interface
edit wan1
set priority 1 <----- Change to desired priority.
set distance 5 <----- Change to desired distance.
end
Note:
By default, the manual static route will use Administrative Distance 10.
For wan1, distance can be modified from GUI but the priority can only be changed from CLI . These changes will be made on wan1 interface.
config system interface
edit "wan1"
set mode dhcp
set distance 5 <----- Distance is set to 5 for DHCP wan1 interface. (Default AD is 5.)
set priority 1 <----- Priority for wan1 is set to 1 as it is set as primary WAN connection.(Default Priority is 1.)
next
end
For wan2 as it is set on manual mode, the distance and priority can be created or modified from Network -> Static Routes.
CLI:
config router static
edit 7
set gateway 10.10.10.1
set distance 5 <----- Distance is set to 5 for wan2 interface. (Default AD is 10.)
set priority 10 <----- Priority for wan1 is set to 1 as it is set as primary wan connection. (Default Priority is 1.)
set device “wan2”
NAT Settings in Policy:
When creating the policy to allow internet access, it’s important to check that NAT is enabled. In Policy & Objects -> Firewall Policy, under Firewall/Network Options, select NAT to translate private IP addresses to the public IP on the WAN interface.
Security Profile Configuration:
Security Profiles (like Antivirus, Web Filter, and Intrusion Prevention) can be added to the policy for internet-bound traffic. This enhances security for outbound traffic by protecting against threats from the internet.
Logging and Monitoring:
Recommend enabling logging for the policy to monitor traffic. Users can enable Log Allowed Traffic under Policy & Objects -> Firewall Policy and choose to log all sessions or only security events. This allows users to monitor internet access logs in Log & Report -> Forward Traffic.
Browse the Internet using the PC on the internal network.
Related article:
Technical Tip: PPPoE interface option not available from GUI
Note:
When assigning a manual IP on the “Configuring LAN interfaces > IP/Network Mask” step; it is possible to set up a DHCP Server range by toggling off/on the DHCP server button and the FortiGate device will assign automatically the correct range with in the manually assigned IP address host range or availability.
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.