Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Example: Configuring Destination Address Rewrite for HTTP Redirect

    Requirements

    • Multiservices DPC PIC

    Overview

    This procedure shows how to configure an DA rewrite rule. The destination port is not specified and the default behavior is determined by the rewrite configuration. If no rewrite configuration is available, the destination port is not rewritten.

    Configuration

    Example: Configuring a Rewrite Rule

    Step-by-Step Procedure

    1. Configure the service rule:

      [edit services captive-portal-content-delivery]user@host# set rule da-rewrite
    2. Specify the term name:

      [edit services captive-portal-content-delivery da-rewrite]user@host# set term t1
    3. Specify the match conditions for the term:

      [edit services captive-portal-content-delivery da-rewrite inet-filter term t1]user@host# set from applications junos-http
    4. Specify the actions to take if the packet matches all the conditions in that term:

      [edit services captive-portal-content-delivery da-rewrite inet-filter term t1]user@host# set then rewrite desitnation-address 2001:2002::1;

    Results

    Confirm the configuration by entering the show services configuration command. If the command output does not display the intended configuration, repeat the instructions in this procedure to correct the configuration.

    [edit services captive-portal-content-delivery]
    rule da-rewrite {match-direction input-outputterm 1 {from {applications junos-http;}then {rewrite destination-address 2001:2002::1; # this is the remote redirect server.}}}

    The following example shows the configuration for an IPv6-DA rewrite service rule. Because the destination port is not specified, the default behavior is determined by the rewrite configuration. If no rewrite configuration is available, the destination port is not rewritten.

    [edit services captive-portao-content-delivery]
    rule ipv6da-rewrite {match-direction input-outputterm 1 {from {applications junos-http;}then {rewrite destination-address 2001:2002::1; # this is the remote# redirect server.}}}

    Verification

    Displaying HTTP Redirect configuration

    Purpose

    Verify the HTTP requests are redirected to the server.

    Action

    user@host> show services detail

    Published: 2013-02-11