Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Broadband Subscriber Services User Guide
Table of Contents Expand all
list Table of Contents
keyboard_arrow_right

Configuring MS-MPC-Based or MX-SPC3-Based Converged HTTP Redirect Services

date_range 06-Dec-23

You can configure converged HTTP redirect services on MS-MPCs/MS-MICs. Starting in Junos OS Release 19.3R1, you can also configure converged HTTP redirect service provisioning on the MX-SPC3 services card if you have enabled Next Gen Services on the MX Series router.

Converged service provisioning separates service definition from service instantiation. After a service is defined, a service can be dynamically instantiated at subscriber login or by using a change of authorization (CoA) mid-session. Service instantiation uses only the name of the defined service, hiding all service details from system operators. Converged service provisioning supports service parameterization, which corresponds to dynamic variables within dynamic profiles.

For converged HTTP redirect services, this means that you define the service and service rules within a dynamic profile. The CPCD service rules are created dynamically based on the variables configured in the dynamic profile.

Optionally, you can choose to parameterize the redirect URL by including defining a redirect-url variable in the dynamic profile. The value of the variable is provided by a RADIUS VSA during subscriber bring-up or with a Change of Authorization (CoA) message. This enables you to customize the redirect URLs for each subscriber. You can define a default value for the URL that is used if no value is provided by RADIUS.

You configure the walled garden as a firewall service filter. It filters traffic so that only HTTP traffic destined outside the walled garden is passed to the dynamic service for processing. Just as for static HTTP redirect services, a service profile contains the service rules. You configure a service set outside the dynamic profile to associate the CPCD service profile with a specific ms service interface on an MS-MPC/MS-MIC or a vsp service interface on an MX-SPC3 services card. Within the dynamic profile, you apply the service set and the walled garden service filter to a dynamic interface.

Configuring a Walled Garden as a Firewall Service Filter

When you configure the walled garden as a firewall service filter, traffic that is destined to servers within the walled garden is identified and skipped. Because this traffic does not flow to the line card, handling requirements are reduced.

All other HTTP traffic is destined for addresses outside the walled garden. Because this traffic does not match the filter conditions, it flows to the line card for handling.

You can configure the service filter so that the walled garden contains a single server as the captive portal or a list of servers.

  • Configure the walled garden with a single server as the captive portal:

    1. Create the service filter.

      content_copy zoom_out_map
      [edit]
      user@host# edit firewall family address-family service-filter filter-name
      
    2. Define a filter term to identify and skip processing for traffic to the captive portal.

      1. Specify filter conditions to match traffic that is destined for the captive portal by specifying the destination address of the captive portal and the destination port.

        content_copy zoom_out_map
        [edit firewall family inet service-filter filter-name]
        user@host# set term name from destination-address ip-address
        user@host# set term name from destination-port port-number
        
      2. Specify that the matching traffic skips processing on the line card.

        content_copy zoom_out_map
        [edit firewall family inet service-filter filter-name]
        user@host# set term name then skip
        
    3. Define a filter term to identify HTTP traffic from all the traffic that did not match the previous term and send it for processing by CPCD service rules.

      1. Specify one or more HTTP port numbers to match the skipped HTTP traffic.

        content_copy zoom_out_map
        [edit firewall family inet service-filter filter-name]
        user@host# set term name from destination-port http-port-number
        
      2. Specify that the matching traffic is processed by a CPCD service.

        content_copy zoom_out_map
        [edit firewall family inet service-filter filter-name]
        user@host# set term name then service
        
    4. Define a filter term to skip further action for any remaining, non-HTTP traffic.

      content_copy zoom_out_map
      [edit firewall family inet service-filter filter-name]
      user@host# set term name then skip
      

    For example, the following configuration creates a filter for IPv4 HTTP traffic, walled-v4, with the captive portal on 192.0.2.0. Traffic matching the address is skipped. Nonmatching traffic goes to term http, where HTTP traffic is picked out of all skipped traffic and sent to be processed according to a CPCD service. Finally, term skip causes all the remaining, non-HTTP traffic to be skipped.

    content_copy zoom_out_map
    [edit]
    user@host# edit firewall family inet service-filter walled-v4
    [edit firewall family inet service-filter walled-v4]
    user@host# set term portal from destination-address 192.0.2.0
    user@host# set term portal from destination-port 80
    user@host# set term portal then skip
    user@host# set term http from destination-port 80
    user@host# set term http then service
    user@host# set term skip then skip
    
  • Configure the walled garden as a list or subnet of servers.

    1. Create the service filter.

      content_copy zoom_out_map
      [edit]
      user@host# edit firewall family address-family service-filter filter-name
      
    2. Define a filter term.

      1. Specify filter conditions to match traffic that is destined for any server in the walled garden by specifying a destination prefix list of servers.

        content_copy zoom_out_map
        [edit firewall family inet service-filter filter-name]
        user@host# set term name from destination-prefix-list list-name
        user@host# set term name from destination-port port-number
        
      2. Specify that the matching traffic skips processing on the line card.

        content_copy zoom_out_map
        [edit firewall family inet service-filter filter-name]
        user@host# set term name then skip
        
    3. Define a filter term to identify HTTP traffic from all the traffic that did not match the previous term and send it for processing by CPCD service rules.

      1. Specify one or more HTTP port numbers to match the skipped HTTP traffic.

        content_copy zoom_out_map
        [edit firewall family inet service-filter filter-name]
        user@host# set term name from destination-port http-port-number
        
      2. Specify that the matching traffic is processed by a CPCD service.

        content_copy zoom_out_map
        [edit firewall family inet service-filter filter-name]
        user@host# set term name then service
        
    4. Define a filter term to skip further action for any remaining, non-HTTP traffic.

      content_copy zoom_out_map
      [edit firewall family inet service-filter filter-name]
      user@host# set term name then skip
      
    5. (Optional) Define a prefix list that specifies servers within the walled garden. You can specify a subnet or multiple individual addresses.

      content_copy zoom_out_map
      [edit policy-options]
      user@host# set prefix-list list- name ip-address/mask
      user@host# set prefix-list list- name ip-address1
      user@host# set prefix-list list- name ip-address2
      

    For example, the following configuration creates a service filter for IPv6 HTTP traffic, walled-v6-list, with a prefix list, wg-list, that specifies two servers in the walled garden. Filter term portal6 identifies IPv6 traffic that is destined for the walled garden. Nonmatching traffic goes to term http6, where HTTP traffic is picked out of all skipped traffic and sent to be processed according to a CPCD service. Finally, term skip causes all the remaining, non-HTTP traffic to skipped.

    content_copy zoom_out_map
    [edit]
    user@host# edit firewall family inet6 service-filter walled-v6-list
    user@host# set term portal6 from destination-prefix-list wg-list
    user@host# set term portal6 then skip
    user@host# set term http6 from destination-port [80 8080]
    user@host# set term http6 then service
    user@host# set term skip6 then skip
    [edit policy-options]
    user@host# set prefix-list wg-list 2001:db8::10.10
    user@host# set prefix-list wg-list 2001:db8::10.22
    

