Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This question already has an answer here:

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

share|improve this question

marked as duplicate by Michael Hampton, Magellan, Ward, Dave M, Iain May 4 '13 at 6:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
    
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... –  Adrian 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. –  Bobbin Zachariah May 3 '13 at 2:25
    
Bobbin, you are right they don't allow PREROUTING on VPS. Thanks. –  Adrian May 3 '13 at 6:39

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