XEN networking on Slackware

assuming you went through xen from scratch

Linux Bridge

cp -i /etc/xen/xl.conf /etc/xen/xl.conf.dist
vi /etc/xen/xl.conf

#autoballoon="auto"
vif.default.bridge="xenbr0"
vif.default.script="vif-bridge"

OpenvSwitch (and SDN)

sbopkg -i openvswitch-utils
#less /usr/doc/openvswitch-utils-2.5.0/README.SLACKWARE
chmod +x /etc/rc.d/rc.openvswitch

to start it for the first time (not sure we should clean the db at starting… this is not totally rc.inet1 start ready),

#self verbose
#/etc/rc.d/rc.openvswitch start
#/etc/rc.d/rc.openvswitch stop
/etc/rc.d/rc.openvswitch clean-database
/etc/rc.d/rc.openvswitch start-clean

echo -n ovs bridge xenbr0...
ovs-vsctl add-br xenbr0
ovs-vsctl add-port xenbr0 eth0
ip addr flush dev eth0
ip addr add x.x.x.x/xx dev xenbr0
ip link set xenbr0 up
ip link set eth0 up && echo done
#ovs-vsctl set-controller xenbr0 tcp:x.x.x.x:6633

echo -n ovs bridge pubbr0...
ovs-vsctl add-br pubbr0
ovs-vsctl add-port pubbr0 eth1
ip addr flush dev eth1
ip link set pubbr0 up
ip link set eth1 up && echo done
ovs-vsctl set-controller pubbr0 tcp:x.x.x.x:6633

echo ''
ovs-vsctl show
echo ''

echo -n default route...
route add default gw x.x.x.x && echo done

and to shut it down maybe simply (rc.inet1 stop),

ifconfig eth0 down
ifconfig xenbr0 down
ifconfig eth1 down
ifconfig pubbr0 down
#self verbose
/etc/rc.d/rc.openvswitch stop

and do not forget to switch XEN bridge to Open vSwitch,

cp -pi /etc/xen/xl.conf /etc/xen/xl.conf.dist
vi /etc/xen/xl.conf

vif.default.script="vif-openvswitch"

Enabling LACP,

ovs-vsctl add-bond xenbr0 bond0 eth0 eth2 eth3 lacp=active
#ovs-vsctl set port bond0 lacp=active

eventually add this to your env,

alias ovs='ovs-vsctl'

Resources

linux bridge

Bridging Network Connections https://wiki.debian.org/BridgeNetworkConnections

http://www.microhowto.info/troubleshooting/troubleshooting_ethernet_bridging_on_linux.html

Bridge not working https://unix.stackexchange.com/questions/48265/bridge-not-working

VLANs

KVM & BRCTL in Linux – bringing VLANs to the guests http://blog.davidvassallo.me/2012/05/05/kvm-brctl-in-linux-bringing-vlans-to-the-guests/

http://ceyes.github.io/2014-07/add-vlan-tag-through-bridge/

trunk + bridge

openvswitch

Link Aggregation and LACP with Open vSwitch https://blog.scottlowe.org/2012/10/19/link-aggregation-and-lacp-with-open-vswitch/

Trash

in case Netfilter is enabled, you might have to e.g.,

#iptables -A FORWARD -i virbr0 -o eno1 -j ACCEPT
#iptables -A FORWARD -i eno1 -o virbr0 -m state --state RELATED,ESTABLISHED -j ACCEPT
#iptables -t nat -A POSTROUTING -o eno1 -j MASQUERADE

Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml