aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/vnet/ipsec
blob: bf3cbbc56e72e161ca8ca1fec42a22fb6cedd7c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
create packet-generator interface pg0
create packet-generator interface pg1

pipe create

ip table add 1
set int ip table pg1 1
set int ip table pipe0.1 1

set int ip address pg0 192.168.0.1/24
set int ip address pg1 192.168.1.1/24

set int ip address pipe0.0 10.0.0.1/24
set int ip address pipe0.1 10.0.0.2/24

set int state pg0 up
set int state pg1 up
set int state pipe0 up

create ipsec tunnel local-ip 10.0.0.1 remote-ip 10.0.0.2 local-spi 100 remote-spi 101 local-crypto-key 6541686776336961656264656f6f6579 remote-crypto-key 6541686776336961656264656f6f6579 crypto-alg aes-cbc-128

set int state ipsec0 up
set int unnum ipsec0 use pg0

create ipsec tunnel local-ip 10.0.0.2 remote-ip 10.0.0.1 local-spi 101 remote-spi 100 tx-table 1 local-crypto-key 6541686776336961656264656f6f6579 remote-crypto-key 6541686776336961656264656f6f6579 crypto-alg aes-cbc-128

set int state ipsec1 up
set int ip table ipsec1 1
set int unnum ipsec1 use pg1

ip route add 192.168.1.0/24 via ipsec0
set ip arp pg1 192.168.1.2 00:11:22:33:44:55
ip route add table 1 192.168.0.0/24 via ipsec1
set ip arp pg0 192.168.0.2 00:11:22:33:44:66

trace add pg-input 100

packet-generator new {
  name ipsec1
  limit 1
  rate 1e4
  node ip4-input
  interface pg0
  size 100-100
  data {
   UDP: 192.168.0.2 -> 192.168.1.2
   UDP: 4321 -> 1234
    length 72
    incrementing 100
  }
}
packet-generator new {
  name ipsec2
  limit 1
  rate 1e4
  node ip4-input
  interface pg1
  size 100-100
  data {
   UDP: 192.168.1.2 -> 192.168.0.2
   UDP: 4321 -> 1234
    length 72
    incrementing 100
  }
}
| | @ref src/svm | Shared virtual memory allocation library | | src/tests | Standalone tests (not part of test harness) | | src/vat | VPP API test program | | @ref src/vlib | VPP application library | | @ref src/vlibapi | VPP API library | | @ref src/vlibmemory | VPP Memory management | | @ref src/vnet | VPP networking | | @ref src/vpp | VPP application | | @ref src/vpp-api | VPP application API bindings | | @ref src/vppinfra | VPP core library | | @ref src/vpp/api | Not-yet-relocated API bindings | | test | Unit tests and Python test harness | ## Getting started In general anyone interested in building, developing or running VPP should consult the [VPP wiki](https://wiki.fd.io/view/VPP) for more complete documentation. In particular, readers are recommended to take a look at [Pulling, Building, Running, Hacking, Pushing](https://wiki.fd.io/view/VPP/Pulling,_Building,_Run ning,_Hacking_and_Pushing_VPP_Code) which provides extensive step-by-step coverage of the topic. For the impatient, some salient information is distilled below. ### Quick-start: On an existing Linux host To install system dependencies, build VPP and then install it, simply run the build script. This should be performed a non-privileged user with `sudo` access from the project base directory: ./extras/vagrant/build.sh If you want a more fine-grained approach because you intend to do some development work, the `Makefile` in the root directory of the source tree provides several convenience shortcuts as `make` targets that may be of interest. To see the available targets run: make ### Quick-start: Vagrant The directory `extras/vagrant` contains a `VagrantFile` and supporting scripts to bootstrap a working VPP inside a Vagrant-managed Virtual Machine. This VM can then be used to test concepts with VPP or as a development platform to extend VPP. Some obvious caveats apply when using a VM for VPP since its performance will never match that of bare metal; if your work is timing or performance sensitive, consider using bare metal in addition or instead of the VM. For this to work you will need a working installation of Vagrant. Instructions for this can be found [on the Setting up Vagrant wiki page] (https://wiki.fd.io/view/DEV/Setting_Up_Vagrant). ## More information Several modules provide documentation, see @subpage user_doc for more end-user-oriented information. Also see @subpage dev_doc for developer notes. Visit the [VPP wiki](https://wiki.fd.io/view/VPP) for details on more advanced building strategies and other development notes. ## Test Framework There is PyDoc generated documentation available for the VPP test framework. See @ref test_framework_doc for details.