Re: Help getting iptables REDIRECT to work

Julien Vehent <[email protected]>
Newsgroups gmane.linux.debian.devel.firewall
Organization linuxwall.info
Message-ID <a0981c9120fd952cb42ec0eef9495002@localhost>
On Thu, 21 Oct 2010 01:33:13 +0100, Chris Haynes <[email protected]> wrote:
> $ sudo iptables -v -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT
> --to-port 8080
> REDIRECT tcp opt -- in * out * 0.0.0.0/0 -> 0.0.0.0/0 tcp dpt:80 redir
> ports 8080 
> iptables: No chain/target/match by that name
> 

Has the sage would say, RTFM. If you had, you would have noticed that you missed an "s" at --to-ports :p

# iptables -v -A PREROUTING -t nat -p tcp --dport 1234 -j REDIRECT --to-ports 5678
REDIRECT  tcp opt -- in * out *  0.0.0.0/0  -> 0.0.0.0/0  tcp dpt:1234 redir ports 5678

# iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 REDIRECT   tcp  --  any    any     anywhere             anywhere            tcp dpt:1234 redir ports 5678



Julien
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.