The following procedure assumes that the zones are already created on the system. For information about zone configuration, see Chapter 2, Setting Up a Non-Global Zone in Creating and Using Oracle Solaris Zones.
Before You Begin
Ensure that your role has the appropriate rights profile to perform this procedure. See Using Rights Profiles to Perform Network Configuration.
$ ipadm show-addr
$ dladm create-vxlan -p prop=value vxlan-link
Specifies a comma-separated list of VXLAN datalink properties that can be set to the specified values on the VXLAN datalink that you create. You set the following properties:
addr – Specifies the IPv4 or IPv6 address for the VXLAN network. This address can be a specific address or a combination of address/prefix length.
vni – Specifies the network identifier of the VXLAN segment. You can specify a number between 0 and 16777215.
mgroup – (Optional) Specifies the multicast group name. You can specify this option only if the VXLAN segment has its own multicast group.
If the multicast address is not specified, the VXLAN segment uses the All Host multicast address, which addresses all the hosts on the same network segment.
Name of the VXLAN.
$ dladm create-vxlan -p prop=value
Specifies a comma-separated list of VXLAN datalink properties that can be set to the specified values on the VXLAN datalink that you create. You set the following properties:
interface – Specifies the IP interface for the VXLAN network.
vni – Specifies the network identifier of the VXLAN segment. You can specify a number between 0 and 16777215.
Name of the VXLAN.
When you specify the IP interface and the IP version, the VXLAN datalink is created over an available IP address of the version that is specified on that interface. For example, if you have an IP address 203.0.113.1 configured over net0, a VXLAN datalink is created over 203.0.113.1. By default, an IP version is an IPv4 address. However, if you need an IPv6 address, you must specify the version by using the ipvers property.
$ dladm show-vxlan
$ dladm create-vnic -l vxlan-link vnic
You can create VLAN VNIC over a VXLAN datalink. To create a VLAN VNIC, you must specify the –f (force) option. For information, see How to Configure VNICs as VLANs.
$ ipadm create-ip vnic
$ ipadm create-addr -a address vnic
zonecfg:zone> add net zonecfg:zone:net> set physical=vnic zonecfg:zone:net> end
zonecfg:zone> verify zonecfg:zone> commit zonecfg:zone> exit
global$ zoneadm -z zone reboot
global$ zlogin zone
zone$ ipadm create-ip interface
If you are assigning a static address to the VNIC, you would type the following:
zone$ ipadm create-addr -a address interface
Specifies the IP address, which can be in CIDR notation.
For information about the dladm and ipadm commands, see the dladm(8) and ipadm(8) man pages.
This example shows the entire process of configuring a VXLAN. It includes displaying the information so you can see the progress of the configuration process.
$ ipadm show-addr net4 ADDROBJ TYPE STATE ADDR net4/v4 static ok 203.0.113.1/27 $ dladm create-vxlan -p addr=203.0.113.1/27,vni=10 vxlan1 $ dladm show-vxlan LINK ADDR VNI MGROUP vxlan1 203.0.113.1/27 10 224.0.0.1 $ dladm show-link vxlan1 LINK CLASS MTU STATE OVER vxlan1 vxlan 1440 up -- $ dladm create-vnic -l vxlan1 vnic1 $ dladm show-vnic LINK OVER SPEED MACADDRESS MACADDRTYPE IDS vnic1 vxlan1 10000 2:8:20:fe:58:d4 random VID:0 $ ipadm create-ip vnic1 $ ipadm create-addr -T static -a local=203.0.113.34/27 vnic1/v4 $ ipadm show-addr vnic1 ADDROBJ TYPE STATE ADDR vnic1/v4 static ok 203.0.113.34/27Example 45 Assigning the VNIC Created Over a VXLAN to a Zone and Configuring an IP Interface
This example assumes that you have completed steps 1 to 6 in Example 44, Creating a VXLAN and Configuring an IP Interface for the VNIC Created Over the VXLAN.
After you create the VNIC, assign the VNIC to a zone and configure the IP interface.
global$ zonecfg -z zone2 zonecfg:zone2> add net zonecfg:zone2:net> set physical=vnic1 zonecfg:zone2:net> end zonecfg:zone2> verify zonecfg:zone2> commit zonecfg:zone2> exit global$ zoneadm -z zone2 reboot global$ zlogin zone2 zone2$ ipadm create-ip vnic1 zone2$ ipadm create-addr -a 192.0.2.85/24 vnic1 ipadm: vnic1/v4 zone2$ exit
You have assigned the VNIC to a zone and then configured the IP interface over the VNIC.