System Administration Guide: Network Interfaces and Network Virtualization

ProcedureHow to Manually Configure the VNIC and Exclusive IP Zone

This procedure explains how to manually configure IP addresses for VNICs and their associated zones. If you configured zones through the zone console after the initial booting, these addresses are configured automatically. You need to follow the next steps only if one of the following conditions is true:

Before You Begin

The procedure assumes that both the VNIC and zone are created, installed, and booted in the global zone.

  1. On the system where you create the virtual network, become superuser or assume the equivalent root role.

    To create and assign the root role, see How to Make root User Into a Role in System Administration Guide: Security Services.

  2. Log in to the zone.

    For example, you would type:


    # zlogin zone1
    # pwd
    /
  3. Verify that the VNIC is configured.


    # ifconfig -a
    lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
    	     inet 127.0.0.1 netmask ff000000
    lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
         inet6 ::1/128

    In this output, only the IPv4 and IPv6 loopback addresses are plumbed and up. No entry exists for the VNIC.

  4. Manually configure and plumb the VNIC from within the exclusive IP zone.

    You must plumb a VNIC in the following order for it to function properly in the virtual network.


    # ifconfig vnic-data-link plumb
    # ifconfig vnic-data-link IP-address
    # ifconfig vnic-data-link up
    

    For example, to add IP address 192.168.3.20 to vnic1, do the following:


    # ifconfig vnic1 plumb
    # ifconfig vnic1 192.168.3.20
    # ifconfig vnic1 up
    
  5. Verify that the VNIC is now configured and plumbed.


    # ifconfig -a
    lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
    	     inet 127.0.0.1 netmask ff000000
    vnic1: flags=201000842<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 2
               inet 192.168.3.20 netmask ffffff00 broadcast 192.168.3.255
               ether 2:8:20:54:f4:74
  6. Exit the exclusive IP zone, and go to the zone's subdirectory tree in the global zone.


    # exit
    # cd /export/home/zone1
    
  7. Create a hostname.vnic–name file for the VNIC.


    # cd root/etc
    # vi hostname.vnic1
    zoneID-IP address
    

    For example, for zone1 you type:


    zone1-192.183.3.20
  8. Add an entry for the zone in the root/etc/inet/hosts file.


    # cd inet
    # vi hosts
    # Internet host table
    #
    ::1                  localhost
    127.0.0.1            localhost
    192.168.3.20  zone1  loghost
    
  9. If the entry does not already exist, add the VNIC and its zone to the global zone's /etc/inet/hosts file.


    # cd /etc/inet
    # vi hosts
    # Internet host table
    #
    ::1     localhost
    127.0.0.1         localhost
    192.168.3.70      myhost     loghost
    192.168.3.20      zone1-192-168-3-20
    

Example 11–5 Manually Configuring a VNIC and Exclusive IP Zone

This example illustrates the following procedures:

You must log in to the global zone of the system as superuser or equivalent role to run the next commands.


# zlogin zone1
/
# ifconfig vnic1 plumb
# ifconfig vnic1 192.168.3.20
# ifconfig vnic1 up
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
	     inet 127.0.0.1 netmask ff000000
vnic1: flags=201000842<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 2
           inet 192.168.3.20 netmask ffffff00 broadcast 192.168.3.255
           ether 2:8:20:54:f4:74
# exit
# cd /export/home
# cd zone1/root/etc
# vi hostname.vnic1
zone1-192.168.3.20

# vi inet/hosts
# Internet host table
#
::1                  localhost
127.0.0.1            localhost
192.168.3.20  zone1  loghost

# cd /etc/inet
# vi hosts
# Internet host table
#
::1     localhost
127.0.0.1         localhost
192.168.3.70      myhost     loghost
192.168.3.20      zone1-192-168-3-20

Next Steps

After you are finished, verify that your configuration is correct, as explained in How to Verify the Exclusive IP Zone Over VNIC Configuration.