I have a clean fresh CentOS 7.7 install. First thing I did was remove NetworkManager and FirewallD and started setting up iptables. I'm trying to set up NAT masquerading, but it appears that with that configuration, running NAT is no longer supported. Someone, please tell me I'm an idiot and doing something wrong.

# iptables -V
iptables v1.4.21

# lsmod | grep tabl
iptable_filter         12810  1
ip_tables              27126  1 iptable_filter

# lsmod | grep nf
nf_nat                 26583  0
nf_reject_ipv4         13373  1 ipt_REJECT
nf_conntrack_ipv4      15053  2
nf_defrag_ipv4         12729  1 nf_conntrack_ipv4
nf_conntrack          139224  3 nf_nat,xt_conntrack,nf_conntrack_ipv4
libcrc32c              12644  3 xfs,nf_nat,nf_conntrack

# systemctl status iptables.service
● iptables.service - IPv4 firewall with iptables
   Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled)
   Active: active (exited) since Fri 2020-02-07 20:22:44 EST; 23min ago

So iptables looks loaded, but when I:

# iptables -t NAT --flush
iptables v1.4.21: can't initialize iptables 'NAT': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

So I get no NAT. What do I need to do to be able to handle NAT with iptables in CentOS 7.7?

  • First: are you root? Then check if iptables is enabled: systemctl enable iptables Feb 8 '20 at 1:41
  • Yes, am root, and yes, iptables.service is enabled, loaded, and active.
    – Chris
    Feb 8 '20 at 1:45
  • -t nat must be lowercase Feb 8 '20 at 1:47
  • omg.... yes. thank you for the sanity check here. drop an answer & I'll accept it
    – Chris
    Feb 8 '20 at 1:49

Luckily for you it's not a big issue. It's enough to put it lowercase iptables -t nat (...)

  • Thank you! My mind was stuck in caps mode, since iptables is big on ALL CAPS for things
    – Chris
    Feb 8 '20 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.