Configuring HTTP Redirect for Local and Remote Redirect Servers

When HTTP requests are made for sites outside the walled garden, CPCD can redirect the traffic to a captive portal for authentication and authorization.

Configure a CPCD service rule that specifies the action to be taken for the HTTP traffic identified by the walled garden service filter and passed to the service. The action you configure depends on whether you are using a local or a remote HTTP redirect server:

  • If you are using a local HTTP redirect server on the router, you specify the redirect action.

  • If you are using a remote HTTP redirect server, which resides in a walled garden behind the router, then you cannot simply specify a redirect URL. In this case, the service rule must rewrite the IP destination address for the traffic. The new destination address is the address of the remote HTTP redirect server. The remote server then supplies a redirect URL to send the traffic to a captive portal.

  1. Configure the dynamic profile.
    content_copy zoom_out_map
    [edit]
    user@host# edit dynamic-profiles profile-name
    
  2. Access the dynamic CPCD service configuration level.
    content_copy zoom_out_map
    [edit dynamic-profiles profile-name]
    user@host# edit services captive-portal-content-delivery
    
  3. Create a rule to apply to traffic destined outside the walled garden.
    content_copy zoom_out_map
    [edit dynamic-profiles profile-name services captive-portal-content-delivery]
    edit rule name
    
  4. Specify that the rule applies to incoming traffic.
    content_copy zoom_out_map
    [edit dynamic-profiles profile-name services captive-portal-content-delivery rule name]
    user@host# set match-direction input
    
  5. Specify the action to take for the matching traffic .Because the walled garden is a service filter, the traffic is already identified as HTTP traffic before being sent to the service.
    • For a local HTTP redirect server, provide the redirect URL, which is the URL of the captive portal with the original URL (outside the walled garden) appended:

      content_copy zoom_out_map
      [edit dynamic-profiles profile-name services captive-portal-content-delivery rule name]
      user@host# set term name then redirect redirect-url/url=%dest-url%
      
    • For a remote HTTP redirect server, provide the destination address of the remote server:

      content_copy zoom_out_map
      [edit dynamic-profiles profile-name services captive-portal-content-delivery rule name]
      user@host# set term name then rewrite destination-address remote-server-address
      

For example, in the following configuration for a local server, the dynamic profile http-redir-converged includes the CPCD service rule redir-svc. The rule redirects traffic to a captive portal, http://www.portal.example.com. The original URL entered by the subscriber is appended to the redirect URL. The CPCD service profile redir-prof includes the rule, and will later be applied to a service interface by a service set.

