dpdk: Add support for Mellanox ConnectX-4 devices
[vpp.git] / src / vnet / ipsec-gre / ipsec_gre_doc.md
1 # VPP L2-GRE over IPsec implementation    {#ipsec_gre_doc}
2
3 This is a memo intended to contain documentation of the VPP L2-GRE over IPsec implementation.
4 Everything that is not directly obvious should come here.
5
6
7 ## L2-GRE over IPsec
8 GRE encapsulate layer 2 traffic and IPSec encrypt what is encapsulated by GRE. The whole point of L2-GRE over IPSec is to tunnel layer 2 over GRE and IPSec by bridging the physical interface with IPSec-GRE tunnel interface.
9
10 There are 2 dedicated nodes for encapsulation:
11 * ipsec-gre<n>-tx - add GRE header
12 * esp-encrypt - encrypt GRE packet to ESP packet
13
14 There are 3 dedicated nodes for decapsulation:
15 * ipsec-if-input - match IPSec SA by source IP address and SPI in ESP packet
16 * esp-decrypt - decrypt ESP packet
17 * ipsec-gre-input - remove GRE header
18
19
20 ### Configuration
21
22 L2-GRE over IPsec support the following CLI configuration command:
23     create ipsec gre tunnel src <addr> dst <addr> local-sa <id> remote-sa <id> [del]
24
25 src: tunnel source IPv4 address
26 dst: tunnel destination IPv4 address
27 local-sa: tunnel local IPSec Security Association
28 remote-sa: tunnel remote IPSec Security Association
29 del: delete IPSec-GRE tunnel
30
31 L2-GRE over IPsec support the following API configuration command:
32     ipsec_gre_add_del_tunnel src <addr> dst <addr> local_sa <sa-id> remote_sa <sa-id> [del]
33
34 src: tunnel source IPv4 address
35 dst: tunnel destination IPv4 address
36 local_sa: tunnel local IPSec Security Association
37 remote_sa: tunnel remote IPSec Security Association
38 del: delete IPSec-GRE tunnel
39
40
41 ### Configuration example
42
43 Interface GigabitEthernet0/9/0 is in bridge with ipsec-gre0 tunnel interface, interface GigabitEthernet0/8/0 sending encapsulated and encrypted traffic.
44
45 Configure IPv4 address on sending interface:
46 set int ip address GigabitEthernet0/8/0 192.168.1.1/24
47
48 Configure IPSec Security Associations:
49 ipsec sa add 10 spi 1001 esp crypto-key 4a506a794f574265564551694d653768 crypto-alg aes-cbc-128 integ-key 4339314b55523947594d6d3547666b45764e6a58 integ-alg sha1-96
50 ipsec sa add 20 spi 1000 esp crypto-key 49517065716d6235726c734a4372466c crypto-alg aes-cbc-128 integ-key 307439636a5542735133595835546f68534e4f64 integ-alg sha1-96
51
52 Create IPSec-GRE tunnel:
53 create ipsec gre tunnel src 192.168.1.1 dst 192.168.1.2 local-sa 10 remote-sa 20
54
55 Set interfaces state:
56 set int state GigabitEthernet0/8/0 up
57 set int state GigabitEthernet0/9/0 up
58 set int state ipsec-gre0 up
59
60 Bridge physical interface with IPSec-GRE tunnel interface:
61 set interface l2 bridge GigabitEthernet0/9/0 1
62 set interface l2 bridge ipsec-gre0 1
63
64
65 ### Operational data
66
67 L2-GRE over IPsec support the following CLI show command:
68     show ipsec gre tunnel
69
70 L2-GRE over IPsec support the following API dump command:
71     ipsec_gre_tunnel_dump [sw_if_index <nn>]
72
73 sw_if_index: software interface index of the IPSec-GRE tunnel interface
74