Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Patrick Leslie Polzer <leslie.polzer@gmx.net>
To: netfilter@lists.netfilter.org
Subject: Re: Please, see this firewall and say (have pity...:)
Date: Thu, 10 Jun 2004 09:55:03 +0200	[thread overview]
Message-ID: <20040610095503.521ce916.leslie.polzer@gmx.net> (raw)
In-Reply-To: <BAY1-DAV32gyeG6Hbit000332cc@hotmail.com>

On Thu, 10 Jun 2004 01:36:28 -0300
"Ricardo C" <racham@hotmail.com> wrote:

> You could give me your opinions????
I don't have enough time to comment on all of this, but using loops increases
readability, so

$IPTABLES -t nat -A PREROUTING -p tcp -d $INET_IP --dport 4661 -j DNAT --to-destination 192.168.111.2:4661
$IPTABLES -t nat -A PREROUTING -p tcp -d $INET_IP --dport 4662 -j DNAT --to-destination 192.168.111.2:4662
$IPTABLES -t nat -A PREROUTING -p tcp -d $INET_IP --dport 4711 -j DNAT --to-destination 192.168.111.2:4711
$IPTABLES -t nat -A PREROUTING -p UDP -d $INET_IP --dport 4000 -j DNAT --to-destination 192.168.111.2:4000
$IPTABLES -t nat -A PREROUTING -p UDP -d $INET_IP --dport 4665 -j DNAT --to-destination 192.168.111.2:4665
$IPTABLES -t nat -A PREROUTING -p UDP -d $INET_IP --dport 4672 -j DNAT --to-destination 192.168.111.2:4672

should become

for port in 4661 4662 4711 4000 4665 4672; do
    $IPTABLES -t nat -A PREROUTING -p tcp -d $INET_IP --dport $port -j DNAT
        --to-destination 192.168.111.2
done

Apply this to other apt locations in your firewall script as well.


Kind regards,

Leslie


      reply	other threads:[~2004-06-10  7:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-10  4:36 Please, see this firewall and say (have pity...:) Ricardo C
2004-06-10  7:55 ` Patrick Leslie Polzer [this message]

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=20040610095503.521ce916.leslie.polzer@gmx.net \
    --to=leslie.polzer@gmx.net \
    --cc=netfilter@lists.netfilter.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