This section provides an example for configuring NAT444.
Carrier A is in lack of public IPv4 addresses. To relieve the shortage, its internal MAN uses private IPv4 addresses. To enable a private IPv4 user in the MAN to access the IPv4 Internet, NAT needs to be performed twice on both the CPE and CGN devices, as shown in Figure 1.
Configure the PC address and specify a gateway. The configuration methods of PC addresses and routes vary with the PC operating systems. Therefore, the configuration methods are not described here.
The CPE configuration script is as follows:
# sysname CPE # interface GigabitEthernet0/0/0 ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet 0/0/1 ip address 192.168.0.1 255.255.255.0 # firewall zone trust set priority 85 add interface GigabitEthernet 0/0/1 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/0 # ip route-static 0.0.0.0 0.0.0.0 10.1.1.2 # security-policy rule name policy_sec_1 source-zone trust destination-zone untrust source-address 192.168.0.0 24 action permit # nat-policy rule name policy_nat_1 source-zone trust destination-zone untrust source-address 192.168.0.0 24 action source-nat easy-ip # return
The CGN configuration script is as follows:
# sysname CGN # interface GigabitEthernet0/0/0 ip address 1.1.1.1 255.255.255.0 # interface GigabitEthernet 0/0/1 ip address 10.1.2.1 255.255.255.0 # firewall zone trust set priority 85 add interface GigabitEthernet 0/0/1 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/0 # ip route-static 0.0.0.0 0.0.0.0 1.1.1.2 ip route-static 10.1.1.1 255.255.255.255 10.1.2.2 # nat address-group address_1 mode pat route enable section 0 1.1.1.11 1.1.1.20 # security-policy rule name policy_sec_1 source-zone trust destination-zone untrust source-address 10.1.1.0 24 action permit # nat-policy rule name policy_nat_1 source-zone trust destination-zone untrust source-address 10.1.1.0 24 action source-nat address-group address_1 # return