2 Licensed under the Apache License, Version 2.0 (the "License"); you may
3 not use this file except in compliance with the License. You may obtain
4 a copy of the License at
6 http://www.apache.org/licenses/LICENSE-2.0
8 Unless required by applicable law or agreed to in writing, software
9 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 License for the specific language governing permissions and limitations
14 Convention for heading levels in Open vSwitch documentation:
16 ======= Heading 0 (reserved for the title in a document)
22 Avoid deeper levels because they do not render well.
24 ==========================================
25 Native Tunneling in Open vSwitch Userspace
26 ==========================================
28 Open vSwitch supports tunneling in userspace. Tunneling is implemented in
29 a platform-independent way.
34 Setup physical bridges for all physical interfaces. Create integration bridge.
35 Add VXLAN port to int-bridge. Assign IP address to physical bridge where
36 VXLAN traffic is expected.
41 Connect to VXLAN tunnel endpoint logical IP: ``192.168.1.2`` and
44 Configure OVS bridges as follows.
46 1. Let's assume ``172.168.1.2/24`` network is reachable via ``eth1``. Create
47 physical bridge ``br-eth1``. Assign IP address (``172.168.1.1/24``) to
48 ``br-eth1``. Add ``eth1`` to ``br-eth1``.
50 2. Check ovs cached routes using appctl command.
54 $ ovs-appctl ovs/route/show
56 Add tunnel route if not present in OVS route table.
60 $ ovs-appctl ovs/route/add 172.168.1.1/24 br-eth1
62 3. Add integration bridge ``int-br`` and add tunnel port using standard syntax.
66 $ ovs-vsctl add-port int-br vxlan0 \
67 -- set interface vxlan0 type=vxlan options:remote_ip=172.168.1.2
69 4. Assign IP address to ``int-br``.
71 The final topology should looks like so:
79 | int-br | 192.168.1.2/24
80 +--------------+ +--------------+
82 +--------------+ +--------------+
88 | br-eth1 | 172.168.1.2/24
89 +--------------+ +---------------+
90 | eth1 |----------------------------------| eth1 |
91 +--------------+ +---------------+
93 Host A with OVS. Remote host.
95 With this setup, ping to VXLAN target device (``192.168.1.2``) should work.
97 Tunneling-related Commands
98 --------------------------
107 $ ovs-appctl ovs/route/add <IP address>/<prefix length> <output-bridge-name> <gw>
109 To see all routes configured:
113 $ ovs-appctl ovs/route/show
119 $ ovs-appctl ovs/route/del <IP address>/<prefix length>
121 To look up and display the route for a destination:
125 $ ovs-appctl ovs/route/lookup <IP address>
130 To see arp cache content:
134 $ ovs-appctl tnl/arp/show
140 $ ovs-appctl tnl/arp/flush
145 To check tunnel ports listening in ovs-vswitchd:
149 $ ovs-appctl tnl/ports/show
151 To set range for VxLan UDP source port:
155 $ ovs-appctl tnl/egress_port_range <num1> <num2>
157 To show current range:
161 $ ovs-appctl tnl/egress_port_range
166 To check datapath ports:
170 $ ovs-appctl dpif/show
172 To check datapath flows:
176 $ ovs-appctl dpif/dump-flows