This article describes a configuration where the FortiGate has captive portal authentication enabled on multiple interfaces and the captive portal redirects to a single FQDN that is associated with a local Loopback interface.
This configuration is be useful in cases where administrators want to have a single FQDN that can be used by multiple different captive portal networks, and it is an alternative option to the configuration proposed in the following KB article: Technical Tip: FortiGate configured with multiple captive portals and as a DNS server
FortiGate, Captive Portal
By default, the URL used for local captive portal authentication on the FortiGate is based on the interface IP address assigned to the FortiGate (e.g., https://192.168.100.1:1003/fgtauth?[...]).
This can be overridden on the FortiGate to use an FQDN instead (which is generally required when configuring proper HTTPS communication with certificates) and can be done either globally or on a per-interface basis. See also: Technical Tip: Multiple addresses for the authentication portal
In the case of a single captive portal setup on the FortiGate, either option may be used with little difference. However, consider the following pros/cons between the two options when multiple captive portals are configured on the FortiGate:
|
Single shared FQDN used across multiple captive portals (e.g. 'portal.example.com') |
Multiple separate FQDNs used for each captive portal (e.g. 'portal1.example.com', 'portal2.example.com', etc.) |
|
Pros:
Cons:
|
Pros:
Cons:
|
This article will focus on the former case and will use a loopback interface to overcome the downsides mentioned above. A loopback interface will allow the shared captive portal FQDN to resolve to a single address, and administrators can allow captive portal clients to make connections to this destination IP address/interface for authentication purposes without needing to grant access to other physical networks connected to the FortiGate.
Note:
Administrators who want to implement per-interface captive portal FQDNs should instead refer to the KB article linked in the Description above.
Configuring Shared Captive Portal FQDN using a Loopback interface
Use the following steps to configure captive portals that redirect to a loopback interface for authentication. This configuration is an enhancement that builds on top of a basic captive portal configuration. Review the following document for more info on basic captive portal setup: Captive portals
Additionally, this example configuration will demonstrate using the FortiGate as a local DNS server to handle resolution of the captive portal FQDN, though an external DNS server could be used instead:
config firewall auth-portal
set portal-addr 'portal.example.com'
end
Captive Portal settings on user-facing interface
Captive Portal settings on loopback interface
config firewall policy
edit 1
set name 'Captive Portal Users to Loopback'
set srcintf 'VLAN160' <----- Captive Portal interface for users.
set dstintf 'lo0' <----- Loopback interface.
set action accept
set srcaddr 'all'
set dstaddr 'all'
set schedule 'always'
set service 'ALL'
set captive-portal-exempt enable <----- Traffic matching this policy is exempt from the captive portal.
next
edit 2
set name 'Captive Portal Internet'
set srcintf 'VLAN160'
set dstintf 'SDWAN'
set action accept
set srcaddr 'all'
set dstaddr 'all'
set schedule 'always'
set service 'ALL'
set nat enable
set groups 'LAN_Users'<--- Users in this group can match this Firewall Policy.
next
end
config system dns-database
edit 'example.com'
set domain 'example.com'
config dns-entry
edit 1
set hostname 'portal'
set ip 172.31.255.1
next
end
next
end
Verification:
After configuring the above, users who connect to the captive portal network will be redirected to the portal-addr FQDN specified under config firewall auth-portal. This FQDN will be resolved via DNS to the IP address of the loopback interface, and from there, the user will be presented with a captive portal for authentication.
Once the user is successfully authenticated, a corresponding entry will be created in the Firewall Users dashboard widget that shows the authenticated user information (the same information is also visible in the CLI with the command 'diagnose firewall auth list').
Related documents:
Technical Tip: FortiGate configured with multiple captive portals and as a DNS server
Technical Tip: Multiple addresses for the authentication portal
Technical Tip: Change the FortiGate Captive Portal Port
Troubleshooting Tip: How to troubleshoot if captive portal not getting triggered in the firewall
Troubleshooting Tip: General captive portal explanation, flow and troubleshooting
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.