You can configure a NAT traffic policy on an inbound interface to perform NAT translation on user traffic.
To perform NAT translation on user traffic on an inbound interface, configure a NAT traffic policy on the inbound interface.
The system view is displayed.
For a basic ACL (numbered from 2000 to 2999), run the acl { name basic-acl-name { basic | [ basic ] number basic-acl-number } | [ number ] basic-acl-number } [ match-order { config | auto } ] command.
For an advanced ACL (numbered from 3000 to 3999), run the acl { name advance-acl-name [ advance | [ advance ] number advance-acl-number ] | [ number ] advance-acl-number } [ match-order { config | auto } ] command.
For a basic ACL (numbered from 2000 to 2999), run:
rule [ rule-id ] [ name rule-name ] { deny | permit } [ fragment-type { fragment | non-fragment | non-subseq | fragment-subseq | fragment-spe-first } | source { source-ip-address { source-wildcard | 0 | src-netmask } | any } | time-range time-name ] *
If TCP is used, run:
rule [ rule-id ] [ name rule-name ] { deny | permit } { protocol | tcp } [ [ dscp dscp | [ precedence precedence | tos tos ] * ] | { destination { destination-ip-address { destination-wildcard | 0 | des-netmask } | any } | destination-pool destination-pool-name } | { destination-port operator port-number | destination-port-pool destination-port-pool-name } | fragment-type { fragment | non-fragment | non-subseq | fragment-subseq | fragment-spe-first } | { source { source-ip-address { source-wildcard | 0 | src-netmask } | any } | source-pool source-pool-name } | { source-port operator port-number | source-port-pool source-port-pool-name } | { tcp-flag | syn-flag } { tcp-flag [ mask mask-value ] | established |{ ack [ fin | psh | rst | syn | urg ] * } | { fin [ ack | psh | rst | syn | urg ] * } | { psh [ fin | ack | rst | syn | urg ] * } | { rst [ fin | psh | ack | syn | urg ] * } | { syn [ fin | psh | rst | syn | urg ] * } | { urg [ fin | psh | rst | syn | urg ] * } } | time-range time-name | ttl ttl-operation ttl-value | packet-length length-operation length-value ] *
If UDP is used, run:
rule [ rule-id ] [ name rule-name ] { deny | permit } { protocol | udp } [ [ dscp dscp | [ precedence precedence | tos tos ] * ] | { destination { destination-ip-address { destination-wildcard | 0 | des-netmask } | any } | destination-pool destination-pool-name } | { destination-port operator port-number | destination-port-pool destination-port-pool-name } | fragment-type { fragment | non-fragment | non-subseq | fragment-subseq | fragment-spe-first } | { source { source-ip-address { source-wildcard | 0 | src-netmask } | any } | source-pool source-pool-name } | { source-port operator port-number | source-port-pool source-port-pool-name } | time-range time-name | ttl ttl-operation ttl-value | packet-length length-operation length-value ] *
If ICMP is used, run:
rule [ rule-id ] [ name rule-name ] { deny | permit } { protocol | icmp } [ [ dscp dscp | [ precedence precedence | tos tos ] * ] | { destination { destination-ip-address { destination-wildcard | 0 | des-netmask } | any } | destination-pool destination-pool-name } | fragment-type { fragment | non-fragment | non-subseq | fragment-subseq | fragment-spe-first } | icmp-type { icmp-name | icmp-type [ to icmp-type-end ] [ icmp-code ] } | { source { source-ip-address { source-wildcard | 0 | src-netmask } | any } | source-pool source-pool-name } | time-range time-name | ttl ttl-operation ttl-value | packet-length length-operation length-value ] *
If a protocol, different from the preceding ones, is used, run:
rule [ rule-id ] [ name rule-name ] { deny | permit } { protocol | gre | ip | ipinip | igmp | ospf } [ [ dscp dscp | [ precedence precedence | tos tos ] * ] | { destination { destination-ip-address { destination-wildcard | 0 | des-netmask } | any } | destination-pool destination-pool-name } | fragment-type { fragment | non-fragment | non-subseq | fragment-subseq | fragment-spe-first } | { source { source-ip-address { source-wildcard | 0 | src-netmask } | any } | source-pool source-pool-name } | time-range time-name | ttl ttl-operation ttl-value | packet-length length-operation length-value ] *
ACL rules match against source IP addresses in packets. To add rules to an ACL, repeat Step 2.b.
Rules in an ACL to which traffic is matched against are used based on the depth first rule (with auto configured) or in a configuration order (with config configured). By default, rules are used in a configuration order (with config configured).
When an ACL rule is associated with an instance, the address wildcard of the ACL rule must be a subnet mask in consecutive mode (with 0s and 1s consecutively sequenced, such as 255.255.255.0), instead of a subnet mask in non-consecutive mode (with 0s and 1s inconsecutively sequenced, such as 255.0.255.0).
The configuration is committed.
Return to the system view.
A traffic classifier is configured, and the traffic classifier view is displayed.
A matching rule for multi-field (MA) traffic classification based on an ACL is configured.
To add rules to an ACL, repeat this step.
The configuration is committed.
Return to the system view.
A traffic behavior is configured, and the traffic behavior view is displayed.
A traffic behavior is bound to a NAT instance.
The configuration is committed.
Return to the system view.
A traffic policy is configured, and the traffic policy view is displayed.
A traffic behavior is specified for a specified traffic classifier in the traffic policy.
The configuration is committed.
Return to the system view.
Apply the traffic policy to a user-side Layer 3 interface.
The interface view is displayed.
A traffic policy is applied to the interface.
The configuration is committed.
Apply the traffic policy to a user-side Layer 2 Ethernet interface that is added to a VLAN.
The interface view is displayed.
The Layer 3 interface is switched to the Layer 2 mode.
An interface attribute is set for the Layer 2 Ethernet interface.
The default interface type is hybrid.
For an access or QinQ interface:
Run the port default vlan vlan-id command to add the interface to the VLAN.
To add interfaces to a VLAN in a batch, run the port interface-type { interface-number1 [ to interface-number2 ] } &<1-10> command in the VLAN view.
interface-number2 must be greater than interface-number1. interface-number2 and interface-number1 must specify the same type of interface. Interfaces in the range defined by interface-number2 and interface-number1 must exist.
In a port interface-type { interface-number1 [ to interface-number2 ] } &<1-10> command instance, a maximum of 10 to parameters can be used to define 10 ranges of ports.
For a hybrid interface:
Run the port trunk allow-pass vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all } command to add the interface to the VLAN.
(Optional) Run the port default vlan vlan-id command to specify a default VLAN for the trunk interface.
A traffic policy is applied to the Layer 2 interface.
The configuration is committed.