diff options
author | Daniil Baturin <daniil@vyos.io> | 2025-02-25 16:05:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-25 16:05:00 +0000 |
commit | 9468dbfadece59cd4dd481594c9c098d974dad1a (patch) | |
tree | b0994a4c5b955b0b8ed528d7d7657633c77a35b7 /data | |
parent | e9d9c096c0e046939ff53d68baa230064ea93242 (diff) | |
parent | 216e80b61881a13c502f44c5d32fd7603b6ffe60 (diff) | |
download | vyos-1x-9468dbfadece59cd4dd481594c9c098d974dad1a.tar.gz vyos-1x-9468dbfadece59cd4dd481594c9c098d974dad1a.zip |
Merge pull request #4365 from c-po/lldp-t7165
lldp: T7165: add support to enable only rx/tx on specific interfaces
Diffstat (limited to 'data')
-rw-r--r-- | data/templates/lldp/vyos.conf.j2 | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/data/templates/lldp/vyos.conf.j2 b/data/templates/lldp/vyos.conf.j2 index 4b4228cea..432a7a8e6 100644 --- a/data/templates/lldp/vyos.conf.j2 +++ b/data/templates/lldp/vyos.conf.j2 @@ -4,7 +4,7 @@ configure system platform VyOS configure system description "VyOS {{ version }}" {% if interface is vyos_defined %} {% set tmp = [] %} -{% for iface, iface_options in interface.items() if iface_options.disable is not vyos_defined %} +{% for iface, iface_options in interface.items() %} {% if iface == 'all' %} {% set iface = '*' %} {% endif %} @@ -17,6 +17,15 @@ configure ports {{ iface }} med location elin "{{ iface_options.location.elin }} configure ports {{ iface }} med location coordinate latitude "{{ iface_options.location.coordinate_based.latitude }}" longitude "{{ iface_options.location.coordinate_based.longitude }}" altitude "{{ iface_options.location.coordinate_based.altitude }}m" datum "{{ iface_options.location.coordinate_based.datum }}" {% endif %} {% endif %} +{% set mode = iface_options.mode %} +{% if mode == 'tx' %} +{% set mode = 'tx-only' %} +{% elif mode == 'rx' %} +{% set mode = 'rx-only' %} +{% elif mode == 'rx-tx' %} +{% set mode = 'rx-and-tx' %} +{% endif %} +configure ports {{ iface }} lldp status {{ mode }} {% endfor %} configure system interface pattern "{{ tmp | join(",") }}" {% endif %} |