[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help getting iptables REDIRECT to work



On Thu, 21 Oct 2010 01:33:13 +0100, Chris Haynes <chris@harvington.org.uk> 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


Reply to: