summaryrefslogtreecommitdiff
path: root/tutorial
diff options
context:
space:
mode:
authorRussell Bryant <russell@ovn.org>2017-03-13 16:26:00 -0400
committerRussell Bryant <russell@ovn.org>2017-03-15 14:16:46 -0400
commit46a2dc58781a06799f7ec7d44f19db91e9850d43 (patch)
treec5f4e27a8cb66212294b942d9f9a7783e43cdf80 /tutorial
parenta98b700db617421e8b37c76a444be70bf3b05dba (diff)
downloadopenvswitch-46a2dc58781a06799f7ec7d44f19db91e9850d43.tar.gz
Document OVN support in ovs-sandbox.
A previous commit removed the original ovs-sandbox based OVN tutorial because it became too outdated and difficult to maintain. However, the use of ovs-sandbox for basic OVN development and testing is incredibly useful, so we should provide at least basic documentation on how to use it. This commit introduces a new and shorter document that shows how to use OVN in ovs-sandbox. It provides a single sample configuration, as well as a sample ovn-trace command. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Numan Siddique <nusiddiq@redhat.com>
Diffstat (limited to 'tutorial')
-rw-r--r--tutorial/automake.mk3
-rwxr-xr-xtutorial/ovn-setup.sh27
2 files changed, 29 insertions, 1 deletions
diff --git a/tutorial/automake.mk b/tutorial/automake.mk
index 9dea3b5c4..ce8415e1e 100644
--- a/tutorial/automake.mk
+++ b/tutorial/automake.mk
@@ -5,6 +5,7 @@ EXTRA_DIST += \
tutorial/t-stage1 \
tutorial/t-stage2 \
tutorial/t-stage3 \
- tutorial/t-stage4
+ tutorial/t-stage4 \
+ tutorial/ovn-setup.sh
sandbox: all
cd $(srcdir)/tutorial && MAKE=$(MAKE) ./ovs-sandbox -b $(abs_builddir) $(SANDBOXFLAGS)
diff --git a/tutorial/ovn-setup.sh b/tutorial/ovn-setup.sh
new file mode 100755
index 000000000..dc4c813b1
--- /dev/null
+++ b/tutorial/ovn-setup.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# Create the first logical switch with one port
+ovn-nbctl ls-add sw0
+ovn-nbctl lsp-add sw0 sw0-port1
+ovn-nbctl lsp-set-addresses sw0-port1 "50:54:00:00:00:01 192.168.0.2"
+
+# Create the second logical switch with one port
+ovn-nbctl ls-add sw1
+ovn-nbctl lsp-add sw1 sw1-port1
+ovn-nbctl lsp-set-addresses sw1-port1 "50:54:00:00:00:03 11.0.0.2"
+
+# Create a logical router and attach both logical switches
+ovn-nbctl lr-add lr0
+ovn-nbctl lrp-add lr0 lrp0 00:00:00:00:ff:01 192.168.0.1/24
+ovn-nbctl lsp-add sw0 lrp0-attachment
+ovn-nbctl lsp-set-type lrp0-attachment router
+ovn-nbctl lsp-set-addresses lrp0-attachment 00:00:00:00:ff:01
+ovn-nbctl lsp-set-options lrp0-attachment router-port=lrp0
+ovn-nbctl lrp-add lr0 lrp1 00:00:00:00:ff:02 11.0.0.1/24
+ovn-nbctl lsp-add sw1 lrp1-attachment
+ovn-nbctl lsp-set-type lrp1-attachment router
+ovn-nbctl lsp-set-addresses lrp1-attachment 00:00:00:00:ff:02
+ovn-nbctl lsp-set-options lrp1-attachment router-port=lrp1
+
+# View a summary of the configuration
+ovn-nbctl show