How to configure NET on Virtual Machine for global zone with etherstub

 

The procedure of installation and configuration network for real (hardware) machine is described here. But when you will try to it on Virtual Machine it can be slightly different. The structure of network configuration for global zone will look like this:

First of all, you won’t have real Ethernet adapter on your Virtual Machine but just a Virtual Adapter that will be connected to all other machines in the lab. Usually it has vmxnet3s0 name but you can examine it by entering ‘dladm show-phys’ command:

root@dilos:~# dladm show-phys LINK MEDIA STATE SPEED DUPLEX DEVICE vmxnet3s0 Ethernet up 10000 full vmxnet3s0

Its address will be exactly that you entered when installing DilOS. For our example we will use 10.20.50.165 address that looks usable for our labs. However, you can check this address by entering the ‘ifconfig’ command like this:

root@dilos:~# ifconfig lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 vmxnet3s0: flags=1100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4> mtu 1500 index 3 inet 10.20.50.165 netmask ffffff00 broadcast 10.20.50.255 ether 0:50:56:b2:71:ae lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1 inet6 ::1/128

It is supposed that your Internet is configured correctly and works fine till this point.

So, to work with zones correctly we will organize VPN inside our Virtual Machine and will connect our zones to this VPN. You can select any work address range for your VPN that is not crossed with external lab addresses (in our example external range is 10.20.50.XXX). Let's take 192.168.0.XXX range for our VPN.

For this purpose we will create a virtual software switch (etherstub) and name it, for example, vsw0:

dladm create-etherstub vsw0 dladm set-linkprop -p mtu=1500 vsw0

After that we have to create an interface (end point) for this etherstub in the form of VNIC instead of physical cable connected to a physical NIC and name it, for example, int0 and then connect it to the etherstub vsw0 and check that everything is created:

So, we see that etherstub is created and vnic int0 is connected to it (lines 5 and 6). All zone interfaces (as you will see a little bit later) will be connected to vsw0 as well inside our VPN.

You can configure int0 interface it manually like this:

Create /etc/hostname.int0 file and write there:

And to forward packages outside VPN (to Internet) and back the NAT must be configured. It can be done with writing the following lines to the /etc/ipf/ipnat.conf file:

It connects our vmxnet3s0 virtual adapter and our software switch 192.168.0.0.

Enable ipfilter if it is still disabled:

Examine packets ip forwarding as well:

IPv4 forwarding is disabled (line 7); enable it:

Now it is enabled, configure the first zone to test the result. The full zone installation procedure is described here and you can do it. Below is just some significant points that should be done for network configuration:

These points are:

  • in line 10 we give the name for our zone interface in VPN iz1

  • in line 11 we connect our interface to the etherstub vsw0

  • in line 12 we assign an IP address that we would like to assign for our zone 192.168.0.1

  • in line 13 we connect our zone trough our VPN interface int0 192.168.0.254

  • and in line 20 we assign an address of our name server (here this is a Google name server 8.8.8.8)

And now you can install and boot your zone like it is described in the instruction mentioned at the beginning of this page.

And if you do everything right you will see that your zone is created and connected to this VPN (lines 5 an 6):

So, you can also add other zones and make test procedures according that instruction as well.

Good luck!