summaryrefslogtreecommitdiffstats
path: root/src/plugins/adl/setup.pg
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-07-14 18:30:05 -0400
committerDamjan Marion <dmarion@me.com>2020-07-16 21:39:23 +0000
commitac0326fc5ae7ac4a8126bbc2f496a92fcfe4755e (patch)
tree3bb8d7fac43b165ccd6dd106b597fd733e5b28b8 /src/plugins/adl/setup.pg
parent9a0f2a5e7f678de58807fd49d47deec367656715 (diff)
adl: move allow/deny list function to plugin
Provide binary API compatibility support for the "cop" APIs until vpp 21.01. Change the deprecation date in map.api to vpp 21.01. Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I0e60d96de4ae9ae4448f134cf257934126f3b760
Diffstat (limited to 'src/plugins/adl/setup.pg')
-rw-r--r--src/plugins/adl/setup.pg62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/plugins/adl/setup.pg b/src/plugins/adl/setup.pg
new file mode 100644
index 00000000000..7f816bc0893
--- /dev/null
+++ b/src/plugins/adl/setup.pg
@@ -0,0 +1,62 @@
+set term pag off
+
+loop create
+set int ip address loop0 192.168.1.1/24
+set int ip6 table loop0 0
+set int ip address loop0 2001:db01::1/64
+set int state loop0 up
+
+packet-generator new {
+ name ip4
+ limit 100
+ rate 0
+ size 128-128
+ interface loop0
+ node adl-input
+ data { IP4: 1.2.40 -> 3cfd.fed0.b6c8
+ UDP: 192.168.1.2-192.168.1.10 -> 192.168.2.1
+ UDP: 1234 -> 2345
+ incrementing 114
+ }
+}
+
+packet-generator new {
+ name ip6-allow
+ limit 50
+ rate 0
+ size 128-128
+ interface loop0
+ node adl-input
+ data { IP6: 1.2.40 -> 3cfd.fed0.b6c8
+ UDP: 2001:db01::2 -> 2001:db01::1
+ UDP: 1234 -> 2345
+ incrementing 80
+ }
+}
+
+packet-generator new {
+ name ip6-drop
+ limit 50
+ rate 0
+ size 128-128
+ interface loop0
+ node adl-input
+ data { IP6: 1.2.40 -> 3cfd.fed0.b6c8
+ UDP: 2001:db01::3 -> 2001:db01::1
+ UDP: 1234 -> 2345
+ incrementing 80
+ }
+}
+
+ip table 1
+ip route add 192.168.2.1/32 via drop
+ip route add table 1 192.168.1.2/32 via local
+
+ip6 table 1
+ip route add 2001:db01::1/128 via drop
+ip route add table 1 2001:db01::2/128 via local
+
+comment { bin adl_interface_enable_disable loop0 }
+comment { bin adl_allowlist_enable_disable loop0 fib-id 1 ip4 ip6 }
+uncomment {bin cop_interface_enable_disable loop0 }
+uncomment {bin cop_whitelist_enable_disable loop0 fib-id 1 ip4 ip6 }