I am trying to add the following rule:

iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080 

but what I am getting is:

FATAL: Module ip_tables not found.
iptables v1.4.7: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Looking through the forums I came to the conclusion that the iptable_nat module is not installed/activated. By issuing

modprobe iptable_nat

I get

FATAL: Module iptable_nat not found.

Any ideas how to install/activate this.

Thanks, Adrian

  • And what is your kernel version? May 2 '13 at 4:46
  • Hi Michael. My kernel version is 2.6.18-028stab101.1
    – ama
    May 2 '13 at 16:01
  • Contact your hosting provider. They must fix this issue for you. May 2 '13 at 19:16
  • Hi Michael, Thanks for the tip, I'll try to contact my hosting provider on the issue.
    – ama
    May 2 '13 at 20:36

What is the output of below command and do you have enabled ip forwarding?

cat /proc/sys/net/ipv4/ip_forward

should be 1.

lsmod | grep iptable

  • Hi Bobbin, for the first command I get a 0. It is set to 0 in /etc/sysctl.conf. For the second I get nothing. Even when I run lsmod alone I get no modules...
    – ama
    May 2 '13 at 16:29
  • You cannot or wont be able to load modules on a VPS, or if you have HW node then you have to rebuild kernal to enable iptable modules. May 3 '13 at 2:25
  • Bobbin, you are right they don't allow PREROUTING on VPS. Thanks.
    – ama
    May 3 '13 at 6:39

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