Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jun 2011 00:54:39 +0300
From:      NutipA <nnutipa@gmail.com>
To:        questions@FreeBSD.org
Subject:   Traffic ignore security policies for SA in IPSec site-to-site connection
Message-ID:  <4E07AA9F.90509@gmail.com>

Next in thread | Raw E-Mail | Index | Archive | Help
This is a multi-part message in MIME format.
--------------080205010603090104070605
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

First af all, I apologize if I chose the wrong mailing list. I need to 
establish IPSec site-to-site connection between two offices as it shown 
below:

LAN1 (192.168.1.0/24)
|
FreeBSD 8.2 (192.168.1.2) + ipfw NAT over PPTP(X.X.X.X)
|
|
internet
|
|
FreeBSD 8.2 (192.168.1.2) + ipfw NAT over PPPoE(X.X.X.X)
|
LAN2 (192.168.10.0/24)

The connection between two gatways has been successfully established. 
All traffic between two VPN-gateways with global addresses X.X.X.X and 
Y.Y.Y.Y has been sucessfully encapsulated and encrypted. I see this 
traffic as packets with ESP headers in my sniffer. Then I added static 
routes to each LAN. But when I ping any private address in LAN2 from my 
computer (192.168.1.102) I see the next output in tcpdump on LAN1 gateway:

19:33:42.506971 IP X.X.X.X > Y.Y.Y.Y : IP 192.168.1.102 > 192.168.10.1: 
ICMP echo request, id 13941, seq 4, length 64 (ipip-proto-4)

Traffic hasn't been encrypted and processed by ipsec! It has rather been 
placed only in gif-interface and of course remote site is not 
responding. So IP-packets ignore security policies for SA:

192.168.10.0/24[any] 192.168.1.0/24[any] any
         in ipsec
         esp/tunnel/Y.Y.Y.Y-X.X.X.X/use
         spid=6 seq=1 pid=23533
         refcnt=1
192.168.1.0/24[any] 192.168.10.0/24[any] any
         out ipsec
         esp/tunnel/X.X.X.X-Y.Y.Y.Y/use
         spid=5 seq=0 pid=23533
         refcnt=1

As I understand, the traffic from client machines in any direction 
should look like this:

21:34:16.486698 IP Y.Y.Y.Y > X.X.X.X: ESP(spi=0x043488c2,seq=0x66), 
length 116

Please help me to solve this strange problem.  I have created a test 
environment (5 virtual machines) and everything was ok! The only 
difference was that the tests were run in a several private local 
networks, without ISP and pptp/pppoe-interfaces. Also, on the advice of 
other people I need to try it without gif-interface, but all my tests 
was made according by handbook article.

P.S. I have attached my configs and output of any commands, because my 
message is too big.

--------------080205010603090104070605
Content-Type: text/plain;
 name="ipsec_configs.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="ipsec_configs.txt"

