Managing Network Virtualization and Network Resources in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014

How to Reconfigure a Zone to Use a VNIC

This procedure refers to the second zone in the virtual network. This zone already exists but its current configuration prevents it from becoming a part of the virtual network. Specifically, the zone's IP type is a shared type and its current interface is net0. Both of these configurations must be changed.

  1. Become an administrator.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .

  2. Create the VNIC.
    global# dladm create-vnic -l link VNIC

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

  3. Change the zone's IP type from shared to exclusive.
    global# zonecfg -z zone
    zonecfg:zone> set ip-type=exclusive
  4. 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
  5. Verify and commit the changes that you have implemented and then exit the zone.
    zonecfg:zone> verify
    zonecfg:zone> commit
    zonecfg:zone> exit
  6. Reboot the zone.
    global# zoneadm -z zone reboot
  7. Log in to the zone.
    global# zlogin zone
  8. In the zone, create an IP interface over the VNIC that is now assigned to the zone.
    zone# ipadm create-ip interface
  9. 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
  10. Exit the zone.
    zone# exit
  11. From the global zone, add the address information to the /etc/hosts file.
Example 2-4  Reconfiguring a Zone to Use a VNIC

In this example, zone2 already exists as a shared zone. The zone also uses the primary interface of the system rather than a virtual link. You need to modify zone2 to use vnic2. To use vnic2, zone2's IP type must first be changed to exclusive. 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> set ip-type=exclusive
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 vnic2
ipadm: vnic2/v4

zone2# exit

global# pfedit /etc/hosts
::1             localhost       localhost    loghost   #For net0    zone1   #using vnic1    zone2   #using vnic2