Created on
10-06-2022
04:48 AM
Edited on
12-18-2025
10:01 PM
By
Anthony_E
Description
This article describes a configuration where the FortiGate has multiple captive portal interfaces, each of which have their own separate FQDN for the authentication portal that clients are redirected to. This is paired with a DNS server (in this case the FortiGate) to allow clients to resolve these FQDNs to the respective FortiGate IP address.
Scope
FortiOS v7.0.6 and newer versions.
Solution
FortiGate captive portals work by intercepting user web traffic and redirecting those users to a local authentication portal. By default, the portal URL uses the FortiGate's IP address (e.g., https://192.168.100.1:1003/fgtauth?[...] ), but this can be changed to an FQDN instead.
Before v7.0.6, it was only possible to set a global FQDN using the portal-addr option under config firewall auth-portal.
However, in v7.0.6 and later it became possible to set this captive portal FQDN on a per-interface/wireless SSID basis using the auth-portal-addr option:
config system interface
edit <name>
set security-mode captive-portal <--- Must be set first before the other options appear.
set auth-cert <certificate_name>
set auth-portal-addr <fqdn_string>
next
end
For more in-depth information discussing these options, refer to the following KB article: Technical Tip: Multiple addresses for the authentication portal
Historical Background:
One issue with setting a global captive portal FQDN is that all captive portals on the FortiGate would share this FQDN. However, this is a problem since the captive portal FQDN must only resolve to a single IP address or clients may be unable to reliably connect to the portal (DNS round-robin may result in connection attempts to unreachable IP addresses).
One method of resolving this issue was to use separate DNS servers per captive portal network segment and have each server resolve the captive portal FQDN to a different IP address. Consider the following example topology:
The major downside of the above design is that it requires the administrator to manage multiple separate DNS servers (or alternatively requires a DNS server capable of resolving an FQDN with different IPs depending on where the query came from). If a single shared FQDN must be used across all captive portals on the FortiGate then consider using the following KB article instead, as it uses a loopback interface to solve the issue: Technical Tip: Configuring shared FQDN for Captive Portal on the FortiGate using Loopback interfaces.
Configuring separate FQDNs for each Captive Portal interface:
As noted above, FortiOS 7.0.6 and later adds the ability to set separate captive portal FQDNs and certificates on a per-interface/SSID basis. At least one DNS server is still necessary to resolve these FQDNs to the proper FortiGate interface IP, but in this case the FortiGate can function as that DNS server for each of the local network segments.
In the above example topology, port2 and port3 are both captive portal networks, and port1 is connected to the Internet. To configure the above design, use the following steps:
config system interface
edit 'port2'
set vdom 'root'
set ip 192.168.100.1 255.255.255.0
set security-mode captive-portal
set auth-portal-addr 'fgt.captive1.test.lab'
set security-groups <Group1 Group2...>
next
edit 'port3'
set vdom 'root'
set ip 192.168.200.1 255.255.255.0
set security-mode captive-portal
set auth-portal-addr 'fgt.captive2.test.lab'
set security-groups <Group1 Group2...>
next
end
config system dhcp server
edit 2
set dns-service local <--- Instruct clients to use local FortiGate IP for DNS.
set default-gateway 192.168.100.1
set netmask 255.255.255.0
set interface 'port2'
config ip-range
edit 1
set start-ip 192.168.100.2
set end-ip 192.168.100.254
next
end
next
edit 3
set dns-service local <--- Instruct clients to use local FortiGate IP for DNS.
set default-gateway 192.168.200.1
set netmask 255.255.255.0
set interface 'port3'
config ip-range
edit 1
set start-ip 192.168.200.2
set end-ip 192.168.200.254
next
end
next
end
config firewall policy
edit 1
set name 'Captive_port2_to_Internet'
set srcintf 'port2'
set dstintf 'port1'
set action accept
set srcaddr 'all'
set dstaddr 'all'
set schedule 'always'
set service 'ALL'
set nat enable
set groups <Group1 Group2...>
next
edit 2
set name 'Captive_port3_to_Internet'
set srcintf 'port3'
set dstintf 'port1'
set action accept
set srcaddr 'all'
set dstaddr 'all'
set schedule 'always'
set service 'ALL'
set nat enable
set groups <Group1 Group2...>
next
end
config system dns-server
edit 'port2'
next
edit 'port3'
next
end
config system dns-database
edit 'test.lab'
set domain 'test.lab'
config dns-entry
edit 1
set hostname 'fgt.captive1'
set ip 192.168.100.1
next
edit 2
set hostname 'fgt.captive2'
set ip 192.168.200.1
next
end
next
end
Verification:
The following screenshots show the expected results when clients connect to the FortiGate's captive portal network. Note the captive portal URL in the client web browser and the DNS results when the client queries the FortiGate for the captive portal FQDN:
Client connected to port2 captive portal network.
Client connected to port3 captive portal network.
Related Documents:
Technical Tip: Multiple addresses for the authentication portal
Technical Tip: DNS traffic is allowed through captive portal without authentication
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.