From: Tomasz Chmielewski <mangoo@wpkg.org>
To: netfilter@vger.kernel.org
Subject: ebtables and anti-spoofing rules not working 100%?
Date: Sun, 29 Aug 2010 15:59:15 +0200 [thread overview]
Message-ID: <4C7A67B3.4070505@wpkg.org> (raw)
I have a kvm host and two kvm guests running on it.
kvm1 is assigned 1.2.3.4 IP with 11:22:33:44:55:66 MAC; uses vmtab107i0 bridged tap interface.
kvm2 is assigned 1.2.3.22 IP with AA:BB:CC:DD:EE:FF MAC.
To prevent spoofing, I created these ebtables rules:
# create a chain for kvm1
ebtables -N vm107
# drop everything, unless it's accepted later
ebtables -P vm107 DROP
# guest communication with the gateway
ebtables -A INPUT -i vmtab107i0 -j vm107
ebtables -A OUTPUT -o vmtab107i0 -j vm107
# guest communication with the world
ebtables -A FORWARD -o vmtab107i0 -j vm107
# allow 1st IP with this MAC
ebtables -A vm107 -p IPv4 -s 11:22:33:44:55:66 --ip-src 1.2.3.4 -j ACCEPT
ebtables -A vm107 -p IPv4 -d 11:22:33:44:55:66 --ip-dst 1.2.3.4 -j ACCEPT
# allow broadcast traffic
ebtables -A vm107 -p IPv4 --ip-dst 1.2.3.64 -j ACCEPT
# log everything else
ebtables -A vm107 --log-level debug --log-prefix "unexpected vm107 traffic: " --log-ip --log-arp -j CONTINUE
And it works - if kvm1 changes IP address, it's not able to communicate and "unexpected" traffic is logged.
However, when I change MAC and IP on kvm1 to match this on kvm2:
ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF
ifconfig eth0 1.2.3.22
and then arping the gateway from kvm1:
arping 1.2.3.1
kvm2 "looses" its connectivity.
I see these packets logged, so they should be dropped as well (policy is set to DROP). However, it doesn't seem to be the case.
Why do these packets get through?
What anti-spoofing rules I need to have to prevent some kvm guests pretending to be other kvm guests (or, even pretending to be "gateways")?
--
Tomasz Chmielewski
http://wpkg.org
next reply other threads:[~2010-08-29 13:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-29 13:59 Tomasz Chmielewski [this message]
2010-08-29 15:28 ` ebtables and anti-spoofing rules not working 100%? Pascal Hambourg
2010-08-29 16:46 ` Tomasz Chmielewski
2010-08-29 17:25 ` Jonathan Tripathy
2010-08-29 17:34 ` Tomasz Chmielewski
2010-08-29 18:23 ` Jonathan Tripathy
2010-08-29 18:36 ` Tomasz Chmielewski
2010-08-30 18:14 ` Pascal Hambourg
2010-08-30 18:38 ` Tomasz Chmielewski
2010-08-30 21:34 ` Pascal Hambourg
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=4C7A67B3.4070505@wpkg.org \
--to=mangoo@wpkg.org \
--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.