New and revised dladm subcommands are now available to work with link names. This section specifically discusses the subcommands show-phys and show-link. Other commands that display information are discussed in their respective chapters that describe the specific network setups, such as link aggregations and VLAN configurations.
Use this procedure if you want to change a data link name, for example, to assign a meaningful name that would easily identify the link's role within your network setup.
Make sure that you have studied and prepared for other steps you need to perform on associated configurations that might be affected by the change of link names. For more information, see Considerations for Working With Link Names.
On the system on which you want to rename a data link, assume the System Administrator role.
The System Administrator role includes the Network Management profile. To create the role and assign the role to a user, see Chapter 9, Using Role-Based Access Control (Tasks), in System Administration Guide: Security Services.
Unplumb the IP interface.
# ifconfig interface unplumb |
Change the link's current link name.
# dladm rename-link old-linkname new-linkname |
Refers to the current name of the data link. By default, the link name is hardware-based, such as bge0.
Refers to any name that you want to assign to the data link. For rules for assigning link names, refer to Rules for Valid Link Names. See also Considerations for Working With Link Names for further information about renaming data links.
If you do not want the new link name to persist across a system reboot, then use the -t option immediately after the subcommand. The option renames a link temporarily. The original link name reverts when the system is rebooted.
You can use dladm rename-link to transfer link configurations from one data link to another. For an example, see How to Replace a Network Interface Card With Dynamic Reconfiguration. When you rename a link for this purpose, make sure that the link that is inheriting the configuration does not have any prior existing configurations. Otherwise, the transfer fails.
The following example shows how a link name is changed from a hardware-based name to a customized name.
# dladm rename-link bge0 net0 |
This procedure lists the steps to display information about the physical attributes of a system's data links.
On the system, assume the System Administrator role.
The System Administrator role includes the Network Management profile. To create the role and assign the role to a user, see Chapter 9, Using Role-Based Access Control (Tasks), in System Administration Guide: Security Services.
Display information about physical attributes of data links currently on the system.
# dladm show-phys -P |
You can use the -P with this command to also display data links that are flagged as unavailable. A data link becomes unavailable if its associated hardware has been removed. Without the -P option, the command displays only available data links.
To view the /devices path of the data links, use the -v option.
In the following example, the -P option includes the FLAGS column where unavailable links are indicated. The r flag for the data link net0 indicates the hardware that is associated with the link (eri) has been removed.
# dladm show-phys -P LINK MEDIA STATE SPEED DUPLEX DEVICE FLAGS subitops1 Ethernet up 100Mb full qfe3 ----- ibd0 Infiniband down 0Mb -- ibd0 ----- subitops0 Ethernet up 100Mb full ce0 ----- net0 Ethernet -- 0Mb -- eri0 r---- |
The following example shows the output that is generated when you use the -v option.
# dladm show-phys -v LINK PATH net2 /pci@1f,700000/network@2 ibd3 /pci@1d,700000/network@2 bge3 /pci@1f,700000/network@2,1 |
This procedure displays the status of available links.
Assume the System Administrator role.
The System Administrator role includes the Network Management profile. To create the role and assign the role to a user, see Chapter 9, Using Role-Based Access Control (Tasks), in System Administration Guide: Security Services.
Display link information.
# dladm show-link |
The following example shows persistent and available links on the system.
# dladm show-link -P LINK CLASS OVER subitops1 phys -- ibd0 phys -- eri0 phys -- |
The -P option also displays any existing persistent but unavailable links. A persistent link becomes unavailable if the link is temporarily deleted. A link also becomes unavailable if the associated hardware has been removed.
This procedure deletes link configurations that are associated with NICs. If you detach a NIC without intending to replace it, then you can delete the link configuration that is associated with that NIC. After you complete this procedure, the link name can be reused.
On the system with the interfaces to be configured, assume the System Administrator role.
The System Administrator role includes the Network Management profile. To create the role and assign the role to a user, see Chapter 9, Using Role-Based Access Control (Tasks), in System Administration Guide: Security Services.
Display the data links on the system including those links whose hardware have been removed.
To include information about removed hardware, use the -P option.
# dladm show-phys -P |
Remove the link configuration of the removed hardware that you do not intend to replace.
# dladm delete-phys link |
In the following example, the r flag for net0 indicates that the link's associated hardware (ce) has been removed. Therefore, you can also remove the link net0 and then reassign the name to a new data link.
# dladm show-phys -P LINK DEVUCE MEDIA FLAGS mylink0 qfe0 Ethernet ----- eri0 eri0 Ethernet ----- net0 ce0 Ethernet r---- # dladm delete-phys net0 |