All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dobersberger Dieter <dieter@dobersberger.at>
To: netfilter@lists.netfilter.org
Subject: kernel 2.6 IPsec and netfilter
Date: Wed, 14 Jan 2004 19:51:24 +0100	[thread overview]
Message-ID: <912065890.20040114195124@redbox.org> (raw)

Hi All !

I have set up an in-kernel IPsec Tunnel with Linux 2.6.0 and want to
filter traffic going through this tunnel.

Before I upgraded to 2.6 I used FreeS/WAN on Linux 2.4 which provided
a virtual interface called ipsec0 which I could use to apply rules
after the IPsec packet has been decrypted. Now with kernel 2.6 ipsec0
is gone and the incoming interface is the same as the physical (eth0).
So the machine on the other end of the IPsec tunnel has unlimted
access to my server.

I used these rules for FreeS/WAN:

# $WWW .. ip address of the webserver
# $DB ... ip address of the database server
# both are linked with an IPsec tunnel

# allow IKE and IPsec (AH and ESP)
iptables -A INPUT -s $WWW -d $DB -p udp --dport 500 -j ACCEPT
iptables -A INPUT -s $WWW -d $DB -p 50 -j ACCEPT
iptables -A INPUT -s $WWW -d $DB -p 51 -j ACCEPT

# allow mysql via IPsec
iptables -A INPUT -i ipsec0 -p tcp -s $WWW -d $DB \
   --dport 3306 -j ACCEPT

# drop everything else
iptables -A INPUT -j DROP

The above rules don't work for in-kernel IPsec. The www server has
unlimited access to the db server because the decrypted packets are
not processed by iptables.

All I found on the net is a link to an older thread discussing the
same problem but they didn't find a solution:
http://www.spinics.net/lists/netfilter/msg18030.html

Anyone got an idea how to limit the traffic coming in via IPsec to
certain ports and block all other traffic ? Can someone please post
iptables rules that do the same filtering for in-kernel IPsec as mine
did in FreeS/WAN ?

Thanks for reading this far.
best regards,
Dieter



             reply	other threads:[~2004-01-14 18:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-14 18:51 Dobersberger Dieter [this message]
2004-01-15  3:06 ` kernel 2.6 IPsec and netfilter Dobersberger Dieter
  -- strict thread matches above, loose matches on Subject: below --
2004-03-29 11:10 Devaraj Das
2004-03-29 12:33 ` Thomas Lussnig
2004-03-29 15:13   ` Devaraj Das
2004-03-29 12:36 ` Lane Powers
2004-03-29 15:21   ` Devaraj Das

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=912065890.20040114195124@redbox.org \
    --to=dieter@dobersberger.at \
    --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.