Matus Fabian | a6110b6 | 2018-06-13 05:39:07 -0700 | [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 pg1 |
| 12 | data { |
| 13 | UDP: 172.16.1.11 -> 172.16.1.3 |
| 14 | UDP: 3001 -> 3000 |
| 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.10 -> 172.16.1.3 |
| 30 | UDP: 3001 -> 3000 |
| 31 | length 128 checksum 0 incrementing 1 |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | nat44 add address 172.16.1.3 |
| 36 | nat44 add load-balancing static mapping protocol udp external 172.16.1.3:3000 local 10.0.0.10:30000 probability 25 local 10.0.0.11:30000 probability 25 local 10.0.0.12:30000 probability 25 local 10.0.0.13:30000 probability 25 |
| 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.10 abcd.abcd.abcd |
| 42 | set ip arp static pg0 10.0.0.11 abcd.abcd.abce |
| 43 | set ip arp static pg0 10.0.0.12 abce.abcd.abcd |
| 44 | set ip arp static pg0 10.0.0.13 abce.abcd.abce |
| 45 | set ip arp static pg1 172.16.1.10 cdef.abcd.abcd |
| 46 | set ip arp static pg1 172.16.1.11 cdef.abcd.abce |
| 47 | set int nat44 in pg0 out pg1 |
| 48 | trace add pg-input 10 |