summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-06-04 14:31:44 +0200
committerGitHub <noreply@github.com>2021-06-04 14:31:44 +0200
commit5ae12f898eaeba4db0221db11ab51d0a4f1dc36f (patch)
treeee3eba1a3067506ce46b5403075abe974170cc93
parent4b646c1fb31a1a9f9c9d1658734d478fed5f19f1 (diff)
parentb4db37507635bf95161bea32b18736fc0732a9e6 (diff)
downloadvyos-1x-5ae12f898eaeba4db0221db11ab51d0a4f1dc36f.tar.gz
vyos-1x-5ae12f898eaeba4db0221db11ab51d0a4f1dc36f.zip
Merge pull request #861 from sever-sever/T3592
tunnels: T3592: Set default TTL to 64
-rw-r--r--interface-definitions/interfaces-tunnel.xml.in3
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_tunnel.py7
2 files changed, 7 insertions, 3 deletions
diff --git a/interface-definitions/interfaces-tunnel.xml.in b/interface-definitions/interfaces-tunnel.xml.in
index 4c3fc2e70..56f8ea79c 100644
--- a/interface-definitions/interfaces-tunnel.xml.in
+++ b/interface-definitions/interfaces-tunnel.xml.in
@@ -240,6 +240,9 @@
#include <include/interface/interface-parameters-key.xml.i>
#include <include/interface/interface-parameters-tos.xml.i>
#include <include/interface/interface-parameters-ttl.xml.i>
+ <leafNode name="ttl">
+ <defaultValue>64</defaultValue>
+ </leafNode>
</children>
</node>
<node name="ipv6">
diff --git a/smoketest/scripts/cli/test_interfaces_tunnel.py b/smoketest/scripts/cli/test_interfaces_tunnel.py
index ebb0158dc..841527d21 100755
--- a/smoketest/scripts/cli/test_interfaces_tunnel.py
+++ b/smoketest/scripts/cli/test_interfaces_tunnel.py
@@ -189,6 +189,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.TestCase):
self.cli_set(self._base_path + [interface, 'parameters', 'ip', 'no-pmtu-discovery'])
self.cli_set(self._base_path + [interface, 'parameters', 'ip', 'key', gre_key])
self.cli_set(self._base_path + [interface, 'parameters', 'ip', 'tos', tos])
+ self.cli_set(self._base_path + [interface, 'parameters', 'ip', 'ttl', '0'])
# Check if commit is ok
self.cli_commit()
@@ -221,7 +222,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.TestCase):
self.assertEqual(encapsulation, conf['linkinfo']['info_kind'])
self.assertEqual(self.local_v4, conf['linkinfo']['info_data']['local'])
self.assertEqual(remote_ip4, conf['linkinfo']['info_data']['remote'])
- self.assertEqual(0, conf['linkinfo']['info_data']['ttl'])
+ self.assertEqual(64, conf['linkinfo']['info_data']['ttl'])
# Change remote ip address (inc host by 2
new_remote = inc_ip(remote_ip4, 2)
@@ -258,7 +259,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.TestCase):
self.assertEqual(encapsulation, conf['linkinfo']['info_kind'])
self.assertEqual(self.local_v4, conf['linkinfo']['info_data']['local'])
self.assertEqual(remote_ip4, conf['linkinfo']['info_data']['remote'])
- self.assertEqual(0, conf['linkinfo']['info_data']['ttl'])
+ self.assertEqual(64, conf['linkinfo']['info_data']['ttl'])
self.assertEqual(f'0.0.0.{ip_key}', conf['linkinfo']['info_data']['ikey'])
self.assertEqual(f'0.0.0.{ip_key}', conf['linkinfo']['info_data']['okey'])
self.assertEqual(int(idx), conf['linkinfo']['info_data']['erspan_index'])
@@ -314,7 +315,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.TestCase):
self.assertEqual(encapsulation, conf['linkinfo']['info_kind'])
self.assertEqual(self.local_v6, conf['linkinfo']['info_data']['local'])
self.assertEqual(remote_ip6, conf['linkinfo']['info_data']['remote'])
- self.assertEqual(0, conf['linkinfo']['info_data']['ttl'])
+ self.assertEqual(64, conf['linkinfo']['info_data']['ttl'])
self.assertEqual(f'0.0.0.{ip_key}', conf['linkinfo']['info_data']['ikey'])
self.assertEqual(f'0.0.0.{ip_key}', conf['linkinfo']['info_data']['okey'])
self.assertEqual(erspan_ver, conf['linkinfo']['info_data']['erspan_ver'])