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:
You did not run the zone console configuration program after booting the zones and want to configure IP addresses manually. In this case, you should perform all the steps in the procedure.
You performed the validation checks in How to Verify the Exclusive IP Zone Over VNIC Configurationand uncovered problems. Some typical problems include the VNIC was not plumbed, or problems with a relevant files, such as hostname.vnic-name. In this case, complete only the steps that relate to the specific problems that you found.
The procedure assumes that both the VNIC and zone are created, installed, and booted in the global zone.
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.
Log in to the zone.
For example, you would type:
# zlogin zone1 # pwd / |
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.
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 |
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 |
Exit the exclusive IP zone, and go to the zone's subdirectory tree in the global zone.
# exit # cd /export/home/zone1 |
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 |
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 |
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 |
This example illustrates the following procedures:
Plumbing vnic1 from within a zone and assigning an IP address to the VNIC.
Adding the IP address for zone1 and vnic1 to the appropriate files, so that this IP address persists across reboots.
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 |
After you are finished, verify that your configuration is correct, as explained in How to Verify the Exclusive IP Zone Over VNIC Configuration.