diff --git a/dockers/docker-lldp/lldpd.conf.j2 b/dockers/docker-lldp/lldpd.conf.j2 index 82c3dfa564..a7e5b68fe3 100644 --- a/dockers/docker-lldp/lldpd.conf.j2 +++ b/dockers/docker-lldp/lldpd.conf.j2 @@ -19,24 +19,7 @@ configure ports eth0 lldp portidsubtype local {{ mgmt_if.port_name }} configure system ip management pattern {{ mgmt_if.ipv4 }} {% endif %} configure system hostname {{ DEVICE_METADATA['localhost']['hostname'] }} -{# Configure port ID subtype for front-panel ports at startup. - Without this, lldpd uses MAC address as default Port ID. When lldpd - auto-resumes after config processing, the first LLDP frame would carry - MAC-based Port IDs. Peers see a transient MSAP change when lldpmgrd - later reconfigures portidsubtype, causing unnecessary neighbor flaps. - Special ports (inband/recirculation/backplane) are excluded to match - lldpmgrd behavior which skips these port types. #} -{% if PORT %} -{% for port_name in PORT|sort %} -{% if not port_name.startswith('Ethernet-IB') and not port_name.startswith('Ethernet-Rec') and not port_name.startswith('Ethernet-BP') %} -{% set port_alias = PORT[port_name].alias|default('') %} -{% if port_alias %} -configure ports {{ port_name }} lldp portidsubtype local {{ port_alias }} -{% else %} -configure ports {{ port_name }} lldp portidsubtype local {{ port_name }} -{% endif %} -{% endif %} -{% endfor %} -{% endif %} +{# Use ifname globally to avoid MAC-as-Port-ID; lldpmgrd sets alias per port later. #} +configure lldp portidsubtype ifname {# pause lldpd operations until all interfaces are well configured, resume command will run in lldpmgrd #} pause diff --git a/src/sonic-config-engine/tests/sample_output/py3/lldp_conf/lldpd-ipv4-iface.conf b/src/sonic-config-engine/tests/sample_output/py3/lldp_conf/lldpd-ipv4-iface.conf index c9cb2c8123..684791a0f2 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/lldp_conf/lldpd-ipv4-iface.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/lldp_conf/lldpd-ipv4-iface.conf @@ -1,4 +1,5 @@ configure ports eth0 lldp portidsubtype local eth0 configure system ip management pattern 10.0.0.100 configure system hostname switch-t0 +configure lldp portidsubtype ifname pause diff --git a/src/sonic-config-engine/tests/sample_output/py3/lldp_conf/lldpd-ipv6-iface.conf b/src/sonic-config-engine/tests/sample_output/py3/lldp_conf/lldpd-ipv6-iface.conf index f5727556fd..3f7ec2ee5e 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/lldp_conf/lldpd-ipv6-iface.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/lldp_conf/lldpd-ipv6-iface.conf @@ -1,2 +1,3 @@ configure system hostname switch-t0 +configure lldp portidsubtype ifname pause