]>
Commit | Line | Data |
---|---|---|
5273d85f SF |
1 | .. |
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 | |
5 | ||
6 | http://www.apache.org/licenses/LICENSE-2.0 | |
7 | ||
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 | |
12 | under the License. | |
13 | ||
14 | Convention for heading levels in Open vSwitch documentation: | |
15 | ||
16 | ======= Heading 0 (reserved for the title in a document) | |
17 | ------- Heading 1 | |
18 | ~~~~~~~ Heading 2 | |
19 | +++++++ Heading 3 | |
20 | ''''''' Heading 4 | |
21 | ||
22 | Avoid deeper levels because they do not render well. | |
23 | ||
24 | ========================================== | |
25 | Native Tunneling in Open vSwitch Userspace | |
26 | ========================================== | |
27 | ||
28 | Open vSwitch supports tunneling in userspace. Tunneling is implemented in | |
29 | a platform-independent way. | |
30 | ||
31 | Setup | |
32 | ----- | |
33 | ||
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. | |
37 | ||
38 | Example | |
39 | ------- | |
40 | ||
41 | Connect to VXLAN tunnel endpoint logical IP: ``192.168.1.2`` and | |
42 | ``192.168.1.1``. | |
43 | ||
44 | Configure OVS bridges as follows. | |
45 | ||
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``. | |
49 | ||
50 | 2. Check ovs cached routes using appctl command. | |
51 | ||
52 | :: | |
53 | ||
54 | $ ovs-appctl ovs/route/show | |
55 | ||
56 | Add tunnel route if not present in OVS route table. | |
57 | ||
58 | :: | |
59 | ||
60 | $ ovs-appctl ovs/route/add 172.168.1.1/24 br-eth1 | |
61 | ||
62 | 3. Add integration bridge ``int-br`` and add tunnel port using standard syntax. | |
63 | ||
64 | :: | |
65 | ||
66 | $ ovs-vsctl add-port int-br vxlan0 \ | |
67 | -- set interface vxlan0 type=vxlan options:remote_ip=172.168.1.2 | |
68 | ||
69 | 4. Assign IP address to ``int-br``. | |
70 | ||
71 | The final topology should looks like so: | |
72 | ||
73 | :: | |
74 | ||
75 | Diagram | |
76 | ||
77 | 192.168.1.1/24 | |
78 | +--------------+ | |
79 | | int-br | 192.168.1.2/24 | |
80 | +--------------+ +--------------+ | |
81 | | vxlan0 | | vxlan0 | | |
82 | +--------------+ +--------------+ | |
83 | | | | |
84 | | | | |
85 | | | | |
86 | 172.168.1.1/24 | | |
87 | +--------------+ | | |
88 | | br-eth1 | 172.168.1.2/24 | |
89 | +--------------+ +---------------+ | |
90 | | eth1 |----------------------------------| eth1 | | |
91 | +--------------+ +---------------+ | |
92 | ||
93 | Host A with OVS. Remote host. | |
94 | ||
95 | With this setup, ping to VXLAN target device (``192.168.1.2``) should work. | |
96 | ||
97 | Tunneling-related Commands | |
98 | -------------------------- | |
99 | ||
100 | Tunnel routing table | |
101 | ~~~~~~~~~~~~~~~~~~~~ | |
102 | ||
103 | To add route: | |
104 | ||
105 | :: | |
106 | ||
107 | $ ovs-appctl ovs/route/add <IP address>/<prefix length> <output-bridge-name> <gw> | |
108 | ||
109 | To see all routes configured: | |
110 | ||
111 | :: | |
112 | ||
113 | $ ovs-appctl ovs/route/show | |
114 | ||
115 | To delete route: | |
116 | ||
117 | :: | |
118 | ||
119 | $ ovs-appctl ovs/route/del <IP address>/<prefix length> | |
120 | ||
121 | To look up and display the route for a destination: | |
122 | ||
123 | :: | |
124 | ||
125 | $ ovs-appctl ovs/route/lookup <IP address> | |
126 | ||
127 | ARP | |
128 | ~~~ | |
129 | ||
130 | To see arp cache content: | |
131 | ||
132 | :: | |
133 | ||
134 | $ ovs-appctl tnl/arp/show | |
135 | ||
136 | To flush arp cache: | |
137 | ||
138 | :: | |
139 | ||
140 | $ ovs-appctl tnl/arp/flush | |
141 | ||
142 | Ports | |
143 | ~~~~~ | |
144 | ||
145 | To check tunnel ports listening in ovs-vswitchd: | |
146 | ||
147 | :: | |
148 | ||
149 | $ ovs-appctl tnl/ports/show | |
150 | ||
151 | To set range for VxLan UDP source port: | |
152 | ||
153 | :: | |
154 | ||
155 | $ ovs-appctl tnl/egress_port_range <num1> <num2> | |
156 | ||
157 | To show current range: | |
158 | ||
159 | :: | |
160 | ||
161 | $ ovs-appctl tnl/egress_port_range | |
162 | ||
163 | Datapath | |
164 | ~~~~~~~~ | |
165 | ||
166 | To check datapath ports: | |
167 | ||
168 | :: | |
169 | ||
170 | $ ovs-appctl dpif/show | |
171 | ||
172 | To check datapath flows: | |
173 | ||
174 | :: | |
175 | ||
176 | $ ovs-appctl dpif/dump-flows |