Configuring Port Control Protocol
This topic describes the following configuration tasks:
Configuring PCP Server Options
- Go to the [edit services pcp pcp-servicer server-name] hierarchy level and specify a PCP
server name.user @host# edit services pcp pcp-server server-name
- Set the IPv4 or IPv6 addresses of the server. For PCP
DS-Lite, the ipv6-address must match the address of the
AFTR (Address Family Transition Router or softwire concentrator).[edit services pcp pcp-server s1]user @host# set ipv6-address ipv6-address
or
[edit services pcp pcp-server s1]user @host# set ipv4-address ipv4-address - For PCP DS-Lite, provide the name of the DS-Lite softwire
concentrator configuration.[edit services pcp pcp-server s1]user @host# set softwire-concentrator softwire-concentrator-name
- Specify the minimum and maximum mapping lifetimes for
the server.[edit services pcp pcp-server s1]user @host# set mapping-lifetime-minimum mapping-lifetime-minimumuser @host# set mapping-lifetime-maximum mapping-lifetime-maximum
- Specify the time limits for generating short lifetime
or long lifetime errors.[edit services pcp pcp-server s1]user @host# set short-lifetime-error short-lifetime-erroruser @host# set long-lifetime-error long-lifetime-error
- (Optional)—Enable PCP options on the specified PCP
server. The following options are available—third-party and prefer-failure. The third-party option is required
to enable third-party requests by the PCP client. DS-Lite requires
the third-party option. The prefer-failure option
requests generation of an error message when the PCP client requests
a specific IP address/port that is not available, rather than assigning
another available address from the NAT pool. If prefer-failure is not specified NAPT44 assigns an available address/port from the
NAT pool based on the configured NAT options.[edit services pcp pcp-server s1]user @host# set pcp-options third-partyuser @host# set pcp-options prefer-failure
- (Optional)—Specify which NAT pool to use for mapping.[edit services pcp pcp-server s1]user @host# set nat-options pcp-nat-pool pool-name1 <poolname2...>

Note: When you do not explicitly specify a NAT pool for mapping, the Junos OS performs a partial rule match based on source IP, source port and protocol; the Junos OS uses the NAT pool configured for the first matching rule to allocate mappings for PCP.
You must use explicit configuration in order to use multiple NAT pools.
- (Optional)—Configure the maximum number of mappings
per client. The default is 32 and maximum is 128.[edit services pcp pcp-server s1]user @host# set max-mappings-per-client max-mappings-per-client
Configuring a PCP Rule
A PCP rule is has the same basic options as all service set rules:
- A term option that allows a single rule to have multiple applications.
- A from option that identifies the traffic that is subject to the rule.
- A then option that identifies what action is to be taken. In the case of a PCP rule, this option Identifies the pcp server that handles selected traffic
- Go to the [edit services pcp rule rulename] hierarchy level and specify match-direction input.user @host# edit services pcp rule rulename user @host# set match-direction input
- Go to the [edit services pcp rule rulename term termname] hierarchy level and provide
a termname.user @host# edit term termname
- (Optional)—Provide a from option to filter the traffic to be selected for processing by the rule. When you omit the from option, all traffic handled by the service set’s service interface is subject to the rule.
- Set the then option to identify the target
pcp server.[edit services pcp rule rulename term termname]user @host# set then pcp-server server-name
Configuring a Service Set to Apply PCP
To use PCP, you must provide the rule-name (or name of a list of rulenames) in the pcp-rule rulename option.
- Go to the [edit services service-set service-set-name hierarchy level.user @host# edit services service-set service-set-name
- If this is a new service set, provide basic service set information, including interface information and any other rules that may apply.
- Specify the name of the PCP rule or rule list used to
send traffic to the specified PCP server.[edit services service-set service-set-name ]user @host# set pcp-rule rule-name | rule-listname
![]() | Note: Your service set must also identify any required nat-rule and softwire-rule. |
SYSLOG Message Configuration
A new syslog class, configuration option, pcp-logs, has been provided to control PCP log generation. It provides the following levels of logging:
- protocol—All logs related to mapping creation, deletion are included at this level of logging.
- protocol-error—–All protocol error related logs (such as mapping refresh failed, PCP look up failed, mapping creation failed). are included in this level of logging.
- system-error—Memory and infrastructure errors are included in this level of logging.