From: Grant Taylor <gtaylor@riverviewtech.net>
To: Mail List - Netfilter <netfilter@lists.netfilter.org>
Subject: Re: not [!] rule is not working
Date: Thu, 16 Aug 2007 09:39:17 -0500 [thread overview]
Message-ID: <46C46195.9070500@riverviewtech.net> (raw)
In-Reply-To: <d41814cf0708152256w2e5e146cs7306e9e40e3b6872@mail.gmail.com>
On 08/16/07 00:56, pankaj jain wrote:
> I have a machine with 3 interfaces
> eth0: 10.19.0.102 mask (255.255.255.0)
> eth1: 10.19.1.102 mask (255.255.255.0)
> eth2: 10.29.51.102 mask (255.255.255.0)
Ok,
> all three are connected in a same switch (no vlans configured). I
> want arp requests to be responded by the associated interface only,
> and not by other interfaces.
Ok,
> I have added following rules.
> arptables -A INPUT -i eth0 --opcode Request -d 10.19.0.102 -j ACCEPT
> arptables -A INPUT -i eth1 --opcode Request -d 10.19.1.102 -j ACCEPT
> arptables -A INPUT -i eth2 --opcode Request -d 10.19.51.102 -j ACCEPT
> arptables -A INPUT -i !eth0 --opcode Request -d 10.19.0.102 -j DROP
> arptables -A INPUT -i !eth1 --opcode Request -d 10.19.1.102 -j DROP
> arptables -A INPUT -i !eth2 --opcode Request -d 10.19.51.102 -j DROP
>
> DROP rules with [!] are not working.
Hum. I would not think that you even needed the ARPTables rules to
prevent the wrong interface from responding to an ARP request for
another IP. Are you seeing this happen? Or is the purely preventative?
> but if I remove the interface part it works fine
> arptables -A INPUT -i eth0 --opcode Request -d 10.19.0.102 -j ACCEPT
> arptables -A INPUT -i eth1 --opcode Request -d 10.19.1.102 -j ACCEPT
> arptables -A INPUT -i eth2 --opcode Request -d 10.19.51.102 -j ACCEPT
> arptables -A INPUT --opcode Request -d 10.19.0.102 -j DROP
> arptables -A INPUT --opcode Request -d 10.19.1.102 -j DROP
> arptables -A INPUT --opcode Request -d 10.19.51.102 -j DROP
In short, you are allowing the ARP request for the specific interface /
IP pair and then dropping any other ARP requests. You really could
re-write the above as such:
arptables -A INPUT -i eth0 --opcode Request -d 10.19.0.102 -j ACCEPT
arptables -A INPUT -i eth1 --opcode Request -d 10.19.1.102 -j ACCEPT
arptables -A INPUT -i eth2 --opcode Request -d 10.19.51.102 -j ACCEPT
arptables -A INPUT --opcode Request -j DROP
Rather I think this will work, but I can not guarantee that you will not
have to take some precautions to make sure that you don't effect other
possible interfaces (loop back / dummy / etc).
Grant. . . .
next prev parent reply other threads:[~2007-08-16 14:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-14 6:45 not [!] rule is not working pankaj jain
2007-08-14 10:48 ` Gáspár Lajos
2007-08-14 12:28 ` pankaj jain
2007-08-14 14:24 ` Grant Taylor
2007-08-14 14:27 ` Grant Taylor
2007-08-14 14:36 ` Grant Taylor
2007-08-16 5:56 ` pankaj jain
2007-08-16 14:39 ` Grant Taylor [this message]
2007-08-16 15:07 ` Pascal Hambourg
2007-08-16 15:27 ` Grant Taylor
2007-08-16 21:47 ` Franck Joncourt
2007-08-17 8:09 ` pankaj jain
2007-08-17 13:54 ` Grant Taylor
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=46C46195.9070500@riverviewtech.net \
--to=gtaylor@riverviewtech.net \
--cc=gtaylor+reply@riverviewtech.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