2015年1月13日 星期二

How to Reconfigure a Zone to Use a VNIC


How to Reconfigure a Zone to Use a VNIC

This procedure refers to the second zone in the virtual network. The 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.
  2. Create the VNIC.
    global# dladm create-vnic [-v vid] -l datalink vnic
    where vid refers to the VLAN ID that you assign to the VNIC. Specify the VLAN ID only if you want to create the VNIC as a VLAN.
    Do not configure the VNIC's interface yet. You will perform this step later in this procedure.
  3. Change the zone's IP type from shared to exclusive.
    global# zonecfg -z zone
    zonecfg:zone1> set ip-type=exclusive
    zonecfg:zone1>
  4. Change the zone's interface to use a VNIC.
    zonecfg:zone1> remove net physical=NIC
    zonecfg:zone1> add net
    zonecfg:zone1:net> set physical=vnic
    zonecfg:zone1:net> end
    zonecfg:zone1>
  5. Verify and commit the changes you have implemented and then exit the zone.
    zonecfg:zone1 verify
    zonecfg:zone1> commit
    zonecfg:zone1> exit
    global#
  6. Reboot the zone.
    global# zoneadm -z zone reboot
  7. Log in to the zone.
    global# zlogin zone
  8. Configure the VNIC with a valid IP address.
    If you are assigning a static address to the VNIC, you would type the following:
    zone# ipadm create-addr -a address interface
    where address can use CIDR notation.
  9. From the global zone, add the address information to the /etc/hosts file.
Example 2-3 Reconfiguring a Zone Configuration 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 vnic2zone2'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:zone1> set ip-type=exclusive
zonecfg:zone1> remove net physical=net0
zonecfg:zone1> add net
zonecfg:zone1:net> set physical=vnic2
zonecfg:zone1:net> end
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> 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# vi /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

參考資料
https://docs.oracle.com/cd/E26502_01/html/E28992/ggiyq.html#gicom

沒有留言:

張貼留言