From bb8c2c420bca06c67deb05e9f63e101752110759 Mon Sep 17 00:00:00 2001 From: Joe Slater Date: Thu, 25 Apr 2013 09:30:49 -0700 Subject: openvswitch: functionality sanity test Instructions for creating a simple bridge that will take over eth0. You cannot be executing out of an nfs-mounted filesystem while setting up the bridge. Signed-off-by: Joe Slater Signed-off-by: Bruce Ashfield --- docs/vswitch_test.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 docs/vswitch_test.sh diff --git a/docs/vswitch_test.sh b/docs/vswitch_test.sh new file mode 100755 index 00000000..63168e38 --- /dev/null +++ b/docs/vswitch_test.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +# runqemu defaults for the first "guest" +# +my_inet4="192.168.7.2" +my_gw="192.168.7.1" + +# create a bridge +# +ovs-vsctl add-br br-int + +# Add a physical interface to your virtual bridge for connectivity off box. +# If your rootfs is nfs mounted (on eth0), you will die after attaching it +# to the bridge. +# +ovs-vsctl add-port br-int eth0 + +# Zero out your eth0 interface and slap it on the bridge interface. +# +ifconfig eth0 0 +ifconfig br-int ${my_inet4} netmask 255.255.255.0 + +# Change your default route. If you don't do this, nothing will +# be reachable. +# +route add default gw ${my_gw} br-int + +(You can then check that the connection works.) + +# The bridge configuration is persistant, so if something goes wrong +# and you reboot, it will still be messed up. Destroy the bridge, +# then add a route, or reboot. +# +ovs-vsctl del-br br-int +ifconfig eth0 ${my_inet4} +route add default gw ${my_gw} eth0 -- cgit v1.2.3-54-g00ecf