Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

We have ahost with the only external IP-address. We want to install many non-global zones to buld the system and to port packages or for other services. The crossbow helps us to solve this problem. Let’s look at the diagram of the host:

In this host we have a physical NIC atge which connected to an external hardware switch. A virtual interface ext0 (VNIC) was created over the physical NIC (for example, to make a tagged packets). Let’s see at the real example:

lenovo# dladm show-link
LINK        CLASS     MTU    STATE    BRIDGE     OVER
atge0       phys      1500   up       --         --

Create an extenal VNIC over the physical device:

lenovo# dladm create-vnic -l atge0 ext0

Let’s see the result:

lenovo# dladm show-link
LINK        CLASS     MTU    STATE    BRIDGE     OVER
atge0       phys      1500   up       --         --
ext0        vnic      1500   up       --         atge0

Now configure the new VNIC as a regular network interface. Just create a file /etc/hostname.ext0 like this:

lenovo# cat /etc/hostname.ext0
192.168.0.3 netmask 255.255.255.0 broadcast + up

Create /etc/defaultrouter file and specify a default gateway like this:

lenovo cat /etc/defaultrouter 
192.168.0.1

Now you can reconfigure the network, just restart the service network/physical:

lenovo# svcs network/physical
STATE          STIME    FMRI
disabled        9:48:02 svc:/network/physical:nwam
online          9:48:11 svc:/network/physical:default

lenovo# svcadm restart svc:/network/physical:default

lenovo# svcs network/physical                       
STATE          STIME    FMRI
disabled        9:48:02 svc:/network/physical:nwam
online         11:02:04 svc:/network/physical:default

You will see something like this:

lenovo# ifconfig 
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000 
ext0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 2
        inet 192.168.0.3 netmask ffffff00 broadcast 192.168.0.255
        ether 2:8:20:f9:ec:e5 
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
        inet6 ::1/128 

lenovo# netstat -rnf inet

Routing Table: IPv4
  Destination            Gateway          Flags  Ref     Use     Interface 
-------------------- -------------------- ----- ----- ---------- --------- 
default              192.168.0.1          UG        2          0 ext0      
127.0.0.1            127.0.0.1            UH        2         28 lo0       
192.168.0.0          192.168.0.3          U         4         60 ext0      

Alternatively you can do it manually:

lenovo# ifconfig ext0 plumb
lenovo# ifconfig ext0 inet 192.168.0.3/24 up
lenovo# route add default 192.168.0.1

But… This is a temporary solution, it works until you reboot the system. You can use this method to access the system via ssh and then to configure the network permanently.

Now the global zone has configured partially, it means that we need second VNIC to do NAT for the non-global zones.

  • No labels