From c2a8c1a22f432265c73606106046c02e995eb630 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 22 Jun 2019 14:44:45 +0200 Subject: bfd: T1183: adjust CLI syntax for source address/interface Place address/interface under new source node. vyis@vyos# show protocols bfd peer 1.1.1.1 { source { address 1.2.3.4 interface eth0.201 } } --- src/conf_mode/protocols_bfd.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/conf_mode/protocols_bfd.py') diff --git a/src/conf_mode/protocols_bfd.py b/src/conf_mode/protocols_bfd.py index 92fae990e..6d2b8382a 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.multihop %} multihop{% endif %}{% 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.src_addr %} local-address {{ peer.src_addr }}{% endif %}{% if peer.src_if %} interface {{ peer.src_if }}{% endif %} {% if not peer.shutdown %}no {% endif %}shutdown {% endfor -%} ! @@ -64,8 +64,8 @@ def get_config(): bfd_peer = { 'remote': peer, 'shutdown': False, - 'local_interface': '', - 'local_address': '', + 'src_if': '', + 'src_addr': '', 'multihop': False } @@ -74,12 +74,12 @@ def get_config(): bfd_peer['shutdown'] = True # Check if peer has a local source interface configured - if conf.exists('local-interface'): - bfd_peer['local_interface'] = conf.return_value('local-interface') + if conf.exists('source interface'): + bfd_peer['src_if'] = conf.return_value('source interface') # Check if peer has a local source address configured - this is mandatory for IPv6 - if conf.exists('local-address'): - bfd_peer['local_address'] = conf.return_value('local-address') + if conf.exists('source address'): + bfd_peer['src_addr'] = conf.return_value('source 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 @@ -102,7 +102,7 @@ def verify(bfd): # IPv6 peers require an explicit local address/interface combination if vyos.validate.is_ipv6(peer['remote']): - if not (peer['local_interface'] and peer['local_address']): + if not (peer['src_if'] and peer['src_addr']): raise ConfigError("BFD IPv6 peers require explicit local address/interface setting") return None -- cgit v1.2.3