LLDP
此内容尚不支持你的语言。
Link Layer Discovery Protocol.
| URL | GET | POST | PATCH | PUT | DELETE |
|---|---|---|---|---|---|
| /rest/v1/running/lldp-global | Y | N | Y | N | N |
| /rest/v1/running/lldp-ports/{ifname} | Y | Y | Y | N | Y |
| /rest/v1/rpc/show-lldp-local-interface | N | Y | N | N | N |
| /rest/v1/rpc/show-lldp-local-summary | N | Y | N | N | N |
| /rest/v1/rpc/show-lldp-neighbor-interface | N | Y | N | N | N |
| /rest/v1/rpc/show-lldp-neighbor-summary | N | Y | N | N | N |
Examples
Section titled “Examples”Show lldp local interface
Section titled “Show lldp local interface”POST HTTPS://{switch IP}/rest/v1/rpc/show-lldp-local-interface{ "port": "Ethernet1"}response:
{ "lldp-local-interface": [ { "local-port": "Ethernet1", "via": "unknown", "age": "20565 days, 07:38:58", "device": "Leaf-174", "device-id": "00:01:02:03:04:05", "device-descr": "SONiC Software Version: SONiC.V3.1R0500P01T10 - HwSku: CX308P-48Y-N - Distribution: Debian 11.11 - Kernel: 5.10.0-8-2-amd64", "device-mgmt-ip": "10.250.0.174", "device-mgmt-iface": "2", "port-id": "Ethernet1", "port-id-type": "local", "port-descr": "Y1", "port-ttl": "120", "capability": [ { "type": "Bridge", "enabled": true }, { "type": "Router", "enabled": true }, { "type": "Wlan", "enabled": false }, { "type": "Station", "enabled": false } ] } ]}Show lldp local summary
Section titled “Show lldp local summary”POST HTTPS://{switch IP}/rest/v1/rpc/show-lldp-local-summaryresponse:
{ "lldp-local-summary": { "tx-delay": "30", "tx-delay-ms": "30000", "tx-hold": "4", "max-neighbors": "32", "rx-only": "no", "mgmt-pattern": "10.250.0.174", "iface-pattern": "Ethernet*,eth0", "perm-iface-pattern": "(none)", "cid-pattern": "eth0", "cid-string": "00:01:02:03:04:05", "description": "SONiC Software Version: SONiC.V3.1R0500P01T10 - HwSku: CX308P-48Y-N - Distribution: Debian 11.11 - Kernel: 5.10.0-8-2-amd64", "platform": "Linux", "hostname": "Leaf-174", "advertise-version": "yes", "ifdescr-update": "no", "iface-promisc": "no", "lldpmed-no-inventory": "yes", "lldpmed-faststart": "yes", "lldpmed-faststart-interval": "1", "bond-slave-src-mac-type": "local", "lldp-portid-type": "ifname", "lldp-agent-type": "unknown" }}Show lldp neighbor interface
Section titled “Show lldp neighbor interface”POST HTTPS://{switch IP}/rest/v1/rpc/show-lldp-neighbor-interface{ "port": "Ethernet13"}response:
{ "lldp-neighbor-interface": [ { "local-port": "Ethernet13", "via": "LLDP", "rid": "1121", "age": "1 day, 01:06:10", "remote-device": "sonic-172", "remote-device-id": "60:EB:5A:01:10:83", "remote-device-descr": "SONiC Software Version: SONiC.V3.1R0409P00 - HwSku: CX308P-48Y-N - Distribution: Debian 12.13 - Kernel: 6.1.0-29-2-amd64", "remote-device-mgmt-ip": "10.250.0.172", "remote-device-mgmt-iface": "", "remote-port-id": "Ethernet12", "remote-port-id-type": "ifname", "remote-port-descr": "Y13", "remote-port-ttl": "120", "capability": [ { "type": "Bridge", "enabled": true }, { "type": "Router", "enabled": true }, { "type": "Wlan", "enabled": false }, { "type": "Station", "enabled": false } ], "vlan-list": [ { "vlan-id": "", "value": "", "pvid": false } ] } ]}Show lldp neighbor summary
Section titled “Show lldp neighbor summary”POST HTTPS://{switch IP}/rest/v1/rpc/show-lldp-neighbor-summaryresponse:
{ "lldp-neighbor-summary": [ { "local-port": "Ethernet1", "remote-device": "sonic-172", "remote-port-id": "Ethernet12", "capability": "BR", "remote-port-descr": "Y13" }, { "local-port": "Ethernet25", "remote-device": "sonic", "remote-port-id": "Ethernet14", "capability": "BR", "remote-port-descr": "Y14" }, { "local-port": "Ethernet26", "remote-device": "sonic", "remote-port-id": "Ethernet15", "capability": "BR", "remote-port-descr": "Y15" } ]}Modify lldp global
Section titled “Modify lldp global”PATCH HTTPS://{switch IP}/rest/v1/running/lldp-global{ "include-vlan": "false", "global-portid-subtype": "local", "message-tx-interval": 7, "message-tx-hold-multiplier": 8, "management-address-advertisement": "false", "capabilities-advertisement": "false", "admin-status": "false"}Create a lldp port
Section titled “Create a lldp port”POST HTTPS://{switch IP}/rest/v1/running/lldp-ports/Ethernet1{"status": "rx-only"}Modify a lldp port
Section titled “Modify a lldp port”PATCH HTTPS://{switch IP}/rest/v1/running/lldp-ports/Ethernet1{"status": "rx-and-tx"}Properties Descriptions
Section titled “Properties Descriptions”LLDP ports
Section titled “LLDP ports”Tree Diagrams
+--rw lldp-ports | +--rw lldp-port* [ifname] | +--rw ifname | +--ro local-portid? | +--rw status? | +--ro portid-subtype?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| lldp-ports | M | Path-only node, has no configurable value. | |
| LLDP parameters. | |||
| ifname | M | Ethernet name | |
| ”Mgmt0” | (sub-property of lldp-ports) | ||
| Port name of current port. | |||
| local-portid | RO | string | (sub-property of lldp-ports) |
| Alias of current port. | |||
| status | O | ”tx-only" | |
| "rx-only" | |||
| "rx-and-tx" | |||
| "disabled” | (sub-property of lldp-ports) | ||
| Administrative status of the local LLDP agent. | |||
| Default value: “rx-and-tx” | |||
| portid-subtype | RO | ”ifname" | |
| "macaddress" | |||
| "local” | (sub-property of lldp-ports) | ||
| Type of portid. |
LLDP global
Section titled “LLDP global”Tree Diagrams
+--rw lldp-global +--rw include-vlan? +--rw global-portid-subtype? +--rw message-tx-interval? +--rw message-tx-hold-multiplier? +--rw management-address-advertisement? +--rw capabilities-advertisement? +--rw admin-status?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| lldp-global | M | Path-only node, has no configurable value. | |
| include-vlan | O | ”true" | |
| "false” | (sub-property of lldp-global) | ||
| Carry the VLAN ID of the interface in the message. | |||
| Default value: “true” | |||
| global-portid-subtype | O | ”local" | |
| "ifname" | |||
| "macaddress” | (sub-property of lldp-global) | ||
| Type of portid. | |||
| Default value: “local” | |||
| message-tx-interval | O | 5..32768 | (sub-property of lldp-global) |
| Time interval in timer ticks between transmissions during normal transmission periods (i.e., txFast is zero). | |||
| Default value: 30 | |||
| message-tx-hold-multiplier | O | 2..10 | (sub-property of lldp-global) |
| Multiplier of msg-tx-interval. | |||
| Default value: 4 | |||
| management-address-advertisement | O | ”true" | |
| "false” | (sub-property of lldp-global) | ||
| LLDP management address advertisement. | |||
| Default value: “true” | |||
| capabilities-advertisement | O | ”true" | |
| "false” | (sub-property of lldp-global) | ||
| lldp capabilities advertisement. | |||
| Default value: “true” | |||
| admin-status | O | ”true" | |
| "false” | (sub-property of lldp-global) | ||
| Administrative status of all port. | |||
| Default value: “true” |
Show lldp local summary
Section titled “Show lldp local summary”Tree Diagrams
+---x show-lldp-local-summary | +--ro output | +--ro lldp-local-summary | +--ro tx-delay? | +--ro tx-delay-ms? | +--ro tx-hold? | +--ro max-neighbors? | +--ro rx-only? | +--ro mgmt-pattern? | +--ro iface-pattern? | +--ro perm-iface-pattern? | +--ro cid-pattern? | +--ro cid-string? | +--ro description? | +--ro platform? | +--ro hostname? | +--ro advertise-version? | +--ro ifdescr-update? | +--ro iface-promisc? | +--ro lldpmed-no-inventory? | +--ro lldpmed-faststart? | +--ro lldpmed-faststart-interval? | +--ro bond-slave-src-mac-type? | +--ro lldp-portid-type? | +--ro lldp-agent-type?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-lldp-local-summary | M | Path-only node, has no configurable value. | |
| Show LLDP summary configuration. | |||
| lldp-local-summary | RO | (sub-property of output) | |
| Path-only node, has no configurable value. | |||
| LLDP local summary configuration information. | |||
| tx-delay | RO | string | (sub-property of lldp-local-summary) |
| Transmit delay in seconds. | |||
| tx-delay-ms | RO | string | (sub-property of lldp-local-summary) |
| Transmit delay in milliseconds. | |||
| tx-hold | RO | string | (sub-property of lldp-local-summary) |
| Transmit hold multiplier. | |||
| max-neighbors | RO | string | (sub-property of lldp-local-summary) |
| Maximum number of neighbors to store. | |||
| rx-only | RO | string | (sub-property of lldp-local-summary) |
| Whether receive-only mode is enabled. | |||
| mgmt-pattern | RO | string | (sub-property of lldp-local-summary) |
| Pattern for management addresses. | |||
| iface-pattern | RO | string | (sub-property of lldp-local-summary) |
| Interface pattern for LLDP enabled ports. | |||
| perm-iface-pattern | RO | string | (sub-property of lldp-local-summary) |
| Permanent interface pattern. | |||
| cid-pattern | RO | string | (sub-property of lldp-local-summary) |
| Interface pattern for chassis ID. | |||
| cid-string | RO | string | (sub-property of lldp-local-summary) |
| Override chassis ID value. | |||
| description | RO | string | (sub-property of lldp-local-summary) |
| Override system description. | |||
| platform | RO | string | (sub-property of lldp-local-summary) |
| Override platform information. | |||
| hostname | RO | string | (sub-property of lldp-local-summary) |
| Override system name (hostname). | |||
| advertise-version | RO | string | (sub-property of lldp-local-summary) |
| Whether to advertise software version. | |||
| ifdescr-update | RO | string | (sub-property of lldp-local-summary) |
| Whether to update interface descriptions. | |||
| iface-promisc | RO | string | (sub-property of lldp-local-summary) |
| Whether promiscuous mode is enabled on managed interfaces. | |||
| lldpmed-no-inventory | RO | string | (sub-property of lldp-local-summary) |
| Whether LLDP-MED inventory is disabled. | |||
| lldpmed-faststart | RO | string | (sub-property of lldp-local-summary) |
| Whether LLDP-MED fast start mechanism is enabled. | |||
| lldpmed-faststart-interval | RO | string | (sub-property of lldp-local-summary) |
| LLDP-MED fast start interval. | |||
| bond-slave-src-mac-type | RO | string | (sub-property of lldp-local-summary) |
| Source MAC type for LLDP frames on bond slaves. | |||
| lldp-portid-type | RO | string | (sub-property of lldp-local-summary) |
| Port ID TLV subtype for LLDP frames. | |||
| lldp-agent-type | RO | string | (sub-property of lldp-local-summary) |
| LLDP agent type. |
Show lldp local interface ethernet
Section titled “Show lldp local interface ethernet”Tree Diagrams
+---x show-lldp-local-interface | +---w input | | +---w port? | +--ro output | +--ro lldp-local-interface* [local-port] | +--ro local-port | +--ro via? | +--ro age? | +--ro device? | +--ro device-id? | +--ro device-descr? | +--ro device-mgmt-ip? | +--ro device-mgmt-iface? | +--ro port-id? | +--ro port-id-type? | +--ro port-descr? | +--ro port-ttl? | +--ro capability* [type] | +--ro type | +--ro enabled?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-lldp-local-interface | M | Path-only node, has no configurable value. | |
| Show LLDP configuration of specific interface. | |||
| port | M | Ethernet name or Mgmt0 | (sub-property of input) |
| The name of the port. | |||
| lldp-local-interface | RO | string | (sub-property of output) |
| Path-only node, has no configurable value. | |||
| Local port LLDP interface information. | |||
| local-port | RO | string | (sub-property of lldp-local-interface) |
| Local interface name. | |||
| via | RO | string | (sub-property of lldp-local-interface) |
| Protocol via which information was learned (e.g., LLDP). | |||
| age | RO | string | (sub-property of lldp-local-interface) |
| Age of the connection information. | |||
| device | RO | string | (sub-property of lldp-local-interface) |
| Device system name. | |||
| device-id | RO | string | (sub-property of lldp-local-interface) |
| Device chassis ID. | |||
| device-descr | RO | string | (sub-property of lldp-local-interface) |
| Device system description. | |||
| device-mgmt-ip | RO | string | (sub-property of lldp-local-interface) |
| Device management IP address. | |||
| device-mgmt-iface | RO | string | (sub-property of lldp-local-interface) |
| Device management interface index. | |||
| port-id | RO | string | (sub-property of lldp-local-interface) |
| Port ID or name. | |||
| port-id-type | RO | string | (sub-property of lldp-local-interface) |
| Type of port ID (e.g., ifname, local). | |||
| port-descr | RO | string | (sub-property of lldp-local-interface) |
| Port description. | |||
| port-ttl | RO | string | (sub-property of lldp-local-interface) |
| Port time-to-live. | |||
| capability | RO | string | (sub-property of lldp-local-interface) |
| Path-only node, has no configurable value. | |||
| List of device capabilities with their enabled status. | |||
| type | RO | string | (sub-property of capability) |
| Capability type (e.g., Bridge, Router, Wlan, Station). | |||
| enabled | RO | ”true" | |
| "false” | (sub-property of capability) | ||
| Whether this capability is enabled |
Show lldp neighbor summary** Tree Diagrams **
Section titled “Show lldp neighbor summary** Tree Diagrams **” +---x show-lldp-neighbor-summary | +--ro output | +--ro lldp-neighbor-summary* [local-port] | +--ro local-port | +--ro remote-device? | +--ro remote-port-id? | +--ro capability? | +--ro remote-port-descr?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-lldp-neighbor-summary | M | Path-only node, has no configurable value. | |
| Show LLDP neighbor summary information. | |||
| lldp-neighbor-summary | RO | (sub-property of output) | |
| Path-only node, has no configurable value. | |||
| Local port for learning LLDP information. | |||
| local-port | RO | string | (sub-property of lldp-neighbor-summary) |
| Local interface name depends on port-id-subtype. | |||
| remote-device | RO | string | (sub-property of lldp-neighbor-summary) |
| Remote device system name. | |||
| remote-port-id | RO | string | (sub-property of lldp-neighbor-summary) |
| Remote port ID or name. | |||
| capability | RO | ’B’ or ‘R’ or ‘BR’ | (sub-property of lldp-neighbor-summary) ‘B’ for Bridge, ‘R’ for Router |
| remote-port-descr | RO | string | (sub-property of lldp-neighbor-summary) Remote port description. |
Show lldp neighbor interface ethernet** Tree Diagrams **
Section titled “Show lldp neighbor interface ethernet** Tree Diagrams **” +---x show-lldp-neighbor-interface +---w input | +---w port? +--ro output +--ro lldp-neighbor-interface* [local-port] +--ro local-port +--ro via? +--ro rid? +--ro age? +--ro remote-device? +--ro remote-device-id? +--ro remote-device-descr? +--ro remote-device-mgmt-ip? +--ro remote-device-mgmt-iface? +--ro remote-port-id? +--ro remote-port-id-type? +--ro remote-port-descr? +--ro remote-port-ttl? +--ro capability* [type] | +--ro type | +--ro enabled? +--ro vlan-list* [] +--ro vlan-id? +--ro value? +--ro pvid?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-lldp-neighbor-interface | M | Path-only node, has no configurable value. | |
| Show LLDP neighbor information of specific interface. | |||
| port | M | Ethernet name or Mgmt0 | (sub-property of input) |
| The name of the port. | |||
| lldp-neighbor-interface | RO | (sub-property of output) | |
| Path-only node, has no configurable value. | |||
| Local port for learning LLDP neighbor information. | |||
| local-port | RO | string | (sub-property of lldp-neighbor-interface) |
| Local interface name depends on port-id-subtype. | |||
| via | RO | string | (sub-property of lldp-neighbor-interface) |
| Protocol via which information was learned (e.g., LLDP). | |||
| rid | RO | string | (sub-property of lldp-neighbor-interface) |
| Remote identifier. | |||
| age | RO | string | (sub-property of lldp-neighbor-interface) |
| Age of the connection information. | |||
| remote-device | RO | string | (sub-property of lldp-neighbor-interface) |
| Remote device system name. | |||
| remote-device-id | RO | string | (sub-property of lldp-neighbor-interface) |
| Remote device chassis ID. | |||
| remote-device-descr | RO | string | (sub-property of lldp-neighbor-interface) |
| Remote device system description. | |||
| remote-device-mgmt-ip | RO | string | (sub-property of lldp-neighbor-interface) |
| Remote device management IP address. | |||
| remote-device-mgmt-iface | RO | string | (sub-property of lldp-neighbor-interface) |
| Remote device management interface index. | |||
| remote-port-id | RO | string | (sub-property of lldp-neighbor-interface) |
| Remote port ID or name. | |||
| remote-port-id-type | RO | string | (sub-property of lldp-neighbor-interface) |
| Type of remote port ID (e.g., ifname, local). | |||
| remote-port-descr | RO | string | (sub-property of lldp-neighbor-interface) |
| Remote port description. | |||
| remote-port-ttl | RO | string | (sub-property of lldp-neighbor-interface) |
| Remote port time-to-live. | |||
| capability | RO | (sub-property of lldp-neighbor-interface) | |
| Path-only node, has no configurable value. | |||
| List of device capabilities with their enabled status. | |||
| type | RO | string | (sub-property of capability) |
| Capability type (e.g., Bridge, Router, Wlan, Station). | |||
| enabled | RO | ”true" | |
| "false” | (sub-property of capability) | ||
| Whether this capability is enabled. | |||
| vlan-list | RO | (sub-property of lldp-neighbor-interface) | |
| Path-only node, has no configurable value. | |||
| List of VLANs advertised by remote device. Can be a single VLAN or multiple VLANs. | |||
| vlan-id | RO | string | (sub-property of vlan-list) |
| VLAN ID advertised by remote device. | |||
| value | RO | string | (sub-property of vlan-list) |
| VLAN name advertised by remote device. | |||
| pvid | RO | ”true" | |
| "false” | (sub-property of vlan-list) | ||
| Whether this is the PVID (Primary VLAN ID). |