diff options
author | Christian Breunig <christian@breunig.cc> | 2025-02-24 20:54:25 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2025-02-24 20:54:25 +0100 |
commit | 216e80b61881a13c502f44c5d32fd7603b6ffe60 (patch) | |
tree | 08a92ec479f854e0e098fb4e54d1cb8b7a46ea22 /data/templates | |
parent | 5d9d232fd93ad5bf89ba44a2d0ec3b196599fa74 (diff) | |
download | vyos-1x-216e80b61881a13c502f44c5d32fd7603b6ffe60.tar.gz vyos-1x-216e80b61881a13c502f44c5d32fd7603b6ffe60.zip |
lldp: T7165: add support to enable only rx or tx on specific interface
LLDP is a stateless protocol which does not necessitate sending to receive
advertisements. There are multiple scenarios such as provider peering links in
which it is advantageous to receive LLDP but not disclose internal information
to the provider.
Add new CLI command:
* set service lldp interface <name> mode [disable|rx-tx|rx|tx]
The default is unchanged and will be rx-tx.
Furthermore if an interface has an explicit LLDP disable configured under
"set service lldp interface <name> disable" this will be migrated to
"set service lldp interface <name> mode disable"
Diffstat (limited to 'data/templates')
-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 %} |