Configuring wildcard address in captive portal walled garden
This topic describes how to add and apply wildcard domain names to the walled garden of captive-portal SSID.
Captive portal SSID supports the walled garden function where WiFi clients can access preconfigured hostnames and addresses that are exempted from portal authentication.
You can configure FQDN entries using wildcard domain names, for example, *.google.*
, *.facebook.com
, and so on, so that one entry can have multiple matches.
Sample topology
This example uses the wildcard address feature in the following ways:
- A tunnel mode captive portal works with the third-party cloud based portal server cloud4wi.com.
- Connected wireless clients can access Facebook and Google websites directly even before firewall authentication via FortiGate.
- Connected wireless clients opens the portal page of cloud4wi.com and can access other Internet resources as soon as they pass authentication by FortiGate.
Sample configuration
To create the wildcard FQDN address - GUI:
- Go to Policy & Objects > Addresses and click Create New > Address.
- In the New Address page, enter the address Name, for example,
facebook
andgoogle
. - For Type, select FQDN.
- For FQDN, enter a wildcard FQDN name, for example
*.facebook.com
and*.google.*
. - Click OK.
This wildcard FQDN type firewall address is different from entries in Policy & Objects > Wildcard FQDN Addresses that cannot be used directly in firewall policy source or destination addresses. |
To create a third-party cloud portal server address - GUI:
- Go to Policy & Objects > Addresses and click Create New > Address.
- In the New Address page, enter the address Name, for example,
cloud-portal
. - For Type, select FQDN.
- For FQDN, enter the FQDN name, for example,
cloud4wi.com
. - Click OK.
To create a captive portal VAP with the third-party cloud portal server - GUI:
- Go to WiFi Controller > SSID and select Create New > SSID.
- For Traffic Mode, select Tunnel.
- In the Address section, enter the IP/Network Mask, for example,
10.10.80.1/24
. - Optionally, you can change the DHCP Address Range in the DHCP Server section.
- In the WiFi Settings section:
- Enter the SSID name, for example,
Fortinet-Captive
. - For Security Mode, select Captive Portal.
- For Portal Type, select Authentication.
- For Authentication Portal, select External and enter
cloud4wi.com
. - Click User Groups and select the created user group, for example,
group-local
; or click Create to create a new user group.
- Enter the SSID name, for example,
- Click OK.
To support a third-party cloud portal, use one of the following methods.
To support a third-party cloud portal using Exempt Destinations/Services - GUI:
- Go to WiFi Controller > SSID.
- Select the SSID you created, for example,
Fortinet-Captive
and click Edit. - In the WiFi Settings section, click Exempt Destinations/Services.
- In the Select Entries pane Address list, select the wildcard FQDN addresses, for example,
facebook
andgoogle
, and the cloud portal address, for example,cloud-portal
. - Still in the Select Entries pane, click Service and select HTTP, HTTPS, and DNS.
- Click OK.
To support a third-party cloud portal using firewall policy - GUI:
- Go to Policy & Objects > Firewall Policy and click Create New.
- Enter the Name, for example, Exempt Service.
- Click Incoming Interface and select wifi-vap.
- Click Outgoing Interface and select wan1.
- Click Source and select all.
- Click Destination and select the wildcard FQDN addresses, for example,
facebook
andgoogle
, and the cloud portal address, for example,cloud-portal
. - Click Service and select HTTP, HTTPS, and DNS.
- Click OK.
- Use CLI commands to enable
captive-portal-exempt
. In this example, thepolicy_id
is2
.config firewall policy edit 2 set captive-portal-exempt enable next end
To create the wildcard FQDN address - CLI:
config firewall address edit "facebook" set type fqdn set fqdn "*.facebook.com" <-- New support for "*" in fqdn address next edit "google" set type fqdn set fqdn "*.google.*" <-- New support for "*" in fqdn address next end
To create a third-party cloud portal server address - CLI:
config firewall address edit "cloud-portal" set type fqdn set fqdn "cloud4wi.com" next end
To create a tunnel mode captive portal VAP with the third-party cloud portal server - CLI:
config wireless-controller vap edit "wifi-vap" set ssid "Fortinet-Captive" set security captive-portal set external-web "cloud4wi.com" set selected-usergroups "group-local" set intra-vap-privacy enable next end
To create security-exempt-list and select it in vap - CLI:
config user security-exempt-list edit "wifi-vap-exempt-list" config rule edit 1 set dstaddr "facebook" "google" "cloud-portal" set service "HTTP" "HTTPS" "DNS" next end end config wireless-controller vap edit "wifi-vap" set security-exempt-list "wifi-vap-exempt-list" next end
To create a captive-portal-exempt firewall policy and move it before the regular outgoing policy - CLI:
config firewall policy edit 2 set name "Exempt Service" set srcintf "wifi-vap" set dstintf "wan1" set srcaddr "all" set dstaddr "cloud-portal" "facebook" "google" set action accept set schedule "always" set service "DNS" "HTTP" "HTTPS" set captive-portal-exempt enable set nat enable next edit 1 set name "outgoing" set srcintf "wifi-vap" set dstintf "wan1" set srcaddr "all" set dstaddr "all" set action accept set schedule "always" set service "ALL" set nat enable next move 2 before 1 end
Although destination-hostname-visibility
is enabled by default, ensure this setting is enabled so that FQDN addresses can be resolved.
To enable destination-hostname-visibility
config system network-visibility set destination-hostname-visibility enable end