summaryrefslogtreecommitdiff
path: root/src/conf_mode/protocols_bfd.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-06-21 21:07:45 +0200
committerChristian Poessinger <christian@poessinger.com>2019-06-22 14:53:34 +0200
commit1b1f6b20226c92e4beba171159ead8fb21713484 (patch)
tree84cc2b7afce207422df42c577d9c509664b500bf /src/conf_mode/protocols_bfd.py
parent62ca0f55506245865dcc14fd95d68d9a3482df7b (diff)
downloadvyos-1x-1b1f6b20226c92e4beba171159ead8fb21713484.tar.gz
vyos-1x-1b1f6b20226c92e4beba171159ead8fb21713484.zip
bfd: T1183: add support for multihop
multihop tells the BFD daemon that we should expect packets with TTL less than 254 (because it will take more than one hop) and to listen on the multihop port (4784). When using multi-hop mode echo-mode will not work (see RFC 5883 section 3).
Diffstat (limited to 'src/conf_mode/protocols_bfd.py')
-rwxr-xr-xsrc/conf_mode/protocols_bfd.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/conf_mode/protocols_bfd.py b/src/conf_mode/protocols_bfd.py
index 08d3991ff..92fae990e 100755
--- a/src/conf_mode/protocols_bfd.py
+++ b/src/conf_mode/protocols_bfd.py
@@ -35,7 +35,7 @@ bfd
{% endfor -%}
!
{% for peer in new_peers -%}
- peer {{ peer.remote }}{% if peer.local_address %} local-address {{ peer.local_address }}{% endif %}{% if peer.local_interface %} interface {{ peer.local_interface }}{% endif %}
+ peer {{ peer.remote }}{% if peer.multihop %} multihop{% endif %}{% if peer.local_address %} local-address {{ peer.local_address }}{% endif %}{% if peer.local_interface %} interface {{ peer.local_interface }}{% endif %}
{% if not peer.shutdown %}no {% endif %}shutdown
{% endfor -%}
!
@@ -66,6 +66,7 @@ def get_config():
'shutdown': False,
'local_interface': '',
'local_address': '',
+ 'multihop': False
}
# Check if individual peer is disabled
@@ -80,6 +81,12 @@ def get_config():
if conf.exists('local-address'):
bfd_peer['local_address'] = conf.return_value('local-address')
+ # Tell BFD daemon that we should expect packets with TTL less than 254
+ # (because it will take more than one hop) and to listen on the multihop
+ # port (4784)
+ if conf.exists('multihop'):
+ bfd_peer['multihop'] = True
+
bfd['new_peers'].append(bfd_peer)
return bfd