Linux Netfilter discussions
 help / color / mirror / Atom feed
* Port redirection not working
@ 2008-01-24 11:43 Gustavo Narea
  2008-01-24 13:49 ` Eric Leblond
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo Narea @ 2008-01-24 11:43 UTC (permalink / raw)
  To: netfilter

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

Hello, everyone.

I'm new to netfilter and I'm trying to set a port redirection from port 80 to 
port 8080.

I'm using this line in the attached file:
-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080

But there's something wrong with it, and I don't know what.

When I run `iptables-restore < /etc/iptables.config', I get this error:
iptables-restore: line 7 failed

I'm using Debian Etch.

Thanks in advance!
-- 
Gustavo Narea.
http://gustavonarea.net/

Get GNU/Linux! http://www.getgnulinux.org/

[-- Attachment #2: iptables.config --]
[-- Type: text/plain, Size: 654 bytes --]

*filter
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state INVALID -j DROP
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
-A INPUT -p tcp -j REJECT --reject-with tcp-reset
-A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable
-A INPUT -j REJECT --reject-with icmp-proto-unreachable
-A FORWARD -j REJECT --reject-with icmp-port-unreachable
COMMIT

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-24 15:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-24 11:43 Port redirection not working Gustavo Narea
2008-01-24 13:49 ` Eric Leblond
2008-01-24 15:04   ` Gustavo Narea
2008-01-24 15:32     ` Eric Leblond
2008-01-24 15:50       ` Gustavo Narea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox