Oracle® VM Server for SPARC 3.2 Administration Guide

Exit Print View

Updated: May 2015
 
 

How to Assign VLANs to a Virtual Switch and Virtual Network Device

  1. Assign the virtual switch (vsw) to two VLANs.

    For example, configure VLAN 21 as untagged and VLAN 20 as tagged. Assign the virtual network (vnet) to three VLANs. Configure VLAN 20 as untagged and VLAN 21 and 22 as tagged.

    primary# ldm add-vsw net-dev=nxge0 pvid=21 vid=20 primary-vsw0 primary
    primary# ldm add-vnet pvid=20 vid=21,22 vnet01 primary-vsw0 ldom1
  2. Create the VLAN interfaces.

    This example assumes that the instance number of these devices is 0 in the domains, and the VLANs are mapped to these 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)

    1. Create the VLAN interface in the service (primary) domain.
      • Oracle Solaris 10 OS: Use the ifconfig command.
        primary# ifconfig vsw0 plumb
        primary# ifconfig vsw0 192.168.2.100 netmask 0xffffff00 broadcast + up
        primary# ifconfig vsw20000 plumb
        primary# ifconfig vsw20000 192.168.1.100 netmask 0xffffff00 broadcast + up
      • Oracle Solaris 11 OS: Use the dladm and ipadm commands.
        primary# dladm create-vlan -l net0 -v20 vlan20
        primary# ipadm create-ip vlan20
        primary# ipadm create-addr -T static -a 192.168.1.100/24 vlan20/ipv4
    2. Create the VLAN interface in the guest (ldom1) domain.
      • Oracle Solaris 10 OS: Use the ifconfig command.
        ldom1# ifconfig vnet0 plumb
        ldom1# ifconfig vnet0 192.168.1.101 netmask 0xffffff00 broadcast + up
        ldom1# ifconfig vnet21000 plumb
        ldom1# ifconfig vnet21000 192.168.2.101 netmask 0xffffff00 broadcast + up
        ldom1# ifconfig vnet22000 plumb
        ldom1# ifconfig vnet22000 192.168.3.101 netmask 0xffffff00 broadcast + up

        For more information about how to configure VLAN interfaces in the Oracle Solaris 10 OS, refer to Administering Virtual Local Area Networks in Oracle Solaris Administration: IP Services .

      • Oracle Solaris 11 OS: Use the dladm and ipadm commands.
        ldom1# dladm create-vlan -l net0 -v21
        ldom1# ipadm create-ip net0
        ldom1# ipadm create-addr -T static -a 192.168.1.101/24 net0/ipv4
        ldom1# ipadm create-ip net21000
        ldom1# ipadm create-addr -T static -a 192.168.2.101/24 net21000/ipv4
        ldom1# ipadm create-ip net22000
        ldom1# ipadm create-addr -T static -a 192.168.3.101/24 net22000/ipv4

        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.2 .