Networking Forums

Networking Forums > Computer Networking > Linux Networking > IPsec tunnel using racoon

Reply
Thread Tools Display Modes

IPsec tunnel using racoon

 
 
dee
Guest
Posts: n/a

 
      07-11-2007, 10:48 AM
Hi all,

I am trying to setup IPsec in tunnel mode between two linux hosts using
racoon as the IKE daemon. It works well in transport mode but in tunnel
mode the packets are visible seen both as ESP and without encryption.

Both hosts are running RHEL 4.0, kernel version 2.6.9-34

#cat racoon.conf
path pre_shared_key "/root/dee/psk.txt" ;
remote anonymous
{
exchange_mode aggressive,main,base;
lifetime time 24 hour;
proposal {
encryption_algorithm 3des;
hash_algorithm sha1;
authentication_method pre_shared_key;
dh_group 2;
}
}

sainfo anonymous
{
pfs_group 2;
lifetime time 12 hour ;
encryption_algorithm 3des, blowfish 448, twofish, rijndael ;
authentication_algorithm hmac_sha1, hmac_md5 ;
compression_algorithm deflate ;
}

SPD on host A (set using setkey)
spdadd 180.144.100.53/32 180.144.100.51/32 any
-P out ipsec esp/tunnel/180.144.100.53-180.144.100.51/require ;

spdadd 180.144.100.51/32 180.144.100.53/32 any
-P in ipsec esp/tunnel/180.144.100.51-180.144.100.53/require ;

SPD on host B (set using setkey)
spdadd 180.144.100.51/32 180.144.100.53/32 any
-P out ipsec esp/tunnel/180.144.100.51-180.144.100.53/require ;

spdadd 180.144.100.53/32 180.144.100.51/32 any
-P in ipsec esp/tunnel/180.144.100.53-180.144.100.51/require ;


After the policies are loaded I did a ping from host A to host B and
captured
the packets using tcpdump. I found that for every ICMP request there were
2 packets visibile on tcpdump, one with ESP and one without ESP.
Why are the packets visible without ESP?
output of tcpdump on host 1 (blrmtoyota)
16:16:31.850237 IP 180.144.100.53 > 180.144.100.51:
ESP(spi=0x0952b15c,seq=0x21)
16:16:31.850418 IP 180.144.100.51 > 180.144.100.53:
ESP(spi=0x0f9f7238,seq=0x21)
16:16:31.850418 IP 180.144.100.51 > 180.144.100.53: icmp 64: echo reply seq
0

output of tcpdump on host (blrmjordan)
10:43:14.612079 IP 180.144.100.53 > 180.144.100.51:
ESP(spi=0x0952b15c,seq=0x21)
10:43:14.612824 IP 180.144.100.53 > 180.144.100.51: icmp 64: echo request
seq 0
10:43:14.612877 IP 180.144.100.51 > 180.144.100.53:
ESP(spi=0x0f9f7238,seq=0x21)

Is there anything wrong in the policies? Or is it because the packets are
visible since the
tunnel endpoints are the same as the src and dst?

Thanks in advance
~dee


 
Reply With Quote
 
 
 
 
VANHULLEBUS Yvan
Guest
Posts: n/a

 
      07-12-2007, 03:01 PM
"dee" <(E-Mail Removed)> writes:

> Hi all,


Hi.


> I am trying to setup IPsec in tunnel mode between two linux hosts using
> racoon as the IKE daemon. It works well in transport mode but in tunnel
> mode the packets are visible seen both as ESP and without encryption.


I already noticed this bug.

You can notice that each peer only sees INCOMING traffic both with and
without encryption (you'll also see a third UDP packet if you have
NAT-Traversal).

It looks like Linux's IPSec stack reinjects packets "somewhere" before
libpcap can see them, so packets will be seen before and after IPSec
process.

You can just add a sniffing device between your IPSec gates to be sure
that the traffic is correctly encryypted on the wire.


Yvan.
 
Reply With Quote
 
dee
Guest
Posts: n/a

 
      07-16-2007, 08:53 AM
> You can just add a sniffing device between your IPSec gates to be sure
> that the traffic is correctly encryypted on the wire.

Thanks yvan. I will check that

>
>
> Yvan.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ipsec tunnel mode vs ip in ip with ipsec transport Reji Linux Networking 1 09-20-2011 04:29 PM
IPSec with Racoon: Roadwarrior-Gateway Setup Marco Ender Linux Networking 0 05-04-2009 04:28 PM
IPSec racoon/cisco problem Vittorio Talamo Linux Networking 0 07-10-2008 11:23 AM
IPsec tunnel through NAT & TUN adapters - How? Kris Windows Networking 0 08-27-2007 07:44 PM
Help! Ipsec-tools/Racoon link through NAT .. "ip route" fails Sundial Services Linux Networking 12 11-28-2004 06:33 PM



1 2 3 4 5 6 7 8 9 10 11