]> code.ossystems Code Review - meta-freescale.git/blob
16c31578eb47a8a649a7f321c1dbbb8c08516a4a
[meta-freescale.git] /
1 #!/usr/sbin/setkey -f
2 #
3 #
4 # Example ESP Tunnel for VPN.
5
6 #                                 ========= ESP =========
7 #                                 |                     |
8 #          Network-A          Gateway-A             Gateway-B           Network-B
9 #         192.168.1.0/24 ---- 200.200.200.10 ------ 200.200.200.20 ---- 192.168.2.0/24
10
11 #         ====== 83xx board A ======                  ===== 83xx board B =====
12 #         |                        |                  |                      |
13 #         eth0                  eth1                  eth1                eth0
14 #       192.168.1.130         200.200.200.10          200.200.200.20      192.168.2.130         
15
16
17 # Board B setup
18 # Flush the SAD and SPD
19 flush;
20 spdflush;
21
22 # I am gateway B (eth0:192.168.2.130, eth1:200.200.200.20)
23 #
24 # Security policies
25
26 spdadd 192.168.2.0/24 192.168.1.0/24 any -P out ipsec
27        esp/tunnel/200.200.200.20-200.200.200.10/require;
28
29 spdadd 192.168.1.0/24 192.168.2.0/24 any -P in ipsec
30        esp/tunnel/200.200.200.10-200.200.200.20/require;
31
32 # ESP SAs doing encryption using 192 bit long keys (168 + 24 parity)
33 # and hmac-sha1 authentication using 160 bit long keys
34 add 200.200.200.10 200.200.200.20 esp 0x201 -m tunnel
35     -E 3des-cbc  0x7aeaca3f87d060a12f4a4487d5a5c3355920fae69a96c831 
36     -A hmac-sha1 0xe9c43acd5e8d779b6e09c87347852708ab49bdd3;
37
38 add 200.200.200.20 200.200.200.10 esp 0x301 -m tunnel
39     -E 3des-cbc  0xf6ddb555acfd9d77b03ea3843f2653255afe8eb5573965df 
40     -A hmac-sha1 0xea6856479330dc9c17b8f6c37e2a895363d83f21;
41