LinuxCommandLibrary

ip-ntable

Manage IP network address translation (NAT) tables

SYNOPSIS

ip ntable { COMMAND | help }

PARAMETERS

help
    Display help text.

add
    Add a new NAT rule.

delete
    Delete an existing NAT rule.

replace
    Replace an existing NAT rule with a new one.

flush
    Delete all NAT rules in a table.

list
    List the NAT rules in a table.

zero
    Zero the packet and byte counters for all rules.

counters
    Display rule counters.

DESCRIPTION

The `ip-ntable` command is a Linux utility used to manage and interact with the Netfilter network address translation (NAT) tables. It's a part of the `iproute2` suite and provides a command-line interface to configure NAT rules, which are essential for allowing private networks to communicate with the outside world via a single public IP address.

NAT tables are used to translate IP addresses and port numbers of network packets. It allows you to modify the source or destination IP address and port numbers, essentially rewriting the packets' headers as they traverse the network.

While the older `iptables` utility also handled NAT, `ip-ntable` integrates more seamlessly with modern networking configurations and provides a more streamlined syntax for many NAT operations. It allows viewing, adding, deleting, and modifying NAT rules within the kernel's Netfilter framework. This is particularly useful in environments where you need to configure complex network setups, such as firewalls, VPNs, and load balancers.

CAVEATS

The exact syntax and options available with `ip-ntable` can vary depending on the specific kernel version and the `iproute2` suite version installed on your system. It's also important to have sufficient privileges (usually root) to execute `ip-ntable` commands, as they modify system-level network configurations.

TABLES

`ip-ntable` operates on different tables. The standard table is 'nat'. Other tables can be specified using option `-t

`.

TARGET

Each NAT rule must specify a target. Popular targets are `MASQUERADE` for hiding internal IP addresses and `REDIRECT` for port forwarding.

SEE ALSO

ip(8), iptables(8)

Copied to clipboard