ip_session_redirect: add session redirect plugin
[vpp.git] / src / plugins / ip_session_redirect / punt_redirect.vpp
1 create packet-generator interface pg0
2 set int ip addr pg0 10.10.10.1/24
3
4 create packet-generator interface pg1
5 set int ip addr pg1 10.10.0.1/24
6 set ip neighbor pg1 10.10.0.10 4.5.6
7
8 set punt ipv4 udp all
9
10 classify table miss-next drop mask l3 ip4 src l4 udp src_port buckets 100000
11 set interface input acl intfc local0 ip4-punt-table 0
12 ip session redirect punt table 0 match l3 ip4 src 10.10.10.10 l4 src_port 1234 via 10.10.0.10 pg1
13
14 set int st pg0 up
15 set int st pg1 up
16
17 comment { punt because of no udp listener for 53667, redirected }
18 packet-generator new { \
19   name ok \
20   limit 1 \
21   node ethernet-input \
22   source pg0 \
23   size 100-100 \
24   data { \
25     IP4: 5.6.7 -> 2.3.4 \
26     UDP: 10.10.10.10 -> 10.10.10.1 \
27     UDP: 1234 -> 53667 \
28       incrementing 1 \
29   } \
30 }
31
32 comment { punt because of no udp listener for 53668, dropped }
33 packet-generator new { \
34   name nok \
35   limit 1 \
36   node ethernet-input \
37   source pg0 \
38   size 100-100 \
39   data { \
40     IP4: 5.6.7 -> 2.3.4 \
41     UDP: 10.10.10.10 -> 10.10.10.1 \
42     UDP: 1235 -> 53668 \
43       incrementing 1 \
44   } \
45 }
46
47 trace add pg-input 10
48 pa en