From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter <netfilter@lists.netfilter.org>
Subject: Re: Nat for two private subnets with subnet routing
Date: Wed, 21 Jul 2004 23:02:53 +0100 [thread overview]
Message-ID: <200407212302.53814.Antony@Soft-Solutions.co.uk> (raw)
In-Reply-To: <40FEE340.8090907@ctwa.com>
On Wednesday 21 July 2004 10:42 pm, Gerry Weaver wrote:
> Hello All,
>
> I'm having a bit of trouble setting up a linux router with two private
> subnets. Each subnet can access the internet, but they cannot
> communicate with each other. I've include my rules. Any and all advice
> would be greatly appreciated.
I believe that this rule:
> iptables -t nat -A POSTROUTING -s 10.10.11.0/24 -j SNAT --to $WAN_IP
would benefit from specifying that it only applies to packets leaving via
$WAN_IFACE, otherwise it is going to SNAT packets from LAN1 to LAN2 and apply
the source address of $WAN_IP, which is probably not what you want?
> iptables -t mangle -A PREROUTING -i $LAN_IFACE1 -s
> $INTERNAL_ADDRESS_RANGE1 -j ACCEPT
Why are you bothering to specify ACCEPT rules in the mangle table?
> iptables -t mangle -A PREROUTING -i $WAN_IFACE -s
> $INTERNAL_ADDRESS_RANGE1 -j DROP
I do not agree with DROPping packets in the mangle table. DROP is a
filtering action, and belongs in the filter tables.
> iptables -A FORWARD -p all -s $INTERNAL_ADDRESS_RANGE1 -d
> $INTERNAL_ADDRESS_RANGE1 -j ACCEPT
>
> iptables -A FORWARD -p ALL -s $INTERNAL_ADDRESS_RANGE2 -d
> $INTERNAL_ADDRESS_RANGE2 -j ACCEPT
I do not understand the above two rules. Are internal address range1 and 2
the subnets on LAN1 and LAN2? If so, packets between same-subnet addresses
are not going to pass through your firewall. If not, what are they?
I suggest you firstly identify whether you have a routing problem or a
firewalling problem.
Disconnect the machine from the WAN link to the Internet, flush all rules in
all tables and apply default ACCEPT policies to all chains, then see if LAN1
can communicate with LAN2.
If they can, start with a simple ruleset and build up gradually so that you
can find out which rule/s break the inter-LAN routing.
If they cannot, then your problem is a routing problem, not netfilter, and I
suggest you check the routing table on the firewall.
If you want further help, please post the output of: "iptables -L -nvx;
iptables -L -t nat -nvx; iptables -L -t mangle -nvx; route -n".
Regards,
Antony.
--
If builders made buildings the way programmers write programs, then the first
woodpecker to come along would destroy civilisation.
Please reply to the list;
please don't CC me.
next prev parent reply other threads:[~2004-07-21 22:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-21 21:42 Nat for two private subnets with subnet routing Gerry Weaver
2004-07-21 22:02 ` Antony Stone [this message]
2004-07-21 22:56 ` John A. Sullivan III
2004-07-23 12:57 ` Firewall IP change Frédéric Gonzatti
2004-07-24 15:47 ` Antony Stone
2004-07-26 12:13 ` Frédéric Gonzatti
2004-07-26 12:27 ` Antony Stone
2004-07-26 13:20 ` Frédéric Gonzatti
2004-07-26 13:43 ` Antony Stone
2004-07-26 14:03 ` Distributed firewall Gianni Mantellini
2004-07-30 13:22 ` Firewall IP change Fred
2004-07-31 13:50 ` Antony Stone
2004-08-01 3:40 ` Zoup
2004-08-02 12:07 ` Frédéric Gonzatti
2004-08-02 12:26 ` Antony Stone
2004-08-02 14:12 ` Frédéric Gonzatti
2004-08-02 14:57 ` Antony Stone
2004-08-02 15:10 ` Frédéric Gonzatti
-- strict thread matches above, loose matches on Subject: below --
2004-07-21 5:42 Nat for two private subnets with subnet routing Gerry Weaver
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=200407212302.53814.Antony@Soft-Solutions.co.uk \
--to=antony@soft-solutions.co.uk \
--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.