Go to main content

Managing Network Virtualization and Network Resources in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

How to Reconfigure a Zone to Use a VNIC

This procedure assumes the case of an existing zone whose current configuration prevents it from becoming a part of the virtual network. To join the network, its current interface needs to be changed.

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. Create the VNIC.
    global$ dladm create-vnic -l link VNIC

    You will configure the VNIC's interface later in this procedure.

  2. Change the zone's interface to use a VNIC.
    zonecfg:zone> remove net physical=NIC
    zonecfg:zone> add net
    zonecfg:zone:net> set physical=VNIC
    zonecfg:zone:net> end
  3. Verify and commit the changes that you have implemented and then exit the zone.
    zonecfg:zone> verify
    zonecfg:zone> commit
    zonecfg:zone> exit
  4. Reboot the zone.
    global$ zoneadm -z zone reboot
  5. Log in to the zone.
    global$ zlogin zone
  6. In the zone, create an IP interface over the VNIC that is now assigned to the zone.
    zone$ ipadm create-ip interface
  7. Configure the VNIC with a static IP address or a Dynamic Host Configuration Protocol (DHCP) IP address.
    • Assign a static IP address.
      zone$ ipadm create-addr -a address interface
      –a address

      Specifies the IP address, which can be in CIDR notation.

    • Assign a DHCP IP address.
      zone$ ipadm create-addr -T dhcp interface
  8. Exit the zone.
    zone$ exit
  9. From the global zone, add the address information to the /etc/hosts file.
Example 8  Reconfiguring a Zone to Use a VNIC

In this example, the zone uses the primary interface of the system rather than a virtual link. You need to modify zone2 to use vnic2. Note that some of the output is truncated to focus on the relevant information that relates to virtual networks.

global$ dladm create-vnic -l net0 vnic2

global$ zonecfg -z zone2
zonecfg:zone2> remove net physical=net0
zonecfg:zone2> add net
zonecfg:zone2:net> set physical=vnic2
zonecfg:zone2:net> end
zonecfg:zone2> verify
zonecfg:zone2> commit
zonecfg:zone2> exit
global$ zoneadm -z zone2 reboot

global$ zlogin zone2
zone2$ ipadm create-ip vnic2
zone2$ ipadm create-addr -a 192.0.2.85/24 vnic2
ipadm: vnic2/v4

zone2$ exit

global$ pfedit /etc/hosts
#
::1             localhost
127.0.0.1       localhost
192.0.2.20      loghost   #For net0
192.0.2.80      zone1   #using vnic1
192.0.2.85      zone2   #using vnic2