Managing Network Datalinks in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

How to Enable LLDP for Specific Ports

Before You Begin

In order to enable LLDP, you must first install the LLDP package. For more information, see How to Install the LLDP Package.

  1. Become an administrator.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .

  2. 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.

  3. Restart the LLDP service if you have changed the SMF property auto-enable-agents in step 2.
    # svcadm restart svc:/network/lldp:default
  4. 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.

  5. 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 Table 5–1.

    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.

  6. (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 Table 5–3.

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

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

Example 5-2  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   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    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 5-3  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    DEFAULT   POSSIBLE
net0    mode       rw     both     disable   txonly,rxonly,both,disable
net1    mode       rw     txonly   disable   txonly,rxonly,both,disable