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.
For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .
global# dladm create-vnic -l link VNIC
You will configure the VNIC's interface later in this procedure.
global# zonecfg -z zone zonecfg:zone> set ip-type=exclusive
zonecfg:zone> remove net physical=NIC zonecfg:zone> add net zonecfg:zone:net> set physical=VNIC zonecfg:zone:net> end
zonecfg:zone> verify zonecfg:zone> commit zonecfg:zone> exit
global# zoneadm -z zone reboot
global# zlogin zone
zone# ipadm create-ip interface
zone# ipadm create-addr -a address interface
Specifies the IP address, which can be in CIDR notation.
zone# ipadm create-addr -T dhcp interface
zone# exit
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 192.168.3.85/24 vnic2 ipadm: vnic2/v4 zone2# exit global# pfedit /etc/hosts # ::1 localhost 127.0.0.1 localhost 192.168.3.70 loghost #For net0 192.168.3.80 zone1 #using vnic1 192.168.3.85 zone2 #using vnic2