]> git.proxmox.com Git - mirror_ovs.git/blob - tutorial/ovn-setup.sh
Document OVN support in ovs-sandbox.
[mirror_ovs.git] / tutorial / ovn-setup.sh
1 #!/bin/bash
2
3 # Create the first logical switch with one port
4 ovn-nbctl ls-add sw0
5 ovn-nbctl lsp-add sw0 sw0-port1
6 ovn-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
9 ovn-nbctl ls-add sw1
10 ovn-nbctl lsp-add sw1 sw1-port1
11 ovn-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
14 ovn-nbctl lr-add lr0
15 ovn-nbctl lrp-add lr0 lrp0 00:00:00:00:ff:01 192.168.0.1/24
16 ovn-nbctl lsp-add sw0 lrp0-attachment
17 ovn-nbctl lsp-set-type lrp0-attachment router
18 ovn-nbctl lsp-set-addresses lrp0-attachment 00:00:00:00:ff:01
19 ovn-nbctl lsp-set-options lrp0-attachment router-port=lrp0
20 ovn-nbctl lrp-add lr0 lrp1 00:00:00:00:ff:02 11.0.0.1/24
21 ovn-nbctl lsp-add sw1 lrp1-attachment
22 ovn-nbctl lsp-set-type lrp1-attachment router
23 ovn-nbctl lsp-set-addresses lrp1-attachment 00:00:00:00:ff:02
24 ovn-nbctl lsp-set-options lrp1-attachment router-port=lrp1
25
26 # View a summary of the configuration
27 ovn-nbctl show