1

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

ama
  • 113
  • 1
  • 4

1 Answers1

2

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 02 '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. – Bobbin Zachariah May 03 '13 at 02:25
  • Bobbin, you are right they don't allow PREROUTING on VPS. Thanks. – ama May 03 '13 at 06:39