summaryrefslogtreecommitdiff
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
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).
-rw-r--r--interface-definitions/protocols-bfd.xml6
-rwxr-xr-xsrc/conf_mode/protocols_bfd.py9
2 files changed, 14 insertions, 1 deletions
diff --git a/interface-definitions/protocols-bfd.xml b/interface-definitions/protocols-bfd.xml
index c8b25eb2d..91f0665f9 100644
--- a/interface-definitions/protocols-bfd.xml
+++ b/interface-definitions/protocols-bfd.xml
@@ -49,6 +49,12 @@
<valueless/>
</properties>
</leafNode>
+ <leafNode name="multihop">
+ <properties>
+ <help>Allow this BFD peer to not be directly connected</help>
+ <valueless/>
+ </properties>
+ </leafNode>
</children>
</tagNode>
</children>
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