Example: Configuring a Redirect URL for Captive Portal (CLI)
You can redirect traffic to the currently connected Infranet Controller or to an IP address or domain name that you specify in a redirect URL. We recommend the default configuration that redirects traffic to the Infranet Controller for authentication.
If you need to override the default redirection destination, you can specify any combination of redirect options:
- https://<IP or domain name>/<URL path>/target=%dest-url%—Configure this option to forward users to the protected resource automatically after authentication with the Infranet Controller or webserver. The JUNOS Enforcer replaces the %dest-url% parameter with the protected resource URL and then forwards the protected resource URL in encrypted form to the Infranet Controller.
- https://<IP or domain name>/<URL path>—Configure this option for users to be redirected to the Infranet Controller authentication page but not be forwarded to the protected resource after authentication. Users must manually open a new browser window and enter the protected resource URL again after signing in.
- redirect-all—Specify this option if you want to redirect all traffic to the URL that you specify in a redirect URL.
In this example, you configure the URL to redirect traffic to the Infranet Controller and after authentication forward the traffic automatically to the protected resource.
Before you specify the redirect URL, make sure you configure the captive portal policy. For information about creating the captive portal policy, see Example: Creating a Captive Portal Policy on the JUNOS Enforcer (CLI).
To configure the redirect URL for the captive portal feature on the JUNOS Enforcer:
- Navigate to the services unified-access-control level of the configuration hierarchy. [edit]user@host# edit services unified-access-control
- Specify the redirect URL for the preconfigured
captive portal policy. [edit services unified-access-control]user@host# set captive-portal my-captive-portal-policy redirect-url https://my-website.com
- Navigate to the top level of the configuration
hierarchy.[edit services unified-access-control]user@host# top
- Confirm your configuration by entering
the show services command from configuration mode. If the
output does not display the intended configuration, repeat the configuration
instructions in this example to correct it.[edit]user@host# show servicesunified-access-control {captive-portal my-captive-portal-policy {redirect-url https://my-website.com;}}
- Commit the configuration if you are done
configuring the device.[edit]user@host# commit
For more information about the configuration statements used in this example, see the JUNOS Software CLI Reference.
Related Topics
- JUNOS Software Feature Support Reference for SRX Series and J Series Devices
- Understanding UAC in a JUNOS Environment
- Understanding the Captive Portal on the JUNOS Enforcer
- Understanding Captive Portal Configuration on the JUNOS Enforcer
- Understanding the Captive Portal Redirect URL Options