summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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