summaryrefslogtreecommitdiff
path: root/tutorial/ovn/env3/setup.sh
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2015-10-01 14:26:26 -0400
committerBen Pfaff <blp@nicira.com>2015-10-02 08:04:36 -0700
commit9107431f3f9d9d57c8aed95fa5a115e878894d07 (patch)
treed4cdee99febfae4a90a52faac48677346c75d657 /tutorial/ovn/env3/setup.sh
parent779e72cc57a106251cc9e6696e8c9aabb56d30b5 (diff)
downloadopenvswitch-9107431f3f9d9d57c8aed95fa5a115e878894d07.tar.gz
ovn: Add an ovs-sandbox based OVN tutorial.
While working on OVN and OVN integration, I've collected a set of scripts for quickly setting up simple test environments using ovs-sandbox with OVN enabled. It seemed like they could be useful to others for learning about OVN or doing quick testing. This patch introduces an ovs-sandbox based tutorial for exploring OVN features in a simulated environment. Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'tutorial/ovn/env3/setup.sh')
-rwxr-xr-xtutorial/ovn/env3/setup.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/tutorial/ovn/env3/setup.sh b/tutorial/ovn/env3/setup.sh
new file mode 100755
index 000000000..b554d257a
--- /dev/null
+++ b/tutorial/ovn/env3/setup.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set -o xtrace
+
+ovn-nbctl lswitch-add sw0
+
+ovn-nbctl lport-add sw0 sw0-port1
+ovn-nbctl lport-add sw0 sw0-port2
+ovn-nbctl lport-add sw0 sw0-port3
+ovn-nbctl lport-add sw0 sw0-port4
+
+ovn-nbctl lport-set-macs sw0-port1 00:00:00:00:00:01
+ovn-nbctl lport-set-macs sw0-port2 00:00:00:00:00:02
+ovn-nbctl lport-set-macs sw0-port3 00:00:00:00:00:03
+ovn-nbctl lport-set-macs sw0-port4 00:00:00:00:00:04
+
+ovn-nbctl lport-set-port-security sw0-port1 00:00:00:00:00:01
+ovn-nbctl lport-set-port-security sw0-port2 00:00:00:00:00:02
+ovn-nbctl lport-set-port-security sw0-port3 00:00:00:00:00:03
+ovn-nbctl lport-set-port-security sw0-port4 00:00:00:00:00:04
+
+# Bind sw0-port1 and sw0-port2 to the local chassis
+ovs-vsctl add-port br-int lport1 -- set Interface lport1 external_ids:iface-id=sw0-port1
+ovs-vsctl add-port br-int lport2 -- set Interface lport2 external_ids:iface-id=sw0-port2
+
+# Create a fake remote chassis.
+ovn-sbctl chassis-add fakechassis geneve 127.0.0.1
+
+# Bind sw0-port3 and sw0-port4 to the fake remote chassis.
+ovn-sbctl lport-bind sw0-port3 fakechassis
+ovn-sbctl lport-bind sw0-port4 fakechassis