blob: faa891dc2c45c835c7057c2429804dc4c5a9986e [file] [log] [blame]
BenoƮt Ganne40aa27e2020-11-06 14:14:23 +01001
2create packet-generator interface pg0
3set int mac addr pg0 4.5.6
4
5create sub-interfaces pg0 1
6create sub-interfaces pg0 2
7create sub-interfaces pg0 3
8
9ip table add 1
10ip table add 2
11ip table add 3
12
13set int ip table pg0.1 1
14set int ip table pg0.2 2
15set int ip table pg0.3 3
16
17set int ip address pg0.1 192.168.0.1/24
18set int ip address pg0.2 192.168.0.1/24
19set int ip address pg0.3 192.168.0.1/24
20
21set int state pg0 up
22set int state pg0.1 up
23set int state pg0.2 up
24set int state pg0.3 up
25
26ipsec sa add 2 spi 2 crypto-key 6541686776336961656264656f6f6579 crypto-alg aes-cbc-128 tunnel-src 192.168.0.1 tunnel-dst 192.168.0.2 tx-table-id 2
27ipsec sa add 3 spi 3 crypto-key 6541686776336961656264656f6f6579 crypto-alg aes-cbc-128 tunnel-src 192.168.0.1 tunnel-dst 192.168.0.2 tx-table-id 3
28
29ipsec spd add 1
30set interface ipsec spd pg0.1 1
31ipsec policy add spd 1 priority 100 outbound action bypass protocol 50
32ipsec policy add spd 1 priority 10 outbound action protect sa 2 local-ip-range 10.5.0.0 - 10.5.0.255 remote-ip-range 10.6.0.0 - 10.6.0.16
33ipsec policy add spd 1 priority 10 outbound action protect sa 3 local-ip-range 10.5.0.0 - 10.5.0.255 remote-ip-range 10.6.0.17 - 10.6.0.32
34
35ip route table 1 add 10.6.0.0/16 via 192.168.0.2 pg0.1
36set ip neighbor pg0.1 192.168.0.2 00:11:22:33:44:55
37set ip neighbor pg0.2 192.168.0.2 00:11:22:33:44:55
38set ip neighbor pg0.3 192.168.0.2 00:11:22:33:44:55
39
40trace add pg-input 100
41
42packet-generator new {
43 name ipsec2
44 limit 1
45 rate 1e4
46 node ethernet-input
47 interface pg0
48 size 100-100
49 data {
50 IP4: 1.2.3 -> 4.5.6 vlan 1
51 UDP: 10.5.0.1 -> 10.6.0.1
52 UDP: 4321 -> 1234
53 length 72
54 incrementing 100
55 }
56}
57
58packet-generator new {
59 name ipsec3
60 limit 1
61 rate 1e4
62 node ethernet-input
63 interface pg0
64 size 100-100
65 data {
66 IP4: 1.2.3 -> 4.5.6 vlan 1
67 UDP: 10.5.0.1 -> 10.6.0.22
68 UDP: 4321 -> 1234
69 length 72
70 incrementing 100
71 }
72}