OpenVZ Forum


Home » General » Support » Problems with REDIRECT in the nat table for iptables
Problems with REDIRECT in the nat table for iptables [message #2963] Wed, 03 May 2006 21:40 Go to next message
bpilati is currently offline  bpilati
Messages: 1
Registered: May 2006
Junior Member
Okay, n00b here.

I am trying to use the nat table to redirect all queries to port 80 are redirected to port 8080.

Here is my command

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

Here is the error:

iptables: No chain/target/match by that name

the nat table is loaded into the kernel because this command works:

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 192.168.1.10:8080

Any ideas of what I need to do for REDIRECT to work?

Thanks
Re: Problems with REDIRECT in the nat table for iptables [message #2968 is a reply to message #2963] Thu, 04 May 2006 08:11 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
I suppose, you've forgot to add ipt_REDIRECT module inside VPS.
To do it, you should, for example,
add ipt_REDIRECT in IPTABLES variable in /etc/sysconfig/vz
and restart VPS.
Re: Problems with REDIRECT in the nat table for iptables [message #3004 is a reply to message #2968] Sat, 06 May 2006 09:18 Go to previous message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

And don't forget to load the module in the host system:
# modprobe ipt_REDIRECT


http://static.openvz.org/userbars/openvz-developer.png
Previous Topic: split patches?
Next Topic: vzmigrate misses vpsid.start, .stop, .mount, .umount
Goto Forum:
  


Current Time: Sat Oct 05 12:56:29 GMT 2024

Total time taken to generate the page: 0.05958 seconds