Neale Ranns | fd06084 | 2019-03-04 13:44:42 +0000 | [diff] [blame] | 1 | |
| 2 | create packet-generator interface pg0 |
| 3 | create packet-generator interface pg1 |
| 4 | |
| 5 | pipe create |
| 6 | |
| 7 | ip table add 1 |
| 8 | set int ip table pg1 1 |
| 9 | set int ip table pipe0.1 1 |
| 10 | |
| 11 | set int ip address pg0 192.168.0.1/24 |
| 12 | set int ip address pg1 192.168.1.1/24 |
| 13 | |
| 14 | set int ip address pipe0.0 10.0.0.1/24 |
| 15 | set int ip address pipe0.1 10.0.0.2/24 |
| 16 | |
| 17 | set int state pg0 up |
| 18 | set int state pg1 up |
| 19 | set int state pipe0 up |
| 20 | |
Ray Kinsella | 6db19a9 | 2022-03-01 09:00:17 +0000 | [diff] [blame] | 21 | ipsec sa add 20 spi 200 crypto-key 6541686776336961656264656f6f6579 crypto-alg aes-cbc-128 |
| 22 | ipsec sa add 30 spi 300 crypto-key 6541686776336961656264656f6f6579 crypto-alg aes-cbc-128 |
Neale Ranns | fd06084 | 2019-03-04 13:44:42 +0000 | [diff] [blame] | 23 | |
Ray Kinsella | 6db19a9 | 2022-03-01 09:00:17 +0000 | [diff] [blame] | 24 | create ipip tunnel src 10.0.0.1 dst 10.0.0.2 |
| 25 | create ipip tunnel src 10.0.0.2 dst 10.0.0.1 outer-table-id 1 |
Neale Ranns | fd06084 | 2019-03-04 13:44:42 +0000 | [diff] [blame] | 26 | |
Ray Kinsella | 6db19a9 | 2022-03-01 09:00:17 +0000 | [diff] [blame] | 27 | ipsec tunnel protect ipip0 sa-in 20 sa-out 30 |
| 28 | ipsec tunnel protect ipip1 sa-in 30 sa-out 20 |
Neale Ranns | fd06084 | 2019-03-04 13:44:42 +0000 | [diff] [blame] | 29 | |
Ray Kinsella | 6db19a9 | 2022-03-01 09:00:17 +0000 | [diff] [blame] | 30 | set int state ipip0 up |
| 31 | set int unnum ipip0 use pg0 |
Neale Ranns | fd06084 | 2019-03-04 13:44:42 +0000 | [diff] [blame] | 32 | |
Ray Kinsella | 6db19a9 | 2022-03-01 09:00:17 +0000 | [diff] [blame] | 33 | set int state ipip1 up |
| 34 | set int ip table ipip1 1 |
| 35 | set int unnum ipip1 use pg1 |
| 36 | |
| 37 | ip route add 192.168.1.0/24 via ipip0 |
ShivaShankarK | b0f956c | 2020-03-18 15:34:11 +0530 | [diff] [blame] | 38 | set ip neighbor pg1 192.168.1.2 00:11:22:33:44:55 |
Ray Kinsella | 6db19a9 | 2022-03-01 09:00:17 +0000 | [diff] [blame] | 39 | ip route add table 1 192.168.0.0/24 via ipip1 |
ShivaShankarK | b0f956c | 2020-03-18 15:34:11 +0530 | [diff] [blame] | 40 | set ip neighbor pg0 192.168.0.2 00:11:22:33:44:66 |
Neale Ranns | fd06084 | 2019-03-04 13:44:42 +0000 | [diff] [blame] | 41 | |
| 42 | trace add pg-input 100 |
| 43 | |
Damjan Marion | 3153f00 | 2022-05-14 00:14:02 +0200 | [diff] [blame] | 44 | packet-generator new { \ |
| 45 | name ipsec1 \ |
| 46 | limit 1 \ |
| 47 | rate 1e4 \ |
| 48 | node ip4-input \ |
| 49 | interface pg0 \ |
| 50 | size 100-100 \ |
| 51 | data { \ |
| 52 | UDP: 192.168.0.2 -> 192.168.1.2 \ |
| 53 | UDP: 4321 -> 1234 \ |
| 54 | length 72 \ |
| 55 | incrementing 100 \ |
| 56 | } \ |
Neale Ranns | fd06084 | 2019-03-04 13:44:42 +0000 | [diff] [blame] | 57 | } |
Damjan Marion | 3153f00 | 2022-05-14 00:14:02 +0200 | [diff] [blame] | 58 | packet-generator new { \ |
| 59 | name ipsec2 \ |
| 60 | limit 1 \ |
| 61 | rate 1e4 \ |
| 62 | node ip4-input \ |
| 63 | interface pg1 \ |
| 64 | size 100-100 \ |
| 65 | data { \ |
| 66 | UDP: 192.168.1.2 -> 192.168.0.2 \ |
| 67 | UDP: 4321 -> 1234 \ |
| 68 | length 72 \ |
| 69 | incrementing 100 \ |
| 70 | } \ |
Neale Ranns | fd06084 | 2019-03-04 13:44:42 +0000 | [diff] [blame] | 71 | } |