summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-12-22 21:36:37 +0100
committerChristian Poessinger <christian@poessinger.com>2019-12-22 21:36:37 +0100
commite4b56e2988d3c5599702e858bd2b9ea8ed0ec9a1 (patch)
tree62b993f0df691dbd52a5aa1737da8d6d7bb24e94
parent2f0119a2aa6cf6375657e7ab4b16f5b750b45f68 (diff)
downloadvyos-1x-e4b56e2988d3c5599702e858bd2b9ea8ed0ec9a1.tar.gz
vyos-1x-e4b56e2988d3c5599702e858bd2b9ea8ed0ec9a1.zip
lldp: T393: support IPv6 management address
-rw-r--r--interface-definitions/lldp.xml.in10
-rwxr-xr-xsrc/conf_mode/lldp.py17
2 files changed, 15 insertions, 12 deletions
diff --git a/interface-definitions/lldp.xml.in b/interface-definitions/lldp.xml.in
index 8aaaaf102..b44f4baf6 100644
--- a/interface-definitions/lldp.xml.in
+++ b/interface-definitions/lldp.xml.in
@@ -283,13 +283,17 @@
</node>
<leafNode name="management-address">
<properties>
- <help>IPv4 management address</help>
+ <help>Management IP Address</help>
<valueHelp>
<format>ipv4</format>
- <description>IP address to listen for incoming connections</description>
+ <description>IPv4 Management Address</description>
+ </valueHelp>
+ <valueHelp>
+ <format>ipv6</format>
+ <description>IPv6 Management Address</description>
</valueHelp>
<constraint>
- <validator name="ipv4-address"/>
+ <validator name="ip-address"/>
</constraint>
</properties>
</leafNode>
diff --git a/src/conf_mode/lldp.py b/src/conf_mode/lldp.py
index be7880c55..9fd32d83f 100755
--- a/src/conf_mode/lldp.py
+++ b/src/conf_mode/lldp.py
@@ -27,7 +27,7 @@ from vyos import ConfigError
config_file = "/etc/default/lldpd"
lldp_tmpl = """
### Autogenerated by lldp.py ###
-DAEMON_ARGS="-M 4{% if options.snmp %} -x{% endif %}{% if options.addr %} -m {{ options.addr }}{% endif %}{% if options.cdp %} -c{% endif %}{% if options.edp %} -e{% endif %}{% if options.fdp %} -f{% endif %}{% if options.sonmp %} -s{% endif %}"
+DAEMON_ARGS="-M 4{% if options.snmp %} -x{% endif %}{% if options.cdp %} -c{% endif %}{% if options.edp %} -e{% endif %}{% if options.fdp %} -f{% endif %}{% if options.sonmp %} -s{% endif %}"
"""
@@ -37,17 +37,17 @@ vyos_tmpl = """
configure system platform VyOS
configure system description "VyOS {{ options.description }}"
-{% if listen_on %}
+{%- if listen_on -%}
configure system interface pattern "{{ options.listen_on | join(",") }}"
-{% endif %}
-
-{% for loc in location %}
-{%- if loc.elin %}
+{%- endif %}
+{% if options.addr -%}
+configure system ip management pattern "{{ options.addr }}"
+{%- endif %}
+{%- for loc in location -%}
+{%- if loc.elin -%}
configure ports {{ loc.name }} med location elin "{{ loc.elin }}"
{%- endif %}
{% endfor %}
-
-
"""
default_config_data = {
@@ -289,7 +289,6 @@ def apply(lldp):
os.system('sudo systemctl stop lldpd.service')
os.unlink(config_file)
-
if __name__ == '__main__':
try:
c = get_config()