To obtain information about the VNICs on your system, use the dladm show-vnic command.
Example 2-7 Displaying VNICs on a System# dladm show-vnic LINK OVER SPEED MACADDRESS MACADDRTYPE VIDS vnic1 net0 1000 2:8:20:c2:39:38 random 123 vnic2 net0 1000 2:8:20:5f:84:ff random 456
The output shows the following information:
Virtual datalink, identified by a name.
Physical or virtual datalink over which the VNIC is configured.
Maximum speed of the VNIC, in megabits per second.
MAC address of the VNIC.
MAC address type of the VNIC, which can be one of the following:
random – The random address assigned to the VNIC
factory – The factory MAC address of the NIC used by the VNIC
fixed – The MAC address assigned by the user
VLAN ID of the VNIC.
You can use any dladm command that shows information about datalinks to include information about VNICs if they exist on the system. For example, the dladm show-link command displays VNICs with other datalinks. You can use the dladm show-linkprop command to display the properties of VNICs.
To obtain information about the datalink property of a single VNIC, specify the VNIC in the following command syntax:
# dladm show-linkprop [-p property] vnicExample 2-8 Displaying VNICs That Are Attached to Zones
In this example, information is displayed for the primary datalink and VNICs that are attached to the zones. The primary datalink net0 is attached to the global zone. The VNICs, vnic1 and vnic2, are attached to zone1 and zone2 respectively.
# dladm show-link -Z LINK ZONE CLASS MTU STATE OVER net0 global phys 1500 up -- zone1/vnic1 zone1 vnic 1500 up net0 zone2/vnic2 zone2 vnic 1500 up net0
Multiple MAC addresses are associated with system-created VNICs in Oracle VM Server for SPARC and the anet resources in Oracle Solaris Kernel Zones. In Oracle VM Server for SPARC, you need to create a vnet with the alt-mac-addrs property to support VNICs and zones inside a guest domain. In this case, the system automatically creates a VNIC with multiple MAC addresses. These multiple MAC addresses are obtained from the vnet that you created. For more information, see Oracle VM Server for SPARC 3.1 Administration Guide.
To support zones or VNICs inside kernel zones, you configure the anet resources with multiple MAC addresses. You use the zonecfg command to specify multiple MAC addresses to the anet resources created for network access in kernel zones. For more information, see the solaris-kz (5) man page. For information about configuring kernel zones, see Creating and Using Oracle Solaris Kernel Zones .
When multiple MAC addresses are associated with VNICs, one MAC address is used by the virtual network driver. You can use the remaining MAC addresses to create VNICs inside kernel zones or a guest domain. For example, if a VNIC is associated with three MAC addresses, one MAC address is assigned for the virtual network driver. Hence, you can create only two VNICs with the remaining two MAC addresses.
You can use the following command to display multiple MAC addresses associated with VNICs:
# dladm show-vnic -mExample 2-9 Displaying VNICs With Multiple MAC Addresses in Kernel Zones
# dladm show-vnic -m LINK OVER MACADDRESSES MACADDRTYPES VIDS gz_vnic0 net0 2:8:20:d7:27:9d random 0 zone1/net0 net0 2:8:20:70:52:9 random 0 2:8:20:c9:d:4c fixed 2:8:20:70:db:3 random zone1/net1 net0 0:1:2:3:4:5 fixed 0 0:1:2:3:4:6 fixed
In this example, kernel zone zone1 has two anet resources: net0 and net1. Both resources have more than one MAC address configured. Therefore, inside kernel zone zone1, you can create up to two VNICs on top of the virtual NIC driver zvnet associated with datalink net0. You can create only one VNIC on top of the virtual NIC driver zvnet associated with datalink net1.
Example 2-10 Displaying System-Created VNICs With Multiple MAC Addresses# dladm show-vnic -m LINK OVER MACADDRESSES MACADDRTYPES VIDS ldoms-vsw0.vport0 net1 0:14:4f:fb:e1:8f fixed 0,21 0:14:4f:f8:6b:9 fixed 0:14:4f:fa:48:7f fixed ldoms-vsw0.vport1 net1 0:14:4f:f9:1b:8d fixed 45,44 0:14:4f:f9:27:4 fixed
In this example, you can create up to two VNICs on top of the guest domain's virtual network driver vnet associated with ldoms-vsw0.vport0. You can create up to one VNIC on top of the virtual NIC driver vnet associated with ldoms-vsw0.vport1.
The physical link state of a datalink identifies whether the physical device has connectivity with the external network. If the cable is plugged in and the state of the port on the other end of the cable is up, then the physical device has connectivity with the external network.
You can use the following commands to display the physical link state of a datalink:
# dladm show-phys [link]
# dladm show-ether [link]
For more information, see the dladm (1M) man page.
Example 2-11 Displaying the Physical Link State of DatalinksThe following example displays the physical link state of datalinks on a system by using the dladm show-phys command.
# dladm show-phys LINK MEDIA STATE SPEED DUPLEX DEVICE net1 Ethernet down 0 unknown e1000g1 net2 Ethernet down 0 unknown e1000g2 net3 Ethernet down 0 unknown e1000g3 net0 Ethernet up 1000 full e1000g0
The following example displays the physical link state of datalinks on a system by using the dladm show-ether command.
# dladm show-ether LINK PTYPE STATE AUTO SPEED-DUPLEX PAUSE net1 current down yes 0M bi net2 current down yes 0M bi net3 current down yes 0M bi net0 current up yes 1G-f bi
When multiple VNICs are created over a NIC, a virtual switch is created internally to enable VNICs and the primary datalink to communicate when they are on the same VLAN. These datalinks can communicate with each other even if the physical datalink has no connection with the external network. This forms the virtual link state of the datalink, which can be up, down, or unknown. The virtual link state of a datalink identifies whether a datalink has connectivity with internal networks within the system even if the physical cable is unplugged.
You use the following command to display the virtual link state of a datalink:
# dladm show-link [link]Example 2-12 Displaying the Virtual Link State of Datalinks
This example displays the virtual link state of datalinks on a system.
# dladm show-link LINK CLASS MTU STATE OVER net0 phys 1500 up -- net2 phys 1500 down -- net4 phys 1500 down -- net1 phys 1500 up -- net5 phys 1500 up -- vnic0 vnic 1500 up net5 vnic1 vnic 1500 up net5 vnic2 vnic 1500 up net1