Go to main content

Managing Network Virtualization and Network Resources in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

How to Configure VNICs and Etherstubs

The VNIC connects the virtual network to the external network. Zones communicate through their VNIC's virtual switch. You must create a VNIC for every zone in the virtual network.

This task includes a step to provide names to the components you are creating. For guidelines on assigning names, see Rules for Valid Link Names in Configuring and Managing Network Components in Oracle Solaris 11.4.

Before You Begin

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

  1. (Optional) Create an etherstub.
    $ dladm create-etherstub etherstub-name

    Perform this step only if you are creating an isolated private virtual network. See also Use Case: Configuring a Private Virtual Network.

  2. Create a VNIC.
    $ dladm create-vnic -l link VNIC
    link

    The name of the link over which the VNIC is configured. In the case of a private virtual network, you specify the name of the etherstub.

    VNIC

    The name of the VNIC.

  3. Create an IP interface over the VNIC.
    $ ipadm create-ip interface

    interface refers to the VNIC you just created.

  4. Assign an IP address to the VNIC interface.
    $ ipadm create-addr -a address interface
  5. (Optional) Verify the VNIC that has been created.
    $ dladm show-link
Example 1  Configuring a VNIC

This example shows how to configure vnic1 over the datalink net0.

$ dladm create-vnic -l net0 vnic1
$ ipadm create-ip vnic1
$ ipadm create-addr -a 192.0.2.10/24 vnic1
$ dladm show-link 
LINK          CLASS     MTU    STATE    OVER
net0          phys      1500   up       --
vnic1         vnic      1500   up       net0
Example 2  Configuring VNICs Over an Etherstub

This example shows how you can create an etherstub etherstub0 and configure VNICs vnic1 and vnic2 over the etherstub.

$ dladm create-etherstub etherstub0 
$ dladm create-vnic -l etherstub0 vnic1
$ dladm create-vnic -l etherstub0 vnic2
$ ipadm create-ip vnic1
$ ipadm create-addr -a 192.0.2.20/24 vnic1
$ ipadm create-ip vnic2
$ ipadm create-addr -a 192.0.2.30/24 vnic2
$ dladm show-etherstub -o all 
LINK          ZONE
etherstub0    global
$ dladm show-link
LINK          CLASS     MTU      STATE       OVER
net0          phys      1500     up          --
etherstub0    etherstub 9000     unknown     --
vnic1         vnic      9000     up          etherstub0
vnic2         vnic      9000     up          etherstub0