Preparing a virtual switch
Virtual switches can be based on OSA-Express, Network Express (NETH and NETD network devices) or HiperSockets™ network devices.
Before you begin
You need the Open vSwitch package. See your distribution documentation to find out whether this package is included in the distribution or how to obtain it.
Procedure
- Configure the network devices that are to be used by the virtual switch to receive all
frames with unknown MAC addresses. Use one of the following options:
- Set VNIC characteristics for the network device
- Configure the network device as a bridge port
- Configure promiscuous mode for NETH/NETD (see Example: Open vSwitch with Network Express)
See your IBM Z hardware documentation about support for VNIC characteristics and for bridge port configurations. Support might differ for HiperSockets and OSA devices. Use VNIC characteristics if available.- To configure a network device with VNIC characteristics enable flooding and learning:Use the lszdev command to show the current settings.
# lszdev <ccwgroup> --info
Example: This example shows a typical configuration for a bridge-like behavior of the device.# lszdev 0.0.5b11 --info ... ATTRIBUTE ACTIVE PERSISTENT ... vnicc/bridge_invisible "0" - vnicc/flooding "1" - vnicc/learning "1" - vnicc/learning_timeout "600" - vnicc/mcast_flooding "1" - vnicc/rx_bcast "1" - vnicc/takeover_learning "1" - vnicc/takeover_setvmac "1" -
If necessary, change the VNIC characteristic settings with the chzdev command.
If the attribute values show
n/a
, your device is already configured as a bridge port, or your IBM Z hardware does not support VNIC characteristics for your device type, HiperSockets or OSA. See the section that follows about checking if a device is configured as a bridge port. - To check whether a network device is an active bridge port, read the
bridge_state attribute of the qeth group device, for example with the
lszdev
command:
# lszdev <ccwgroup> --columns ATTR:bridge_state
Example:# lszdev 0.0.1108 --columns ATTR:bridge_state active/-
Unless the output already showsactive
, use the chzdev command to enable the bridge-port role:# chzdev qeth <device-bus-ID> layer2=1 bridge_role=primary
For more information about bridge ports or VNIC characteristics, see Device Drivers, Features, and Commands, SC33-8411.
- Ensure that an Open vSwitch package is installed and running.Issue systemctl status openvswitch to find out whether Open vSwitch is running. If necessary, issue systemctl start openvswitch to start it.For more information about Open vSwitch commands, see openvswitch.org/support/dist-docs.
- Create a virtual switch.Use the ovs-vsctl add-br command to create a virtual switch.
# ovs-vsctl add-br <vswitch>
The ovs-vsctl show command displays the available virtual switches and their state.
To delete a virtual switch, use the ovs-vsctl del-br command.
- Create an uplink port.
- If your network setup offers connections through two different network-devices, you can
configure for increased availability by using bonded ports. Use the ovs-vsctl
add-bond command to create a bonded
port.
# ovs-vsctl add-bond <vswitch> <bonded-interface> <slave1> <slave2>
- Use the ovs-vsctl add-port command to create a regular switch port. HiperSockets connections do not rely on adapter hardware and are
typically configured with a single
port.
# ovs-vsctl add-port <vswitch> <interface>
- If your network setup offers connections through two different network-devices, you can
configure for increased availability by using bonded ports. Use the ovs-vsctl
add-bond command to create a bonded
port.