summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_system_ip.py
diff options
context:
space:
mode:
authorYuxiang Zhu <vfreex@gmail.com>2022-07-09 17:38:29 +0800
committerGitHub <noreply@github.com>2022-07-09 11:38:29 +0200
commit07a4920b17c3741b50ffcb596d4433b54f7e529e (patch)
tree9b1a886424fe862b31bfd612cf3944b30bfc73ba /smoketest/scripts/cli/test_system_ip.py
parent0e761c303145d2440a9ecd730c530333ef7b777f (diff)
downloadvyos-1x-07a4920b17c3741b50ffcb596d4433b54f7e529e.tar.gz
vyos-1x-07a4920b17c3741b50ffcb596d4433b54f7e529e.zip
ip: T4517: add option to enable directed broadcast forwarding
Directed broadcast is described in rfc1812#section-5.3.5.2 and rfc2644. By default Linux kernel doesn't forward directed broadcast packets unless both of `/proc/sys/net/ipv4/conf/all/bc_forwarding` and `/proc/sys/net/ipv4/conf/$iface/bc_forwarding` are set to 1.
Diffstat (limited to 'smoketest/scripts/cli/test_system_ip.py')
-rwxr-xr-xsmoketest/scripts/cli/test_system_ip.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_system_ip.py b/smoketest/scripts/cli/test_system_ip.py
index 83df9d99e..00fce654c 100755
--- a/smoketest/scripts/cli/test_system_ip.py
+++ b/smoketest/scripts/cli/test_system_ip.py
@@ -28,7 +28,7 @@ class TestSystemIP(VyOSUnitTestSHIM.TestCase):
def test_system_ip_forwarding(self):
# Test if IPv4 forwarding can be disabled globally, default is '1'
- # which means forwearding enabled
+ # which means forwarding enabled
all_forwarding = '/proc/sys/net/ipv4/conf/all/forwarding'
self.assertEqual(read_file(all_forwarding), '1')
@@ -37,6 +37,17 @@ class TestSystemIP(VyOSUnitTestSHIM.TestCase):
self.assertEqual(read_file(all_forwarding), '0')
+ def test_system_ip_directed_broadcast_forwarding(self):
+ # Test if IPv4 directed broadcast forwarding can be disabled globally, default is '1'
+ # which means forwarding enabled
+ bc_forwarding = '/proc/sys/net/ipv4/conf/all/bc_forwarding'
+ self.assertEqual(read_file(bc_forwarding), '1')
+
+ self.cli_set(base_path + ['disable-directed-broadcast-forwarding'])
+ self.cli_commit()
+
+ self.assertEqual(read_file(bc_forwarding), '0')
+
def test_system_ip_multipath(self):
# Test IPv4 multipathing options, options default to off -> '0'
use_neigh = '/proc/sys/net/ipv4/fib_multipath_use_neigh'