# phpman > man > tc-nat(8)

NAT action in [tc(8)](https://www.chedong.com/phpMan.php/man/tc/8/markdown)                             Linux                            NAT action in [tc(8)](https://www.chedong.com/phpMan.php/man/tc/8/markdown)



## NAME
       nat - stateless native address translation action

## SYNOPSIS
       **tc** ... **action** **nat** _DIRECTION_ _OLD_ _NEW_

       _DIRECTION_ := { **ingress** | **egress** }

       _OLD_ := _IPV4_ADDR_SPEC_

       _NEW_ := _IPV4_ADDR_SPEC_

       _IPV4_ADDR_SPEC_ := { **default** | **any** | **all** | _in_addr_[**/**{_prefix_|_netmask_}]

## DESCRIPTION
       The **nat** action allows to perform NAT without the overhead of conntrack, which is desirable if
       the number of flows or addresses to perform NAT on is large. This action is best used in com‐
       bination  with  the  **u32** filter to allow for efficient lookups of a large number of stateless
       NAT rules in constant time.

## OPTIONS
### ingress
              Translate destination addresses, i.e. perform DNAT.

       **egress** Translate source addresses, i.e. perform SNAT.

       _OLD_    Specifies addresses which should be translated.

       _NEW_    Specifies addresses which _OLD_ should be translated into.

## NOTES
       The accepted address format in _OLD_ and _NEW_ is quite flexible. It may either consist of one of
       the keywords **default**, **any** or **all**, representing the all-zero IP address or a combination of IP
       address and netmask or prefix length separated by a slash (**/**) sign. In any case, the mask (or
       prefix length) value of _OLD_ is used for _NEW_ as well so that a one-to-one mapping of addresses
       is assured.

       Address translation is done using a combination of binary  operations.  First,  the  original
       (source or destination) address is matched against the value of _OLD_.  If the original address
       fits, the new address is created by taking the leading bits from _NEW_ (defined by the  netmask
       of _OLD_) and taking the remaining bits from the original address.

       There  is  rudimental support for upper layer protocols, namely TCP, UDP and ICMP.  While for
       the first two only checksum recalculation is performed, the action also takes care of  embed‐
       ded IP headers in ICMP packets by translating the respective address therein, too.

## SEE ALSO
       [**tc**(8)](https://www.chedong.com/phpMan.php/man/tc/8/markdown)



iproute2                                     12 Jan 2015                         NAT action in [tc(8)](https://www.chedong.com/phpMan.php/man/tc/8/markdown)
