netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: vDev <vijaypas@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: Drop pings to other VLAN interfaces
Date: Tue, 9 Aug 2016 10:03:56 -0500	[thread overview]
Message-ID: <CAC=w+U5rT5pmpDeVie4+aYF4erfO7671qsNch1=q0Vb8V9k_6g@mail.gmail.com> (raw)

We have a Linux gateway with multiple VLANs with the default policy
being DROP. We have the following rules in the INPUT and OUTPUT chains
of the filter table:

iptables -I INPUT -p icmp -j ACCEPT
iptables -I OUTPUT -p icmp -j ACCEPT

to allow pings to and from the gateway. What would be the best way to
allow pings from a host on a VLAN to the VLAN interface on the gateway
and everywhere else EXCEPT to other VLAN interfaces on the gateway?

For example, if the gateway's VLAN interfaces had IP addresses
192.168.1.1/24 (vlan0) and 192.168.2.1/24 (vlan1) and host on vlan0
with address 192.168.1.8 must be able to ping 192.168.1.1 and other
public addresses EXCEPT 192.168.2.1. There could be many VLAN
interfaces so excluding each one will be not so efficient. I'm trying
to see if there's a better way that add specific DROP rules for each,
which can lead to a good number of rules depending on the number of
VLANs.

Thanks in advance for your help.

                 reply	other threads:[~2016-08-09 15:32 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='CAC=w+U5rT5pmpDeVie4+aYF4erfO7671qsNch1=q0Vb8V9k_6g@mail.gmail.com' \
    --to=vijaypas@gmail.com \
    --cc=netfilter-devel@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;
as well as URLs for NNTP newsgroup(s).