All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eliezer Croitoru <eliezer@ngtech.co.il>
To: Netfilter user mailing list <netfilter@vger.kernel.org>
Subject: how to set multiHOP gw rules for forward table?
Date: Sat, 03 Aug 2013 15:36:10 +0300	[thread overview]
Message-ID: <51FCF93A.6080002@ngtech.co.il> (raw)

My network is like that:

GW+DHCP 192.168.1.1, eth0:192.168.100.1 eth1:192.168.168.1.1
HOST1+DHCP 192.168.1.100, eth0:192.168.1.100 eth1:192.168.2.1
CLIENT1 192.168.2.100
There is a double NAT here at both GW and HOST1
The DHCP from GW is only towards the eth1 network and subnet.
The DHCP from HOST1 is only towards eth1.
in GW there is a masquerade rule which works fine and allows all
forwarded packets.

I do not want packets from clients in the CLIENT1 side of the network to
get access using the nat to the local network resources but that they
will have access to the internet using GW.
So basically I want to allow all forwarded traffic from the
192.168.2.0/24 network to be allowed to all networks but not the
localnet and the local GW resources.

I am a bit in a conflict in it since the next rules should work or at
least should do the trick..:
------
-A FORWARD -s 192.168.2.0/24 -i eth1 -p tcp -m state --state ESTABLISHED
-j ACCEPT
-A FORWARD -i eth1 -p icmp -j ACCEPT
-A FORWARD -s 192.168.2.0/24 -i eth1 -p tcp -m multiport --dports
53,443,80,21,22,23,110,25,143,995,993,3128,8080 -j ACCEPT
-A FORWARD ! -i eth1 -m state --state NEW -j DROP
-A FORWARD -o eth1 -j ACCEPT
-A FORWARD -d 192.168.1.0/24 -j DROP
------
Before I press the "save" button I would like for someone else to take a
small look at it.

Eliezer

                 reply	other threads:[~2013-08-03 12:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=51FCF93A.6080002@ngtech.co.il \
    --to=eliezer@ngtech.co.il \
    --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 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.