content_copy zoom_out_map
user@host# edit dynamic-profiles http-redir-converged
user@host# edit services captive-portal-content-delivery
user@host# edit rule redir-svc
user@host# set match-direction input
user@host# set term redir1 then redirect http://www.portal.example.com/url=%dest-url%

The following configuration for a remote server creates CPCD service rule rewr-svc that rewrites the original destination address to the address of the remote server, 192.0.2.230.

content_copy zoom_out_map
user@host# edit dynamic-profiles http-redir-converged
user@host# edit services captive-portal-content-delivery
user@host# edit rule rewr-svc
user@host# set match-direction input
user@host# set term rewr1 then rewrite destination-address 192.0.2.230

Configuring Parameterization for the Redirect URL

You can optionally choose to parameterize the redirect URL and the rewrite destination address by specifying user-defined variables in the dynamic profile. Parameterizing means that URL or address becomes a dynamic variable. The value is provided by RADIUS when the subscriber is authenticated or when a CoA is received. Consequently, you can use the RADIUS attributes to provide different URLs or destination addresses for different subscribers.

  1. Configure the dynamic profile.
    content_copy zoom_out_map
    [edit]
    user@host# edit dynamic-profiles profile-name
    
  2. Access the custom variable configuration level.
    content_copy zoom_out_map
    [edit dynamic-profiles profile-name]
    user@host# edit variables
    
  3. Define the variable for the redirect URL, the rewrite destination address, or both. Specify that the value for the dynamic variable is provided by an external server, typically RADIUS.
    Note:

    You can name the variables anything you like, but names like redirect-url and rewrite-da make the purpose clear.

    content_copy zoom_out_map
    [edit dynamic-profiles profile-name variables]
    set variable-name mandatory
    
  4. In the CPCD rule, specify the variable by prepending a dollar sign ($) to the variable name.
    • For a local HTTP redirect server, provide the redirect variable:

      content_copy zoom_out_map
      [edit dynamic-profiles profile-name services captive-portal-content-delivery rule name]
      user@host# set term name then redirect $variable-name
      
    • For a remote HTTP redirect server, provide the destination address variable:

      content_copy zoom_out_map
      [edit dynamic-profiles profile-name services captive-portal-content-delivery rule name]
      user@host# set term name then rewrite $variable-name
      

For example, the following configuration shows two user-defined variables, redirect-url and rewrite-da that require externally provided values when they are instantiated. CPCD service rule redir1 specifies traffic is redirected to $redirect-url. CPCD service rule rewr1 specifies that the destination address for the traffic is rewritten to $rewrite-da.

content_copy zoom_out_map
user@host# edit dynamic-profiles http-redir-converged
user@host# edit variables
user@host# set redirect-url mandatory
user@host# set rewrite-da mandatory
user@host# edit services captive-portal-content-delivery
user@host# edit rule redir-svc
user@host# set match-direction input
user@host# set term redir1 then redirect $redirect-url
user@host# edit rule rewr-svc
user@host# set match-direction input
user@host# set term rewr1 then rewrite $rewrite-da

Configuring the Service Set to Associate the Service Profile with a Service Interface

Service sets define one or more services to be performed by the MS-MPC/MS-MIC, or by the MX-SPC3 services card if you have enabled Next Gen Services on the MX Series router. For HTTP redirect services, you define a CPCD service profile that includes CPCD rules. The service set applies the CPCD service profile to a specific service interface.

  1. Create the service profile.
    content_copy zoom_out_map
    [edit services captive-portal-content-delivery]
    user@host# edit profile name
    
  2. Specify one or more CPCD rules configured in the CPCD dynamic profile for the service profile.
    content_copy zoom_out_map
    [edit services captive-portal-content-delivery profile name]
    user@host# set cpcd-rules rule-name
    
  3. Specify that this is a converged CPCD service.
    content_copy zoom_out_map
    [edit services captive-portal-content-delivery profile name]
    user@host# set dynamic
    
  4. Create the service set.
    content_copy zoom_out_map
    [edit services]
    user@host# edit service-set name
    
  5. Specify the CPCD service profile.
    content_copy zoom_out_map
    [edit services service-set name]
    user@host# set captive-portal-content-delivery-profile name
    
  6. Specify the service interface.
    content_copy zoom_out_map
    [edit services service-set name]
    user@host# set interface-service service-interface interface-name
    

For example, the following configuration creates CPCD service profile redir-prof, which references the CPCD rule redir-svc. Service set cvgd associates the CPCD service profile rewr-prof with the service interface ms-2/0/0.

