Description |
This article describes how to secure an interface with captive portal enabled. By default, if captive portal is enabled with a local portal, the user's browser will be redirected to the FortiGate interface IP and port. This workaround makes it possible to hide the interface IP address from the browser URL display. |
Scope | All supported versions of FortiOS. |
Solution |
Create a DNS database on the FortiGate. Any FQDN can be used according to individual requirements. The listening interface with captive portal should be configured as recursive DNS.
The DNS related settings must be set up as follows:
Go to Network -> DNS Server and create the following settings:
Now, add a DNS database for the record:
Since this entry has been configured with a recursive server as a FortiGate LAN (port3) interface, it is necessary to specify that the user system should use the DNS server as the FortiGate interface. If the interface is enabled with DHCP, manually specify the DNS server to push on the end machine.
After configuring the DNS server as 10.135.13.43 in the user system, the DNS resolution should work properly:
Now, it is necessary to set up the default portal address as a configured FQDN on the DNS database on FortiGate:
config firewall auth-portal iron-kvm14 (auth-portal) # sh full config firewall auth-portal set portal-addr '' end
set portal-addr prince.Fg2_auth <- By default, FortiGate will present an Interface IP and port 1000. end
Now, if the user tries to browse anything, the captive portal page will not show an Interface IP address in the URL section:
Authd debug:
authd_fnbam_locked_out: username=prince, src_addr=10.135.2.31, n_failures=0, record_ttl=-2942155 pid=2012, auth_rsp_data=0x7ffcf6f69020
Note: To achieve this, the user has 2 options: either map this FQDN to an interface IP on the local DNS, or use the above method on FortiGate. However, the recommended way is to perform this FQDN mapping on a local DNS server.
Related article for captive portal: Technical Tip: Captive portal authentication with users as members of multiple groups |