Example — Dynamically Creating and Destroying a Virtual Switch

To create and then explicitly destroy a port based virtual switch, do the following. Note: This example was done from the LINUX1 userid with Class B privilege.

  1. Define a port based virtual switch named PORTVSW.
    DEFINE VSWITCH PORTVSW PORTBASED
  2. Define a port for LINUX1 userid. (Authorizes LINUX1 to connect to port 10).
    SET VSWITCH PORTVSW PORTNUMBER 10 USERID LINUX1
  3. Define a simulated NIC of type QDIO. The virtual device number is 0800.
    DEFINE NIC 0800 QDIO
  4. Couple the simulated NIC to the virtual switch on the defined port.
    COUPLE 0800 TO SYSTEM PORTVSW PORTNUMBER 10 
  5. Explicitly destroy the virtual switch.
    DETACH VSWITCH PORTVSW
At the end of this process, the simulated NIC at devices 0800-0802 still exists, and can be coupled to another virtual switch. The command DETACH NIC is used to destroy the simulated NIC. To do this, enter:
DETACH NIC 0800

The command DETACH 0800 cannot be used to detach a simulated NIC. You must issue DETACH NIC when you want to remove a simulated NIC.