The example devices used in the following tasks use an instance number of 0 in the domains. The VLANs are mapped to the following subnets:
VLAN 20 Subnet 192.168.1.0 (netmask: 255.255.255.0)
VLAN 21 Subnet 192.168.2.0 (netmask: 255.255.255.0)
VLAN 22 Subnet 192.168.3.0 (netmask: 255.255.255.0)
primary# ldm add-vsw net-dev=net0 primary-vsw0 primary
Note that the –T static option of the ipadm create-addr command is required only if running an Oracle Solaris 11 OS older than the Oracle Solaris 11.1 OS. Starting with the Oracle Solaris 11 OS, –T static is the default behavior.
# ipadm create-ip net0 # ipadm create-addr -T static -a 192.168.2.100/24 net0 # dladm create-vlan -l net0 -v 20 vlan20 # ipadm create-ip vlan20 # ipadm create-addr -T static -a 192.168.2.100/24 vlan20
For more information about how to configure VLAN interfaces in the Oracle Solaris 11 OS, refer to Chapter 3, Configuring Virtual Networks by Using Virtual Local Area Networks, in Managing Network Datalinks in Oracle Solaris 11.3 .
For example, configure VLAN 21 as untagged and VLAN 20 as tagged. Note that the service domain is not configured to access VLAN ID 22.
primary# ldm add-vsw net-dev=nxge0 pvid=21 vid=20 primary-vsw0 primary
# ifconfig vsw0 plumb # ifconfig vsw0 192.168.2.100 netmask 0xffffff00 broadcast + up # ifconfig vsw20000 plumb # ifconfig vsw20000 192.168.1.100 netmask 0xffffff00 broadcast + up
After you complete this task, the ldom1 guest domain can communicate with the primary service domain and with remote and external systems that use externally tagged VLAN ID 21 and IP addresses on 192.168.2.0/24. The ldom1 guest domain can also communicate with the service domain and external systems that use tagged VLAN ID 20 and IP addresses on 192.168.1.0/24. The ldom1 guest domain can communicate only with external systems but not with the service domain that uses VLAN 22 and IP addresses on 192.168.3.0/24.
For example, configure VLAN 21 as untagged and VLAN 20 as tagged.
primary# ldm add-vnet pvid=21 vid=20,22 vnet0 primary-vsw0 ldom1 ldom1# ipadm create-ip net0 ldom1# ipadm create-addr -t 192.168.2.101/24 net0
ldom1# dladm create-vlan -l net0 -v 20 vlan20 ldom1# ipadm create-ip vlan20 ldom1# ipadm create-addr -t 192.168.1.101/24 vlan20 ldom1# dladm create-vlan -l net0 -v 22 vlan22 ldom1# ipadm create-ip vlan22 ldom1# ipadm create-addr -t 192.168.3.101/24 vlan22
After you complete this task, the ldom1 guest domain can communicate with the primary service domain and with remote and external systems that use externally tagged VLAN ID 21 and IP addresses on 192.168.2.0/24. The ldom1 guest domain can also communicate with the service domain and external systems that use tagged VLAN ID 20 and IP addresses on 192.168.1.0/24. The ldom1 guest domain can communicate only with external systems but not with the service domain that uses VLAN 22 and IP addresses on 192.168.3.0/24.
For example, configure VLAN 21 as untagged and VLAN 20 as tagged.
primary# ldm add-vnet pvid=21 vid=20,22 vnet0 primary-vsw0 ldom1 ldom1# ifconfig vnet0 plumb ldom1# ifconfig vnet0 192.168.2.101 netmask 0xffffff00 broadcast + up
ldom1# ifconfig vnet20000 plumb ldom1# ifconfig vnet20000 192.168.1.102 netmask 0xffffff00 broadcast + up ldom1# ifconfig vnet22000 plumb ldom1# ifconfig vnet22000 192.168.3.102 netmask 0xffffff00 broadcast + up