From: Metal Gear <finattack@gmail.com>
To: netfilter@lists.netfilter.org
Subject: Port forwarding error
Date: Tue, 1 Mar 2005 22:45:30 +0500 [thread overview]
Message-ID: <110c78440503010945afcfa69@mail.gmail.com> (raw)
In-Reply-To: <42244EE2.5000206@mnemon.de>
Hi,
First of all thanks for quick reply.
After reading the reply throughly i completed my rulesets and sending
it for ur review. I m need little explanation regarding rules u sent
to me
[Quote]
You can do it this way. Remember, that only NEW packages (with SYN
set) will hit this rule. Next step is to allow these connection in
FORWARD chain (assuming the policy id DROP or REJECT).
[/Quote] and
[Quote]
And don't forget to allow ICMP "Destination Unreachable" :)
[/Quote]
Why is this sooo??? Why we need the above two rules.
And for the rules for pop, smtp and dns forwarding what i understood
from the diagram (tables_traverse.jpg) of
(http://iptables-tutorial.frozentux.net/)
- We got a packet from network
- We done NAT PREROUTING
- We FORWARDED the packet
- We done NAT POSTROUTING
- The packet agains flow the interface
Am i right???????
Below is my final rules script based on your help
Thanks
-----------------------------------------------------------------------------------
#!/bin/sh
# Flushing the chains
iptables -F
iptables -F -t nat
# Allow icmp destination unreacable
iptables -A INPUT -p icmp -m icmp --icmp-type destination-unreachable -j ACCEPT
# Rules for Squid
iptables -A INPUT -p tcp -s $LAN_ADDRESS/$NETMASK --dport 3128 -m
state --state NEW,ESTABLISHED,RELATED -j accept
iptables -A OUTPUT -p tcp -d $LAN_ADDRESS/$NETMASK --sport 3128 -m
state --state ESTABLISHED,RELATED -j accept
# Enabling POP3 Forwarding
iptables -A PREROUTING -t nat -d squidip -p tcp --dport 110 -j DNAT
--to $POPSERVER
iptables -A FORWARD -p tcp --dport 110 -d $POPSERVER -m state --state
NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -p tcp --sport 110 -s $POPSERVER -m state --state
ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -p tcp --dport 110 -d $POPSERVER -j
SNAT --to $SQUIDIP
# Enabling SMTP Forwarding
iptables -A PREROUTING -t nat -d squidip -p tcp --dport 25 -j DNAT
--to $SMTPSERVER
iptables -A FORWARD -p tcp --dport 25 -d $SMTPSERVER -m state --state
NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -p tcp --sport 25 -s $SMTPSERVER -m state --state
ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -p tcp --dport 25 -d $SMTPSERVER -j
SNAT --to $SQUIDIP
# Enabling DNS Forwarding
iptables -A PREROUTING -t nat -d squidip -p udp --dport 53 -j DNAT
--to $DNSSERVER
iptables -A FORWARD -p udp --dport 53 -d $DNSSERVER -m state --state
NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -p udp --sport 53 -s $DNSSERVER -m state --state
ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -p udp --dport 53 -d $DNSSERVER -j SNAT
--to $SQUIDIP
next prev parent reply other threads:[~2005-03-01 17:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-01 10:07 Port forwarding error Metal Gear
2005-03-01 11:15 ` Jörg Harmuth
2005-03-01 17:45 ` Metal Gear [this message]
2005-03-02 11:07 ` Jörg Harmuth
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=110c78440503010945afcfa69@mail.gmail.com \
--to=finattack@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.