]> git.proxmox.com Git - ovs.git/blame - tutorial/ovn-setup.sh
flow: Fix uninitialized flow fields in IPv6 error case.
[ovs.git] / tutorial / ovn-setup.sh
CommitLineData
46a2dc58
RB
1#!/bin/bash
2
3# Create the first logical switch with one port
4ovn-nbctl ls-add sw0
5ovn-nbctl lsp-add sw0 sw0-port1
6ovn-nbctl lsp-set-addresses sw0-port1 "50:54:00:00:00:01 192.168.0.2"
7
8# Create the second logical switch with one port
9ovn-nbctl ls-add sw1
10ovn-nbctl lsp-add sw1 sw1-port1
11ovn-nbctl lsp-set-addresses sw1-port1 "50:54:00:00:00:03 11.0.0.2"
12
13# Create a logical router and attach both logical switches
14ovn-nbctl lr-add lr0
15ovn-nbctl lrp-add lr0 lrp0 00:00:00:00:ff:01 192.168.0.1/24
16ovn-nbctl lsp-add sw0 lrp0-attachment
17ovn-nbctl lsp-set-type lrp0-attachment router
18ovn-nbctl lsp-set-addresses lrp0-attachment 00:00:00:00:ff:01
19ovn-nbctl lsp-set-options lrp0-attachment router-port=lrp0
20ovn-nbctl lrp-add lr0 lrp1 00:00:00:00:ff:02 11.0.0.1/24
21ovn-nbctl lsp-add sw1 lrp1-attachment
22ovn-nbctl lsp-set-type lrp1-attachment router
23ovn-nbctl lsp-set-addresses lrp1-attachment 00:00:00:00:ff:02
24ovn-nbctl lsp-set-options lrp1-attachment router-port=lrp1
25
0b31b69f
RB
26ovs-vsctl add-port br-int p1 -- \
27 set Interface p1 external_ids:iface-id=sw0-port1
28ovs-vsctl add-port br-int p2 -- \
29 set Interface p2 external_ids:iface-id=sw1-port1
30
46a2dc58 31# View a summary of the configuration
0b31b69f 32printf "\n=== ovn-nbctl show ===\n\n"
46a2dc58 33ovn-nbctl show
e8663e53 34printf "\n=== ovn-nbctl show with wait hv ===\n\n"
35ovn-nbctl --wait=hv show
0b31b69f
RB
36printf "\n=== ovn-sbctl show ===\n\n"
37ovn-sbctl show