Kernel Requirements

Needs kernel modules (or compiled support) for:

  • iptable_nat

  • ip_conntrack

  • ipt_REJECT

  • iptable_filter

  • ip_tables

Port Forwarding

In theory you could have NAT without port forwarding, but there’s little point meaning you’ll probably want to activate your kernel to do forwarding:

echo "1" > /proc/sys/net/ipv4/ip_forward

Show NAT Rules

List NAT rules in iptables:

iptables -t nat -L

I don’t know why iptables -L doesn’t include NAT rules, but it doesn’t.

IPTables NAT Rules

Here’s an example of the nat part of a "/etc/sysconfig/iptables":

-A POSTROUTING -s 172.22.0.0/16 -o eth0 -j SNAT --to-source 137.110.222.250
-A POSTROUTING -s 172.19.222.0/24 -o eth0 -j SNAT --to-source 137.110.222.250