WzE5OjAwXXJvb3RAYmV0YTovaG9tZS9OdXRpcEEjIGNhdCAvdXNyL2xvY2FsL2V0Yy9yYWNv
b24vc2V0a2V5LmNvbmYKZmx1c2g7CnNwZGZsdXNoOwojIFRvIHRoZSBzZWNvbmQgb2ZmaWNl
IG5ldHdvcmsKc3BkYWRkIDE5Mi4xNjguMS4wLzI0IDE5Mi4xNjguMTAuMC8yNCBhbnkgLVAg
b3V0IGlwc2VjIGVzcC90dW5uZWwvWC5YLlguWC1ZLlkuWS5ZL3JlcXVpcmU7CnNwZGFkZCAx
OTIuMTY4LjEwLjAvMjQgMTkyLjE2OC4xLjAvMjQgYW55IC1QIGluIGlwc2VjIGVzcC90dW5u
ZWwvWS5ZLlkuWS1YLlguWC5YL3JlcXVpcmU7CgotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KClsx
OTowMl1yb290QGJldGE6L2hvbWUvTnV0aXBBIyBjYXQgL3Vzci9sb2NhbC9ldGMvcmFjb29u
L3JhY29vbi5jb25mCnBhdGggICAgcHJlX3NoYXJlZF9rZXkgICIvdXNyL2xvY2FsL2V0Yy9y
YWNvb24vcHNrLnR4dCI7ICNsb2NhdGlvbiBvZiBwcmUtc2hhcmVkIGtleSBmaWxlCmxvZyAg
ICAgZGVidWc7ICAjbG9nIHZlcmJvc2l0eSBzZXR0aW5nOiBzZXQgdG8gJ25vdGlmeScgd2hl
biB0ZXN0aW5nIGFuZCBkZ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ZSAgICAgICAgIG9mZjsKICAg
ICAgICBwcm9wb3NhbF9jaGVjayAgb2JleTsKIyAgICAgICBuYXRfdHJhdmVyc2FsICAgb2Zm
OwogICAgICAgIGdlbmVyYXRlX3BvbGljeSBvZmY7CgogICAgICAgICAgICAgICAgICAgICAg
ICBwcm9wb3NhbCB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5jcnlwdGlv
bl9hbGdvcml0aG0gICAgM2RlczsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBo
YXNoX2FsZ29yaXRobSAgICAgICAgICBtZDU7CiAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgYXV0aGVudGljYXRpb25fbWV0aG9kICAgcHJlX3NoYXJlZF9rZXk7CiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgbGlmZXRpbWUgdGltZSAgICAgICAgICAgMzAgc2Vj
OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRoX2dyb3VwICAgICAgICAgICAg
ICAgIDE7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KfQoKc2FpbmZvICAoYWRkcmVzcyAx
OTIuMTY4LjEuMC8yNCBhbnkgYWRkcmVzcyAxOTIuMTY4LjEwLjAvMjQgYW55KSAgICAjIGFk
ZHJlc3MgJG5ldHdvcmsvJG5ldG1hc2sgJHR5cGUgYWRkcmVzcyAkbmV0d29yay8kbmV0bWFz
CnsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyAkbmV0d29yayBtdXN0IGJlIHRo
ZSB0d28gaW50ZXJuYWwgbmV0d29ya3MgeW91IGFyZSBqb2luaW5nLgogICAgICAgIHBmc19n
cm91cCAgICAgICAxOwogICAgICAgIGxpZmV0aW1lICAgICAgICB0aW1lICAgIDM2MDAwIHNl
YzsKICAgICAgICBlbmNyeXB0aW9uX2FsZ29yaXRobSAgICAzZGVzLGRlczsKICAgICAgICBh
dXRoZW50aWNhdGlvbl9hbGdvcml0aG0gICAgICAgIGht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gIGdpZjAKCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQoKWzE4OjU3XXJvb3RA
YmV0YTovaG9tZS9OdXRpcEEjIGNhdCAvZXRjL3JjLmNvbmYgCnpmc19lbmFibGU9IllFUyIK
aG9zdG5hbWU9ImJldGEiCmlmY29uZmlnX2VtMD0iaW5ldCAxOTIuMTY4LjEuMiBuZXRtYXNr
IDI1NS4yNTUuMjU1LjAgLXJ4Y3N1bSAtdHhjc3VtIC10c28iCnNzaGRfZW5hYmxlPSJZRVMi
CmlmY29uZmlnX3ZyMD0iREhDUCIKZ2F0ZXdheV9lbmFibGU9IllFUyIKZmlyZXdhbGxfZW5h
YmxlPSJZRVMiCmZpcmV3YWxsX25hdF9lbmFibGU9IllFUyIKZHVtbXluZXRfZW5hYmxlPSJZ
RVMiCmZpcmV3YWxsX3R5cGU9Ii9ldGMvZmlyZXdhbGwiCgotLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0KCg==
--------------080205010603090104070605--



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?4E07AA9F.90509>