3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
18 # create a logical switch
21 # create a container port with parent set to sw0-port1
22 ovn-nbctl lsp-add csw0 csw0-cport1 sw0-port1
42
23 ovn-nbctl lsp-set-addresses csw0-cport1
00:00:00:00:01:01
24 ovn-nbctl lsp-set-port-security csw0-cport1
00:00:00:00:01:01
26 # create another container port with parent set to sw0-port1
27 ovn-nbctl lsp-add csw0 csw0-cport2 sw0-port2
43
28 ovn-nbctl lsp-set-addresses csw0-cport2
00:00:00:00:01:02
29 ovn-nbctl lsp-set-port-security csw0-cport2
00:00:00:00:01:02
32 # Make lport1 as a patch port, other end connected to br-vmport1
33 ovs-vsctl
set interface lport1
type=patch
34 ovs-vsctl
set interface lport1 options
:peer
=patch-lport1
36 ovs-vsctl
set interface lport2
type=patch
37 ovs-vsctl
set interface lport2 options
:peer
=patch-lport2
40 # This represents ovs bridge inside a VM attached to lport1
41 ovs-vsctl add-br br-vmport1
43 # create a patch port with peer set to lport1.
44 ovs-vsctl add-port br-vmport1 patch-lport1
45 ovs-vsctl
set interface patch-lport1
type=patch
46 ovs-vsctl
set interface patch-lport1 options
:peer
=lport1
48 # create a container port on br-vmport1. Any traffic sent on this
49 # port will reach to the br-int of the host via the patch port
50 ovs-vsctl add-port br-vmport1 cport1
51 ovs-vsctl
set port cport1 tag
=42
53 # This represents ovs bridge inside a VM attached to lport2
54 ovs-vsctl add-br br-vmport2
55 ovs-vsctl add-port br-vmport2 patch-lport2
56 ovs-vsctl
set interface patch-lport2
type=patch
57 ovs-vsctl
set interface patch-lport2 options
:peer
=lport2
59 ovs-vsctl add-port br-vmport2 cport2
60 ovs-vsctl
set port cport2 tag
=43