System Administration Guide: Network Interfaces and Network Virtualization

ProcedureHow to Obtain Statistics on VNICs

VNIC statistics are useful for provisioning purposes, such as determining whether a system needs additional VNICs or possibly additional interfaces. You can also use VNIC traffic statistics to determine how well network consolidation onto a virtual network is working.

Before You Begin

The task assumes that you have a working virtual network, such as the network configured in Configuring a Basic Virtual Network.

  1. On the system where you create the virtual network, become superuser or assume the equivalent root role in the global zone.

    To create and assign the root role, see How to Make root User Into a Role in System Administration Guide: Security Services.

  2. Observe traffic flow over network interfaces

    Before checking the flow usage on individual VNICs, you might want to view overall usage of the VNIC's underlying interface.

    where link-name is the name of a currently plumbed interface, for example internal0.


    # dladm show-link -s -i 5 internal0
    LINK        IPACKETS  RBYTES      IERRORS  OPACKETS  OBYTES      OERRORS
    internal0   5315127   400738164         0   169526   29260024         0
    LINK        IPACKETS  RBYTES      IERRORS  OPACKETS  OBYTES      OERRORS
    internal0         1          60         0        2        340         0
    LINK        IPACKETS  RBYTES      IERRORS  OPACKETS  OBYTES      OERRORS
    internal0        17        1020         0        4        456         0
    ^C

    To halt the display, press Ctrl-C.

  3. Observe traffic flow over configured VNICs.

    Use the following syntax for each VNIC in the virtual network. You must run this command in the global zone for all VNICs configured on the system.


    #  dladm show-link -s -i 5 vnic-link-name
     
    

    where vnic-name is the name of the VNIC whose traffic you want to observe.

    You should receive output similar to the following:


    # dladm show-link -s -i 5 vnic0
                ipackets  rbytes      ierrors   opackets      obytes      oerrors
    vnic0       537001    48104701    0         5             210         0
                ipackets  rbytes      ierrors   opackets      obytes      oerrors
    vnic0       3         270         0         0             0           0
    ^C

    The output indicates that vnic0 has had both incoming packet (ipackets) and outgoing packet (opackets) traffic.

    To halt the display, press Ctrl-C.