Port Control Protocol Configuration Examples
This topic contains the following Port Control Protocol (PCP) configuration examples.
Example: Configuring Port Control Protocol with NAPT44
Requirements
Hardware Requirements
- UEs with PCP clients.
- An MX 3D Router with an MS-DPC services PIC.
- Software Requirements
- Junos OS 13.2
- Layer-3 Services Package
Overview
An ISP wants to enable UEs with PCP clients to maintain connections to servers without timing out. The PCP clients generate PCP requests for the type and duration of the connection they require. Connections may be of a long duration, such as applications using a webcam, or a shorter duration, such as online games. An MX 3D router provides a PCP server to interpret PCP client requests, and NAPT44. Figure 1 shows the basic topology for this example.
Figure 1: PCP with NAPT44

PCP Configuration
CLI Quick Configuration
To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.
Chassis Configuration
Step-by-Step Procedure
To configure the service PIC (FPC 2 Slot 0) with the Layer 3 service package:
- Go to the [edit chassis] hierarchy level.user@host# edit chassis
- Configure the Layer 3 service package.[edit chassis]user@host# set fpc 2 pic 0 adaptive-services service-package layer-3
Results
user@host# show chassis fpc 2 pic 0
pcp-rules pcp-napt44-rule;
nat-rules pcp-rule;
interface-service {
service-interface sp-2/0/0.0;
}Interface Configuration
Step-by-Step Procedure
- Configure the services MS-DPC.user@host# set interfaces sp-2/0/0 services-options inactivity-timeout 180 cgn-pic user@host# set interfaces sp-2/0/0 unit 0 family inet
- Configure the customer-facing interface used for NAT and
PCP services.user@host# set interfaces xe-3/2/0 unit 0 family inet service input service-set sset_0user@host# set interfaces xe-3/2/0 unit 0 family inet service output service-set sset_0user@host# set interfaces xe-3/2/0 unit 0 family inet address 30.0.0.1/24
- Configure the Internet-facing interface.user@host# set interfaces xe-5/0/0 unit 0 family inet address 25.0.0.1/24
Results
user@host# sp-2/0/0 {
services-options {
inactivity-timeout 180;
cgn-pic;
}
unit 0 {
family inet;
}
}
xe-3/2/0 {
unit 0 {
family inet {
service {
input {
service-set sset_0;
}
output {
service-set sset_0;
}
}
address 30.0.0.1/24;
}
}
}
xe-5/0/0 {
unit 0 {
family inet {
address 25.0.0.1/24;
}
}
}NAT Configuration
Step-by-Step Procedure
- Go the [edit services nat] hierarchy.user@host# edit services nat
- Configure a NAT pool called pcp-pool.[edit services nat]user@host# set pool pcp-pool address 44.0.0.0/16 user@host# set pool pcp-pool port automatic random-allocationuser@host# set pool pcp-pool address-allocation round-robin
- Configure a NAT rule called pcp-rule.[edit services nat]user@host# user@host# set rule pcp-rule term t0 then translated source-pool pcp-pool translation-type napt-44user@host# set rule pcp-rule term t0 then translated mapping-type endpoint-independent filtering-type endpoint-independent
Results
user@host# show services natpool pcp-pool {
address 44.0.0.0/16;
port {
automatic {
random-allocation;
}
}
address-allocation round-robin;
}
rule pcp-rule {
match-direction input;
term t0 {
then {
translated {
source-pool pcp-pool;
translation-type {
napt-44;
}
mapping-type endpoint-independent;
filtering-type {
endpoint-independent;
}
}
}
}
}PCP Configuration
Step-by-Step Procedure
To configure the PCP server and PCP rule options.
- Go to the edit services pcp hierarchy level
for server pcp-s1user@host# edit services pcp server pcp-s1
- Configure the PCP server options.[edit services pcp server pcp-s1]user@host# set ipv4-address 124.124.124.122user@host# set mapping-lifetime-minimum 600user@host# set mapping-lifetime-maximum 86500user@host# set short-lifetime-error 120user@host# set long-lifetime-error 1200user@host# set max-mappings-per-client 128user@host# set pcp-options third-party prefer-failureuser@host#
- Create the PCP rule.[edit services pcp rule pcp-napt44-ruleuser@host# edit rule pcp-napt44-rule
- Configure the PCP rule options.[edit services pcp rule pcp-napt44-rule]user@host# set match-direction inputuser@host# set term t0 then pcp-server pcp-s1
Results
regress@montag# show services pcp
server pcp-s1 {
ipv4-address 124.124.124.122;
mapping-lifetime-minimum 600;
mapping-lifetime-maximum 86500;
short-lifetime-error 120;
long-lifetime-error 1200;
max-mappings-per-client 128;
pcp-options third-party prefer-failure;
}
rule pcp-napt44-rule {
match-direction input;
term t0 {
then {
pcp-server pcp-s1;
}
}
}Service Set Configuration
Step-by-Step Procedure
- Create a service set, sset_0, at the edit
services service-set hierarchy level.user@router# edit services service-set sset_0
service-set sset_0 { pcp-rules pcp-napt44-rule; nat-rules pcp-rule; interface-service { service-interface sp-2/0/0.0; } } - Identify the NAT rule associated with the service set.[edit services service-set sset_0]user@router# set nat-rules pcp-rule
- Identify the PCP rule associated with the service set.[edit services service-set sset_0]user@router# set pcp-rules r1
- Identify the service interface associated with the service
set.[edit services service-set sset_0]user@router# set interface-service service-interface sp-2/0/0.0
Results
user@host# showpcp-rules pcp-napt44-rule;
nat-rules pcp-rule;
interface-service {
service-interface sp-2/0/0.0;
}