diff options
author | Joe Slater <jslater@windriver.com> | 2013-04-25 09:30:49 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-04-28 00:14:17 -0400 |
commit | bb8c2c420bca06c67deb05e9f63e101752110759 (patch) | |
tree | 931b78572145f094ee86e3f017c33de5dc71097c /docs | |
parent | 15a0d3432ea8d4441417b689a58aae8a6a7fb860 (diff) | |
download | meta-virtualization-bb8c2c420bca06c67deb05e9f63e101752110759.tar.gz |
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 <jslater@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'docs')
-rwxr-xr-x | docs/vswitch_test.sh | 36 |
1 files changed, 36 insertions, 0 deletions
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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # runqemu defaults for the first "guest" | ||
4 | # | ||
5 | my_inet4="192.168.7.2" | ||
6 | my_gw="192.168.7.1" | ||
7 | |||
8 | # create a bridge | ||
9 | # | ||
10 | ovs-vsctl add-br br-int | ||
11 | |||
12 | # Add a physical interface to your virtual bridge for connectivity off box. | ||
13 | # If your rootfs is nfs mounted (on eth0), you will die after attaching it | ||
14 | # to the bridge. | ||
15 | # | ||
16 | ovs-vsctl add-port br-int eth0 | ||
17 | |||
18 | # Zero out your eth0 interface and slap it on the bridge interface. | ||
19 | # | ||
20 | ifconfig eth0 0 | ||
21 | ifconfig br-int ${my_inet4} netmask 255.255.255.0 | ||
22 | |||
23 | # Change your default route. If you don't do this, nothing will | ||
24 | # be reachable. | ||
25 | # | ||
26 | route add default gw ${my_gw} br-int | ||
27 | |||
28 | (You can then check that the connection works.) | ||
29 | |||
30 | # The bridge configuration is persistant, so if something goes wrong | ||
31 | # and you reboot, it will still be messed up. Destroy the bridge, | ||
32 | # then add a route, or reboot. | ||
33 | # | ||
34 | ovs-vsctl del-br br-int | ||
35 | ifconfig eth0 ${my_inet4} | ||
36 | route add default gw ${my_gw} eth0 | ||