Captive Portal Security
Captive portal security provides an access point that initially appears open. The wireless client can connect to the AP with no security credentials. The AP responds to the client’s first HTTP request with a web page requesting user name and password. Until the user enters valid credentials, no communication beyond the AP is permitted.
The captive portal can be hosted on the FortiGate unit, or externally.
Configuring WiFi captive portal security - FortiGate captive portal
The built-in FortiGate captive portal is simpler than an external portal. To configure a captive portal, you need to create an SSID, apply the SSID to the FortiAP, and create a policy from the SSID to the Internet.
The following shows a simple network topology for this recipe:
To configure a WiFi Captive Portal - GUI
- Create a local user:
- Go to User & Authentication > User Definition, then click Create New.
- In the Users/Groups Creation Wizard, select Local User, then click Next.
- Enter the desired values in the Username and Password fields, then click Next.
- On the Contact Info tab, fill in any information as desired, then click Next. You do not need to configure any contact information for the user.
- On the Extra Info tab, set the User Account Status to Enabled.
- If the desired user group already exists, enable User Group, then select the desired user group.
- Click Submit.
- Create a user group:
- Go to User & Authentication > User Definition, then click Create New.
- Enter the desired group name.
- For Type, select Firewall.
- For Members, click the + button. In the dropdown list, select the local user you created in step 1 and click OK.
- Click OK.
- Create a captive portal SSID:
- Go to WiFi and Switch Controller > SSIDs, click Create New and select SSID.
- Enter the desired interface name. For Traffic mode, select Tunnel.
- In the Address > IP/Network Mask field, enter the IP address. DHCP Server is enabled by default. You can modify the DHCP IP address range manually.
- In the SSID field, enter the desired SSID name. For Captive Portal, select Security.
-
Configure the following:
Portal Type
The portal can provide authentication and/or disclaimer, or perform user email address collection.
To enable email collection, go to System > Feature Visibility, and enable Email Collection, then select Email Collection for Portal Type.
Authentication Portal
Local
User Groups
Select permitted user groups or select Use Groups from Policies, which permits the groups specified in the security policy.
Exempt List
Select exempt lists whose members will not be subject to captive portal authentication.
Customize Portal Messages
Click the link of the portal page that you want to modify. For more information see the Captive Portal chapter of the Authentication Guide.
- Click OK.
- Select the SSID on a managed FortiAP. The following configuration is based on a example using a managed FortiAP-320C and a "FAP320C-default" profile that is applied to the FortiAP-320C. Do one of the following:
- Select the SSID by editing the FortiAP:
- Go to WiFi and Switch Controller > Managed FortiAPs. Select the FortiAP-320C and click Edit.
- Ensure that Managed AP Status is Connected.
- Under WiFi Setting, ensure that the configured FortiAP profile is the desired profile, in this case FAP320C-default. Click Edit entry.
- To broadcast the SSID from 2.4 G radio, scroll to Radio 1 > SSIDs. Select Manual, then click + to create the Fortinet-PSK SSID.
- To broadcast the SSID from 5 G radio, scroll to Radio 2 > SSIDs. Select Manual, then click + to create the Fortinet-PSK SSID.
- Click OK.
- Select the SSID by editing the FortiAP profile:
- Go to WiFi and Switch Controller > FortiAP Profiles. Select the FAP320C-default profile, then click Edit.
- To broadcast the SSID from 2.4 G radio, scroll to Radio 1 > SSIDs. Select Manual, then click + to create the Fortinet-PSK SSID.
- To broadcast the SSID from 5 G radio, scroll to Radio 2 > SSIDs. Select Manual, then click + to create the Fortinet-PSK SSID.
- Click OK.
- Select the SSID by editing the FortiAP:
- Create the SSID-to-Internet firewall policy:
- Go to Policy & Objects > Firewall Policy, then click Create New.
- Enter the desired policy name.
- From the Incoming Interface dropdown list, select the source interface, such as wifi-vap.
- From the Outgoing Interface dropdown list, select the destination interface, such as wan1.
- In the Source and Destination fields, select all. In the Service field, select ALL. If desired, you can configure different values for these fields.
- Click OK.
To deploy captive portal SSID to FortiAP units - CLI
- Create a local user:
config user local
edit "local"
set type password
set passwd ***
next
end
- Create a user group:
config user group
edit "group-local"
set member "local"
next
end
- Create a captive portal SSID. Do one of the following:
- Create a captive portal SSID with portal type Authentication:
config wireless-controller vap
edit "wifi-vap"
set ssid "Fortinet-Captive"
set security captive-portal
set portal-type auth
set selected-usergroups "group-local"
next
end
- Create a captive portal SSID with portal type Disclaimer + Authentication:
config wireless-controller vap
edit "wifi-vap"
set ssid "Fortinet-Captive"
set security captive-portal
set portal-type auth+disclaimer
set selected-usergroups "group-local"
next
end
- Create a captive portal SSID with portal type Disclaimer Only:
config wireless-controller vap
edit "wifi-vap"
set ssid "Fortinet-Captive"
set security captive-portal
set portal-type disclaimer
next
end
- Create a captive portal SSID with portal type Email Collection:
config wireless-controller vap
edit "wifi-vap"
set ssid "Fortinet-Captive"
set security captive-portal
set portal-type email-collect
next
end
- Configure an IP address and enable DHCP:
config system interface
edit "wifi-vap"
set ip 10.10.80.1 255.255.255.0
next
end
config system dhcp server
edit 1
set dns-service default
set default-gateway 10.10.80.1
set netmask 255.255.255.0
set interface "wifi-vap"
config ip-range
edit 1
set start-ip 10.10.80.2
set end-ip 10.10.80.254
next
end
set timezone-option default
next
end
- Create a captive portal SSID with portal type Authentication:
- Select the SSID on a managed FortiAP. The following configuration is based on a example using a managed FortiAP-320C and a "FAP320C-default" profile that is applied to the FortiAP-320C:
config wireless-controller wtp
edit "FP320C3X14000640"
set admin enable
set wtp-profile "FAP320C-default"
next
end
config wireless-controller wtp-profile
edit "FAP320C-default"
config radio-1
set vap-all disable
set vaps "wifi-vap"
end
config radio-2
set vap-all disable
set vaps "wifi-vap"
end
next
end
- Create the SSID-to-Internet firewall policy:
config firewall policy
edit 1
set name "WiFi to Internet"
set srcintf "wifi-vap"
set dstintf "wan1"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set fsso disable
set nat enable
next
end
Configuring WiFi captive portal security - external server
An external captive portal is a web page on a web server. The essential part of the web portal page is a script that gathers the user’s logon credentials and sends back to the FortiGate a specifically-formatted POST message. The portal page can also contain links to local information such as legal notices, terms of service and so on. Without authenticating, the user cannot access any other information. This is sometimes called a "walled garden".
On the captive portal page, the user submits credentials, which the script returns to the FortiGate at the URL https://<FGT_IP>:1000/fgtauth
with data magic=session_id&username=<username>&password=<password>
.
(The magic value was provided in the initial FortiGate request to the web server.)
To ensure that credentials are communicated securely, enable the use of HTTPS for authentication:
config user setting
set auth-secure-http enable
end
To configure use of an external WiFi Captive Portal - GUI:
- Go to WiFi and Switch Controller > SSIDs and create your SSID.
If the SSID already exists, you can edit the SSID or you can edit the WiFi interface in Network > Interfaces. - In Security Mode, select Captive Portal.
- Enter
- Select OK.
Portal Type |
The portal can provide authentication and/or disclaimer, or perform user email address collection. |
Authentication Portal |
External - enter the FQDN or IP address of the external portal. Typically, this is the URL of a script. Do not include the protocol (http:// or https://) part of the URL. |
User Groups |
Select permitted user groups or select Use Groups from Policies, which permits the groups specified in the security policy. |
Exempt List |
Select exempt lists whose members will not be subject to captive portal authentication. |
Redirect after Captive Portal |
Original Request |