]> code.ossystems Code Review - meta-freescale.git/blob
e7726f0880667ce48e4650f82370365328fd491f
[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 A setup
18 #
19 # Flush the SAD and SPD
20 flush;
21 spdflush;
22
23 # I am gateway A (eth0:192.168.1.130, eth1:200.200.200.10)
24 #
25 # Security policies
26 spdadd 192.168.1.0/24 192.168.2.0/24 any -P out ipsec
27        esp/tunnel/200.200.200.10-200.200.200.20/require;
28
29 spdadd 192.168.2.0/24 192.168.1.0/24 any -P in ipsec
30        esp/tunnel/200.200.200.20-200.200.200.10/require;
31
32
33 # ESP SAs doing encryption using 192 bit long keys (168 + 24 parity)
34 # and hmac-sha2-256 authentication using 256 bit long keys
35 add 200.200.200.10 200.200.200.20 esp 0x10513 -m tunnel
36     -E 3des-cbc       0x7aeaca3f87d060a12f4a4487d5a5c3355920fae69a96c831 
37     -A hmac-sha2-256  0x4de03bebf6beb4fdef5a67d349a09580466cc4e54503333b2a5fd34538c91198;
38
39 add 200.200.200.20 200.200.200.10 esp 0x10514 -m tunnel
40     -E 3des-cbc       0xf6ddb555acfd9d77b03ea3843f2653255afe8eb5573965df 
41     -A hmac-sha2-256  0x5e01eb780b7ecc074ca2ca4fa4a5ea2ff841c977da0ce61c49d1fe767ea5452c;
42