Matus Fabian | 7801ca2 | 2017-08-03 00:58:05 -0700 | [diff] [blame] | 1 | create packet-generator interface pg0 |
| 2 | create packet-generator interface pg1 |
| 3 | |
Matus Fabian | 475f055 | 2016-10-19 06:17:52 -0700 | [diff] [blame] | 4 | packet-generator new { |
| 5 | name f1 |
| 6 | limit 1000000 |
| 7 | node ip4-input |
| 8 | size 64-64 |
| 9 | no-recycle |
Matus Fabian | 7801ca2 | 2017-08-03 00:58:05 -0700 | [diff] [blame] | 10 | interface pg0 |
Matus Fabian | 475f055 | 2016-10-19 06:17:52 -0700 | [diff] [blame] | 11 | data { |
| 12 | UDP: 10.0.0.3 -> 172.16.1.2 |
| 13 | UDP: 3000 -> 3001 |
| 14 | length 128 checksum 0 incrementing 1 |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | |
| 19 | packet-generator new { |
| 20 | name f2 |
| 21 | limit 1000000 |
| 22 | node ip4-input |
| 23 | size 64-64 |
| 24 | no-recycle |
Matus Fabian | 7801ca2 | 2017-08-03 00:58:05 -0700 | [diff] [blame] | 25 | interface pg0 |
Matus Fabian | 475f055 | 2016-10-19 06:17:52 -0700 | [diff] [blame] | 26 | data { |
| 27 | UDP: 10.0.0.3 -> 172.16.1.2 |
| 28 | UDP: 3005 -> 3006 |
| 29 | length 128 checksum 0 incrementing 1 |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | snat add address 172.16.1.3 |
Matus Fabian | 475f055 | 2016-10-19 06:17:52 -0700 | [diff] [blame] | 34 | set int ip address pg0 10.0.0.1/24 |
Matus Fabian | 7801ca2 | 2017-08-03 00:58:05 -0700 | [diff] [blame] | 35 | set int ip address pg1 172.16.1.1/24 |
| 36 | set int state pg0 up |
| 37 | set int state pg1 up |
| 38 | set ip arp static pg0 10.0.0.3 abcd.abcd.abcd |
| 39 | set ip arp static pg0 10.0.0.4 abcd.abcd.abcd |
| 40 | set ip arp static pg1 172.16.1.2 cdef.abcd.abcd |
| 41 | set int snat in pg0 out pg1 |