Matus Fabian | 4933168 | 2016-12-01 01:32:03 -0800 | [diff] [blame^] | 1 | create packet-generator interface pg0 |
| 2 | create packet-generator interface pg1 |
| 3 | |
| 4 | packet-generator new { |
| 5 | name f1 |
| 6 | limit 1000000 |
| 7 | node ip4-input |
| 8 | size 64-64 |
| 9 | no-recycle |
| 10 | worker 0 |
| 11 | interface pg0 |
| 12 | data { |
| 13 | UDP: 10.0.0.3 -> 172.16.1.2 |
| 14 | UDP: 3000 -> 3001 |
| 15 | length 128 checksum 0 incrementing 1 |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | |
| 20 | packet-generator new { |
| 21 | name f2 |
| 22 | limit 1000000 |
| 23 | node ip4-input |
| 24 | size 64-64 |
| 25 | no-recycle |
| 26 | worker 1 |
| 27 | interface pg1 |
| 28 | data { |
| 29 | UDP: 172.16.1.2 -> 172.16.1.3 |
| 30 | UDP: 3001 -> 3000 |
| 31 | length 128 checksum 0 incrementing 1 |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | snat add address 172.16.1.3 |
| 36 | snat add static mapping local 10.0.0.3 external 172.16.1.3 |
| 37 | set int ip address pg0 10.0.0.1/24 |
| 38 | set int ip address pg1 172.16.1.1/24 |
| 39 | set int state pg0 up |
| 40 | set int state pg1 up |
| 41 | set ip arp static pg0 10.0.0.3 abcd.abcd.abcd |
| 42 | set ip arp static pg1 172.16.1.2 cdef.abcd.abcd |
| 43 | set int snat in pg0 out pg1 |
| 44 | trace add pg-input 10 |