This section provides an example for applying PCP in a NAT444 scenario.
As shown in Figure 1, the FW serves as a CGN in a NAT444 scenario. PCP is required on the FW for P2P service transmission between users to improve user experience in P2P services.
Item |
Data |
Description |
|
|---|---|---|---|
GigabitEthernet 0/0/1 |
IP address: 10.1.1.1/24 Security zone: Trust |
FW interface connected to the MAN |
|
GigabitEthernet 0/0/2 |
IP address: 1.1.1.1/24 Security zone: Untrust |
FW interface connected to the Internet |
|
NAT address pool |
1.1.1.10 to 1.1.1.15 |
The FW uses the NAT address pool to assign public IP addresses to private network users. |
|
IP address of the CPE |
10.1.2.1 |
The CPU uses the IP address to communicate with the FW. |
|
In this example, only the configuration of the FW serving as the PCP server is described. For configuration details on the PCP client, see the product documents of the CPE.
# Assign an IP address to GigabitEthernet 0/0/1.
<FW> system-view [FW] interface GigabitEthernet 0/0/1 [FW-GigabitEthernet 0/0/1] ip address 10.1.1.1 24 [FW-GigabitEthernet 0/0/1] quit
# Assign an IP address to GigabitEthernet 0/0/2.
[FW] interface GigabitEthernet 0/0/2 [FW-GigabitEthernet 0/0/2] ip address 1.1.1.1 24 [FW-GigabitEthernet 0/0/2] quit
# Add GigabitEthernet 0/0/1 to the Trust zone.
[FW] firewall zone trust [FW-zone-trust] add interface GigabitEthernet 0/0/1 [FW-zone-trust] quit
# Add GigabitEthernet 0/0/2 to the Untrust zone.
[FW] firewall zone untrust [FW-zone-untrust] add interface GigabitEthernet 0/0/2 [FW-zone-untrust] quit
# Configure user-defined services and specify destination port 5351 for UDP.
[FW] ip service-set udp5351 type object [FW-object-service-set-udp5351] service protocol udp destination-port 5351 [FW-object-service-set-udp5351] quit
# Configure a security policy to permit PCP negotiation packets.
[FW] security-policy [FW-policy-security] rule name policy1 [FW-policy-security-rule-policy1] source-zone trust [FW-policy-security-rule-policy1] destination-zone local [FW-policy-security-rule-policy1] source-address 10.1.2.1 32 [FW-policy-security-rule-policy1] destination-address 10.1.1.1 32 [FW-policy-security-rule-policy1] service udp5351 [FW-policy-security-rule-policy1] action permit [FW-policy-security-rule-policy1] quit
Configure a security policy to allow private network users to access the Internet.
[FW-policy-security] rule name policy2 [FW-policy-security-rule-policy2] source-zone trust [FW-policy-security-rule-policy2] destination-zone untrust [FW-policy-security-rule-policy2] action permit [FW-policy-security-rule-policy2] quit [FW-policy-security] quit
[FW] nat address-group addressgroup1 [FW-address-group-addressgroup1] mode pcp [FW-address-group-addressgroup1] section 0 1.1.1.10 1.1.1.15 [FW-address-group-addressgroup1] route enable [FW-address-group-addressgroup1] quit
[FW] pcp-policy [FW-policy-pcp] rule name policy_pcp1 [FW-policy-pcp-rule-policy_pcp1] source-zone trust [FW-policy-pcp-rule-policy_pcp1] source-address 10.1.2.1 32 [FW-policy-pcp-rule-policy_pcp1] action nat address-group addressgroup1 [FW-policy-pcp-rule-policy_pcp1] quit [FW-policy-pcp] quit
[FW] ip route-static 0.0.0.0 0.0.0.0 1.1.1.254
[FW] firewall endpoint-independent filter enable
After enabling P2P software, the private network user can obtain a public IP address and a public port number. In addition, the Internet user can proactively communicate with the private network user using the public IP address and public port number to download files. You can view the PCP mapping table on the FW.
Configuration script for the FW:
# sysname FW # interface GigabitEthernet0/0/1 ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet0/0/2 ip address 1.1.1.1 255.255.255.0 # interface NULL0 # firewall zone trust set priority 85 add interface GigabitEthernet0/0/1 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/2 # ip route-static 0.0.0.0 0.0.0.0 1.1.1.254 # nat address-group addressgroup1 0 mode pcp route enable section 0 1.1.1.10 1.1.1.15 # security-policy rule name policy1 source-zone trust destination-zone local source-address 10.1.2.1 32 destination-address 10.1.1.1 32 service udp5351 action permit rule name policy2 source-zone trust destination-zone untrust action permit # pcp-policy rule name policy_pcp1 source-zone trust source-address 10.1.2.1 32 action nat address-group addressgroup1 # return