aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rw-r--r--resources/libraries/python/InterfaceUtil.py13
-rw-r--r--resources/templates/vat/ip_source_check.vat1
2 files changed, 14 insertions, 0 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 2eea8e6f1b..008d42435c 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -780,3 +780,16 @@ class InterfaceUtil(object):
vat.vat_terminal_exec_cmd_from_template(
"proxy_arp_intfc_enable.vat",
sw_if_index=sw_if_index)
+
+ @staticmethod
+ def vpp_ip_source_check_setup(node, interface):
+ """Setup Reverse Path Forwarding source check on interface.
+
+ :param node: Node to setup RPF source check.
+ :param interface: Interface name to setup RPF source check.
+ :type node: dict
+ :type interface: str
+ """
+ with VatTerminal(node) as vat:
+ vat.vat_terminal_exec_cmd_from_template("ip_source_check.vat",
+ interface_name=interface)
diff --git a/resources/templates/vat/ip_source_check.vat b/resources/templates/vat/ip_source_check.vat
new file mode 100644
index 0000000000..12da19ba25
--- /dev/null
+++ b/resources/templates/vat/ip_source_check.vat
@@ -0,0 +1 @@
+exec set interface ip source-check {interface_name} \ No newline at end of file