My previous openvswitch article dealt with building a recent release on one system, migrating the .deb files to another system, installing them, and getting the daemon to run upon reboot. Last year I also wrote about some useful configuration commands, which dealt with simple access port style interfaces.
This article rehashes some of those commands, adds a few more refinements regarding vlan capabilities, and offers some
additional background.
For working with vlan style interfaces, the documentation at
ovs-vsctlman page
is missing a few key information elements, elements I found at other sites. For example, to add an interface
for handling a particular layer2/layer3 network end, something like the following is required:
ovs-vsctl add-br br0
ovs-vsctl add-port br0 vlan201 tag=201 -- set interface vlan201 type=internal
The first command is the well known method for adding a new bridge. As an aside, a bridge in this context
would represent a switch, something which can deal with muliple vlans in the various access port and
trunk port roles. The second command is the way to add an 'internal' interface into Linux.
Ip addressing can be assigned interactively via something like:
ip addr add 10.11.1.20/24 dev vlan210
For persistance through boot cycles, the addresss should maintained in the
/etc/network/interfaces file through the standard iface stanzas.
An article at
blog.scottlowe.org
covers some trunking commands. The gist is that by using something like the following to set specifically which vlans are
available over a particular physical or tap port. I believe something like the following will work:
ovs-vsctl add-port br0 eth1 trunks=101,102
The trunks aspect can be added as a two step process:
ovs-vsctl add-port br0 eth1
ovs-vsctl set port eth1 trunks=101,102
The author of that same article goes on to explain the philosophy of the ovs-vsctl command structure: it is a structure
closely resembling the commands for updating the database. And when you do a list command, such as 'ovs-vsctl list port vlan201',
you obtain a list of keys which can be updated with specific values. And in actual fact, I just learned by reading a comment
at the end of the article, it is the
ovs-vswitchd.conf.db manual which
describes all the possible parameters and their values. The articles also has some interesting links for sFlow integration and even sFlow auto-configuration.
Some references regarding openvswitch: