Skip to content

Commit

Permalink
tunnels: T3592: Set default TTL to 64
Browse files Browse the repository at this point in the history
Set default TTL value for tunnels from 0 to 64
There are a lot of situation when default value 0 (inherit)
not work properly when you have routing configuration for OSPF
or BGP over the tunnels. To fix it you need explicit set TTL
value other then 0. Or hardcode another value as default.
  • Loading branch information
sever-sever committed Jun 2, 2021
1 parent ec958eb commit b4db375
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions interface-definitions/interfaces-tunnel.xml.in
Expand Up @@ -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">
Expand Down
7 changes: 4 additions & 3 deletions smoketest/scripts/cli/test_interfaces_tunnel.py
Expand Up @@ -189,6 +189,7 @@ def test_tunnel_parameters_gre(self):
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()
Expand Down Expand Up @@ -221,7 +222,7 @@ def test_gretap_parameters_change(self):
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)
Expand Down Expand Up @@ -258,7 +259,7 @@ def test_erspan_v1(self):
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'])
Expand Down Expand Up @@ -314,7 +315,7 @@ def test_ip6erspan_v2(self):
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'])
Expand Down

0 comments on commit b4db375

Please sign in to comment.