content_copy zoom_out_map
[edit services captive-portal-content-delivery]
user@host# edit profile redir-prof
user@host# set cpcd-rules redir-svc
user@host# set dynamic
[edit services]
user@host# edit service-set cvgd
user@host# set captive-portal-content-delivery-profile redir-prof
user@host# set interface-service service-interface ms-2/0/0

Attaching a CPCD Service Set and Service Filter to a Dynamic Logical Interface

To use the HTTP redirect services, you must attach the CPCD service set to a logical interface. Because the walled garden is configured as a service filter, you must attach it to the same interface as the service set. Traffic arriving on and leaving that interface is filtered by the service filter. Traffic identified for servicing is sent to the MS-MPC or MX-SPC3 service interface where the CPCD profile is applied.

Note:

This procedure shows only elements of the dynamic profile configuration that are specific to the converged services configuration. The complete dynamic profile depends on your use case.

  1. Configure the dynamic profile.
    content_copy zoom_out_map
    [edit]
    user@host# edit dynamic-profiles profile-name
    
  2. Configure the dynamic physical interface.
    content_copy zoom_out_map
    [edit dynamic-profiles profile-name]
    user@host# edit interfaces $junos-interface-ifd-name
    
  3. Configure the dynamic logical interface.
    content_copy zoom_out_map
    [edit dynamic-profiles profile-name interfaces $junos-interface-ifd-name]
    user@host# edit unit $junos-underlying-interface-unit
    
  4. Configure the address family.
    content_copy zoom_out_map
    [edit dynamic-profiles profile-name interfaces $junos-interface-ifd-name unit $junos-underlying-interface-unit]
    user@host# edit family family
    
  5. Attach the service set and service filter to the interface.
    content_copy zoom_out_map
    [edit dynamic-profiles profile-name interfaces $junos-interface-ifd-name unit $junos-underlying-interface-unit family family]
    user@host# set service input service-set set-name service-filterfilter-name
    user@host# set service output service-set set-name service-filter filter-name
    

For example, the following configuration creates the dynamic profile http-redir-converged. It specifies predefined variables to create the dynamic physical and logical interfaces in the IPv4 address family. The profile attaches service set cvgd and service filter walled-v4 to the dynamic logical interface when it is created at subscriber login. The service set and filter are both applied to the interface input and output.

content_copy zoom_out_map
user@host# edit dynamic-profiles http-redir-converged
user@host# edit interfaces $junos-interface-ifd-name
user@host# edit unit $junos-underlying-interface-unit
user@host# edit family inet
user@host# set service input service-set cvgd service-filter walled-v4
user@host# set service output service-set cvgd service-filter walled-v4

Installing a Service Package for CPCD Service

To use CPCD services on an MS-MPC/MS-MIC, or on an MX-SPC3 services card if you have enabled USF on the MX Series router, you configure a service interface on the MS-MIC or MX-SPC3. You must install the required service packages on each MS-MIC that has a service interface or on an MX-SPC3.

  1. Configure Junos OS to support a service package on a service interface on an MX Series 5G Universal Routing Platform with MS-MPCs or on an MX-SPC3 services card for Next Gen Services.
    content_copy zoom_out_map
    [edit]
    user@host# edit chassis fpc slot-number pic number adaptive-services service-package
    
  2. Configure the required service packages to run on the PIC. When the extension-provider
    Note:

    Converged services MS-MPC-based or MX-SPC3-based CPCD requires both the CPCD service package (jservices-cpcd) and the mobile subscriber service package (jservices-mss).

    content_copy zoom_out_map
    [edit chassis fpc slot-number pic number adaptive-services service-package]
    user@host# set extension-provider package jservices-cpcd,jservices-mss
    
  3. (Optional) Enable PIC system logging to record or view system log messages on the PIC. You can specify one or more facilities, each at a configurable severity level.
    content_copy zoom_out_map
    [edit chassis fpc 1 pic 0 adaptive-services service-package]
    user@host# set extension-provider syslog facility severity
    

For example, the following configuration loads the CPCD services package and the mobile subscriber services package on the MS-MPC in chassis slot 1 and the MS-MIC in slot 0 of the MPC. System log messages are generated for any daemon and for local external applications at all severity levels.

content_copy zoom_out_map
user@host# edit chassis fpc 1 pic 0 adaptive-services service-package
[edit chassis fpc 1 pic 0 adaptive-services service-package]
user@host# set extension-provider package jservices-cpcd,jservices-mss
[edit chassis fpc 1 pic 0 adaptive-services service-package]
user@host# set extension-provider syslog daemon any
user@host# set extension-provider syslog external any

Change History Table

Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.

Release
Description
19.3R1
Starting in Junos OS Release 19.3R1, you can also configure converged HTTP redirect service provisioning on the MX-SPC3 services card if you have enabled Next Gen Services on the MX Series router.
footer-navigation