Go to main content

Managing Network Datalinks in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

How to Enable LLDP for Specific Ports

Before You Begin

You have installed the LLDP package. For the procedure, see How to Install the LLDP Package.

Ensure that your role has the appropriate rights profile to perform this procedure. See Using Rights Profiles to Perform Network Configuration.

  1. Change the SMF auto-enable-agents property to no if it is set to yes.
    $ svccfg -s svc:/network/lldp:default setprop lldp/auto-enable-agents = "no"

    By default, this property is set to yes.

  2. Restart the LLDP service if you have changed the SMF property auto-enable-agents in step 2.
    $ svcadm restart svc:/network/lldp:default
  3. Enable LLDP agents on selected ports or links.
    $ lldpadm set-agentprop -p mode=value agent

    where agent is the LLDP agent and is identified by the physical link on which the agent is enabled. For example, if you enable LLDP on net0, the agent is net0.

    The property mode can be set to one of four possible values that represent the LLDP agent's modes of operation: txonly, rxonly, both, and disable. For an explanation of these values, see LLDP Agent Modes.

  4. Specify the TLV units that the LLDP agent can advertise.
    $ lldpadm set-agentprop -p property=value agent

    For an explanation of the properties of the LLDP agent, see Information the LLDP Agent Advertises.

    To display a list of the other properties of the LLDP agent, type lldpadm show-agentprop or refer to Figure 1, Table 1, Optional TLV Units for an LLDP Agent.

    For instructions about how to specify TLV units for LLDP packet of an agent, see How to Specify TLV Units for the LLDP Packet of an Agent.

  5. (Optional) Customize the per-agent TLV units.
    $ lldpadm set-agenttlvprop -p property=value -a agent per-agent-TLV

    where property refers to the property of the per-agent TLV unit.

    For an explanation of per-agent TLV units, see TLV Unit Properties.

    To display a list of per-agent TLVs, type lldpadm show-agenttlvprop or refer to Figure 3, Table 3, Per-Agent TLV Units and Their Properties.

    For instructions about how to define TLV values, see How to Define TLV Units.

    For information about the lldpadm command, see the lldpadm(8) man page.

Example 33  Customizing the auto-enable-agents SMF Property

The following example shows the different way in which LLDP is enabled if you change the value of the SMF property auto-enable-agents. For example, given a system with four ports, LLDP is configured on two ports as follows:

  • net0: both mode

  • net1: rxonly mode

  • net2 and net3: none

If the SMF property auto-enable-agents has the default value yes, LLDP is automatically enabled on net2 and net3. You can display the LLDP configuration as follows:

$ lldpadm show-agentprop -p mode
AGENT   PROPERTY   PERM   VALUE   EFFECTIVE   DEFAULT   POSSIBLE
net0    mode       rw     both      --        disable   txonly,rxonly,both,disable
net1    mode       rw     rxonly    --        disable   txonly,rxonly,both,disable
net2    mode       rw     both      --        disable   txonly,rxonly,both,disable
net3    mode       rw     both      --        disable   txonly,rxonly,both,disable

If you switch the SMF property to no, the configuration changes when you restart the service.

$ svccfg -s svc:/network/lldp:default setprop lldp/auto-enable-agents = "no"
$ svcadm restart svc:/network/lldp:default
$ lldpadm show-agentprop -p mode
AGENT   PROPERTY   PERM   VALUE    EFFECTIVE    DEFAULT   POSSIBLE
net0    mode       rw     both       --         disable   txonly,rxonly,both,disable
net1    mode       rw     rxonly     --         disable   txonly,rxonly,both,disable
net2    mode       rw     disable    --         disable   txonly,rxonly,both,disable
net3    mode       rw     disable    --         disable   txonly,rxonly,both,disable

In the sample output, net2 and net3, whose LLDP modes were previously automatically enabled, are now flagged as disabled. However, no change occurs on net0 and net1, whose LLDP agents were previously configured.

Example 34  Enabling LLDP on Multiple Datalinks

This example shows how to enable LLDP selectively. A system has two datalinks, net0 and net1. On net0, to set the agent to transmit and receive LLDP packets, and on net1, to set the agent to only transmit LLDP packets, type the following commands:

$ svccfg -s svc:/network/lldp:default setprop lldp/auto-enable-agents = "no"
$ svcadm restart svc:/network/lldp:default
$ lldpadm set-agentprop -p mode=both net0
$ lldpadm set-agentprop -p mode=txonly net1
$ lldpadm show-agentprop -p mode
AGENT   PROPERTY   PERM   VALUE    EFFECTIVE   DEFAULT   POSSIBLE
net0    mode       rw     both       --        disable   txonly,rxonly,both,disable
net1    mode       rw     txonly     --        disable   txonly,rxonly,both,disable