From: Gustavo Narea <me@gustavonarea.net>
To: netfilter@vger.kernel.org
Subject: Port redirection not working
Date: Thu, 24 Jan 2008 12:43:43 +0100 [thread overview]
Message-ID: <200801241243.43277.me@gustavonarea.net> (raw)
[-- 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
next reply other threads:[~2008-01-24 11:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-24 11:43 Gustavo Narea [this message]
2008-01-24 13:49 ` Port redirection not working Eric Leblond
2008-01-24 15:04 ` Gustavo Narea
2008-01-24 15:32 ` Eric Leblond
2008-01-24 15:50 ` Gustavo Narea
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200801241243.43277.me@gustavonarea.net \
--to=me@gustavonarea.net \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox