Configuring NAT Mapping and Filtering
Context
In the STUN standard, NAT is classified into four types according to the mapping mode from the private IP address and port to the public IP address and port: full cone NAT, restricted cone NAT, port restricted cone NAT, and symmetric NAT. The methods for configuring NAT mapping and filtering modes vary according to NAT types. The following describes how to configure NAT mapping and filtering modes of the four NAT types.
Procedure
- Run system-view
The system view is displayed.
- Configure NAT mapping and filtering modes.
Configure NAT mapping and filtering modes of full cone NAT.
- Run nat mapping-mode endpoint-independent [ protocol-name [ dest-port port-number ] ]
The mapping mode of full cone NAT is configured.
- Run nat filter-mode endpoint-independent
The filtering mode of full cone NAT is configured.
- Run nat mapping-mode endpoint-independent [ protocol-name [ dest-port port-number ] ]
Configure NAT mapping and filtering modes of restricted cone NAT.
- Run nat mapping-mode endpoint-independent [ protocol-name [ dest-port port-number ] ]
The mapping mode of restricted cone NAT is configured.
- Run nat filter-mode endpoint-dependent
The filtering mode of restricted cone NAT is configured.
- Run nat mapping-mode endpoint-independent [ protocol-name [ dest-port port-number ] ]
Configure NAT mapping and filtering modes of port restricted cone NAT.
- Run nat mapping-mode endpoint-independent [ protocol-name [ dest-port port-number ] ]
The mapping mode of port restricted cone NAT is configured.
- Run nat filter-mode endpoint-and-port-dependent
The filtering mode of port restricted cone NAT is configured.
- Run nat mapping-mode endpoint-independent [ protocol-name [ dest-port port-number ] ]
By default, the mapping and filtering modes of symmetric NAT are configured on devices. If a device does not use the default configuration, run the following commands to restore the mapping and filtering modes of symmetric NAT.
- Run undo nat mapping-mode endpoint-independent [ protocol-name [ dest-port port-number ] ]
The mapping mode of symmetric NAT is restored.
- Run nat filter-mode endpoint-and-port-dependent
The filtering mode of symmetric NAT is restored.
- Run undo nat mapping-mode endpoint-independent [ protocol-name [ dest-port port-number ] ]