blob: e99a1435920ed0c1273672bea77e0b5b566bf93c [file] [log] [blame]
Sean M. Collins34296012014-10-27 11:57:20 -04001======================================
Shilla Saebi2ed09d82015-04-21 15:02:13 -04002Using DevStack with neutron Networking
Sean M. Collins34296012014-10-27 11:57:20 -04003======================================
4
Shilla Saebi2ed09d82015-04-21 15:02:13 -04005This guide will walk you through using OpenStack neutron with the ML2
Sean M. Collins34296012014-10-27 11:57:20 -04006plugin and the Open vSwitch mechanism driver.
7
Sean M. Collins34296012014-10-27 11:57:20 -04008
Sean M. Collins02ae50d2015-03-20 09:58:55 -07009Using Neutron with a Single Interface
10=====================================
11
12In some instances, like on a developer laptop, there is only one
13network interface that is available. In this scenario, the physical
14interface is added to the Open vSwitch bridge, and the IP address of
15the laptop is migrated onto the bridge interface. That way, the
16physical interface can be used to transmit tenant network traffic,
17the OpenStack API traffic, and management traffic.
18
19
20Physical Network Setup
21----------------------
22
23In most cases where DevStack is being deployed with a single
24interface, there is a hardware router that is being used for external
25connectivity and DHCP. The developer machine is connected to this
26network and is on a shared subnet with other machines.
27
28.. nwdiag::
29
30 nwdiag {
31 inet [ shape = cloud ];
32 router;
33 inet -- router;
34
35 network hardware_network {
36 address = "172.18.161.0/24"
37 router [ address = "172.18.161.1" ];
38 devstack_laptop [ address = "172.18.161.6" ];
39 }
40 }
41
42
43DevStack Configuration
44----------------------
45
46
47::
48
49 HOST_IP=172.18.161.6
50 SERVICE_HOST=172.18.161.6
51 MYSQL_HOST=172.18.161.6
52 RABBIT_HOST=172.18.161.6
53 GLANCE_HOSTPORT=172.18.161.6:9292
54 ADMIN_PASSWORD=secrete
Swapnil (coolsvap) Kulkarnic988bf62015-10-08 13:10:43 +053055 DATABASE_PASSWORD=secrete
Sean M. Collins02ae50d2015-03-20 09:58:55 -070056 RABBIT_PASSWORD=secrete
57 SERVICE_PASSWORD=secrete
58 SERVICE_TOKEN=secrete
59
60 ## Neutron options
61 Q_USE_SECGROUP=True
Christian Berendt1c394822015-09-10 12:15:16 +020062 FLOATING_RANGE="172.18.161.0/24"
Sean M. Collins02ae50d2015-03-20 09:58:55 -070063 FIXED_RANGE="10.0.0.0/24"
64 Q_FLOATING_ALLOCATION_POOL=start=172.18.161.250,end=172.18.161.254
65 PUBLIC_NETWORK_GATEWAY="172.18.161.1"
66 Q_L3_ENABLED=True
67 PUBLIC_INTERFACE=eth0
68 Q_USE_PROVIDERNET_FOR_PUBLIC=True
69 OVS_PHYSICAL_BRIDGE=br-ex
70 PUBLIC_BRIDGE=br-ex
71 OVS_BRIDGE_MAPPINGS=public:br-ex
72
73
74
75
76
77Using Neutron with Multiple Interfaces
78======================================
Sean M. Collins34296012014-10-27 11:57:20 -040079
80The first interface, eth0 is used for the OpenStack management (API,
81message bus, etc) as well as for ssh for an administrator to access
82the machine.
83
84::
85
86 stack@compute:~$ ifconfig eth0
87 eth0 Link encap:Ethernet HWaddr bc:16:65:20:af:fc
88 inet addr:192.168.1.18
89
90eth1 is manually configured at boot to not have an IP address.
91Consult your operating system documentation for the appropriate
Juan Antonio Osorio Roblesb7c1ce42014-11-28 14:19:19 +020092technique. For Ubuntu, the contents of `/etc/network/interfaces`
Sean M. Collins34296012014-10-27 11:57:20 -040093contains:
94
95::
96
97 auto eth1
98 iface eth1 inet manual
99 up ifconfig $IFACE 0.0.0.0 up
100 down ifconfig $IFACE 0.0.0.0 down
101
102The second physical interface, eth1 is added to a bridge (in this case
103named br-ex), which is used to forward network traffic from guest VMs.
104Network traffic from eth1 on the compute nodes is then NAT'd by the
105controller node that runs Neutron's `neutron-l3-agent` and provides L3
106connectivity.
107
108::
109
110 stack@compute:~$ sudo ovs-vsctl add-br br-ex
111 stack@compute:~$ sudo ovs-vsctl add-port br-ex eth1
112 stack@compute:~$ sudo ovs-vsctl show
113 9a25c837-32ab-45f6-b9f2-1dd888abcf0f
114 Bridge br-ex
115 Port br-ex
116 Interface br-ex
117 type: internal
118 Port phy-br-ex
119 Interface phy-br-ex
120 type: patch
121 options: {peer=int-br-ex}
122 Port "eth1"
123 Interface "eth1"
124
125
126
127
Steven Dake3a6b1282014-12-31 14:27:22 -0700128
Sean M. Collins34296012014-10-27 11:57:20 -0400129Neutron Networking with Open vSwitch
130====================================
131
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400132Configuring neutron, OpenStack Networking in DevStack is very similar to
Sean M. Collins34296012014-10-27 11:57:20 -0400133configuring `nova-network` - many of the same configuration variables
134(like `FIXED_RANGE` and `FLOATING_RANGE`) used by `nova-network` are
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400135used by neutron, which is intentional.
Sean M. Collins34296012014-10-27 11:57:20 -0400136
137The only difference is the disabling of `nova-network` in your
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400138local.conf, and the enabling of the neutron components.
Sean M. Collins34296012014-10-27 11:57:20 -0400139
140
141Configuration
142-------------
143
144::
145
146 FIXED_RANGE=10.0.0.0/24
147 FLOATING_RANGE=192.168.27.0/24
148 PUBLIC_NETWORK_GATEWAY=192.168.27.2
149
150 disable_service n-net
151 enable_service q-svc
152 enable_service q-agt
153 enable_service q-dhcp
154 enable_service q-meta
155 enable_service q-l3
156
157 Q_USE_SECGROUP=True
158 ENABLE_TENANT_VLANS=True
159 TENANT_VLAN_RANGE=1000:1999
160 PHYSICAL_NETWORK=default
161 OVS_PHYSICAL_BRIDGE=br-ex
162
163In this configuration we are defining FLOATING_RANGE to be a
164subnet that exists in the private RFC1918 address space - however in
165in a real setup FLOATING_RANGE would be a public IP address range.
166
167Neutron Networking with Open vSwitch and Provider Networks
168==========================================================
169
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400170In some instances, it is desirable to use neutron's provider
Sean M. Collins34296012014-10-27 11:57:20 -0400171networking extension, so that networks that are configured on an
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400172external router can be utilized by neutron, and instances created via
Sean M. Collins34296012014-10-27 11:57:20 -0400173Nova can attach to the network managed by the external router.
174
175For example, in some lab environments, a hardware router has been
176pre-configured by another party, and an OpenStack developer has been
177given a VLAN tag and IP address range, so that instances created via
178DevStack will use the external router for L3 connectivity, as opposed
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400179to the neutron L3 service.
Sean M. Collins34296012014-10-27 11:57:20 -0400180
Sean M. Collins4696db92015-10-09 12:31:57 -0400181Physical Network Setup
182----------------------
183
184.. nwdiag::
185
186 nwdiag {
187 inet [ shape = cloud ];
188 router;
189 inet -- router;
190
191 network provider_net {
192 address = "203.0.113.0/24"
193 router [ address = "203.0.113.1" ];
194 controller;
195 compute1;
196 compute2;
197 }
198
199 network control_plane {
200 router [ address = "10.0.0.1" ]
201 address = "10.0.0.0/24"
202 controller [ address = "10.0.0.2" ]
203 compute1 [ address = "10.0.0.3" ]
204 compute2 [ address = "10.0.0.4" ]
205 }
206 }
207
208
Sean M. Collins34296012014-10-27 11:57:20 -0400209
210Service Configuration
211---------------------
212
213**Control Node**
214
215In this example, the control node will run the majority of the
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400216OpenStack API and management services (keystone, glance,
217nova, neutron)
Sean M. Collins34296012014-10-27 11:57:20 -0400218
219
220**Compute Nodes**
221
222In this example, the nodes that will host guest instances will run
223the `neutron-openvswitch-agent` for network connectivity, as well as
224the compute service `nova-compute`.
225
226DevStack Configuration
227----------------------
228
229The following is a snippet of the DevStack configuration on the
230controller node.
231
232::
233
Sean M. Collins611cab42015-10-09 12:54:32 -0400234 HOST_IP=10.0.0.2
235 SERVICE_HOST=10.0.0.2
236 MYSQL_HOST=10.0.0.2
237 SERVICE_HOST=10.0.0.2
238 MYSQL_HOST=10.0.0.2
239 RABBIT_HOST=10.0.0.2
240 GLANCE_HOSTPORT=10.0.0.2:9292
Sean M. Collins34296012014-10-27 11:57:20 -0400241 PUBLIC_INTERFACE=eth1
242
Sean M. Collins611cab42015-10-09 12:54:32 -0400243 ADMIN_PASSWORD=secrete
244 MYSQL_PASSWORD=secrete
245 RABBIT_PASSWORD=secrete
246 SERVICE_PASSWORD=secrete
247 SERVICE_TOKEN=secrete
248
Sean M. Collins34296012014-10-27 11:57:20 -0400249 ## Neutron options
250 Q_USE_SECGROUP=True
251 ENABLE_TENANT_VLANS=True
252 TENANT_VLAN_RANGE=3001:4000
253 PHYSICAL_NETWORK=default
254 OVS_PHYSICAL_BRIDGE=br-ex
255
256 Q_USE_PROVIDER_NETWORKING=True
257 Q_L3_ENABLED=False
258
259 # Do not use Nova-Network
260 disable_service n-net
261
262 # Neutron
263 ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt
264
265 ## Neutron Networking options used to create Neutron Subnets
266
Sean M. Collinsd72b8392015-06-18 12:40:09 -0400267 FIXED_RANGE="203.0.113.0/24"
Sean M. Collins34296012014-10-27 11:57:20 -0400268 PROVIDER_SUBNET_NAME="provider_net"
269 PROVIDER_NETWORK_TYPE="vlan"
270 SEGMENTATION_ID=2010
271
272In this configuration we are defining FIXED_RANGE to be a
Sean M. Collinsd72b8392015-06-18 12:40:09 -0400273publicly routed IPv4 subnet. In this specific instance we are using
274the special TEST-NET-3 subnet defined in `RFC 5737 <http://tools.ietf.org/html/rfc5737>`_,
275which is used for documentation. In your DevStack setup, FIXED_RANGE
276would be a public IP address range that you or your organization has
277allocated to you, so that you could access your instances from the
278public internet.
Sean M. Collins34296012014-10-27 11:57:20 -0400279
Sean M. Collins611cab42015-10-09 12:54:32 -0400280The following is the DevStack configuration on
281compute node 1.
Sean M. Collins34296012014-10-27 11:57:20 -0400282
283::
284
Sean M. Collins611cab42015-10-09 12:54:32 -0400285 HOST_IP=10.0.0.3
286 SERVICE_HOST=10.0.0.2
287 MYSQL_HOST=10.0.0.2
288 SERVICE_HOST=10.0.0.2
289 MYSQL_HOST=10.0.0.2
290 RABBIT_HOST=10.0.0.2
291 GLANCE_HOSTPORT=10.0.0.2:9292
292 ADMIN_PASSWORD=secrete
293 MYSQL_PASSWORD=secrete
294 RABBIT_PASSWORD=secrete
295 SERVICE_PASSWORD=secrete
296 SERVICE_TOKEN=secrete
297
Sean M. Collins34296012014-10-27 11:57:20 -0400298 # Services that a compute node runs
299 ENABLED_SERVICES=n-cpu,rabbit,q-agt
300
301 ## Neutron options
Sean M. Collins34296012014-10-27 11:57:20 -0400302 PHYSICAL_NETWORK=default
303 OVS_PHYSICAL_BRIDGE=br-ex
304 PUBLIC_INTERFACE=eth1
305 Q_USE_PROVIDER_NETWORKING=True
306 Q_L3_ENABLED=False
307
Sean M. Collins611cab42015-10-09 12:54:32 -0400308Compute node 2's configuration will be exactly the same, except
309`HOST_IP` will be `10.0.0.4`
310
Sean M. Collins34296012014-10-27 11:57:20 -0400311When DevStack is configured to use provider networking (via
312`Q_USE_PROVIDER_NETWORKING` is True and `Q_L3_ENABLED` is False) -
313DevStack will automatically add the network interface defined in
314`PUBLIC_INTERFACE` to the `OVS_PHYSICAL_BRIDGE`
315
316For example, with the above configuration, a bridge is
317created, named `br-ex` which is managed by Open vSwitch, and the
318second interface on the compute node, `eth1` is attached to the
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400319bridge, to forward traffic sent by guest VMs.
Sean M. Collins872a2622015-10-06 12:45:06 -0400320
321Miscellaneous Tips
322==================
323
324
325Disabling Next Generation Firewall Tools
326----------------------------------------
327
328DevStack does not properly operate with modern firewall tools. Specifically
329it will appear as if the guest VM can access the external network via ICMP,
330but UDP and TCP packets will not be delivered to the guest VM. The root cause
331of the issue is that both ufw (Uncomplicated Firewall) and firewalld (Fedora's
332firewall manager) apply firewall rules to all interfaces in the system, rather
333then per-device. One solution to this problem is to revert to iptables
334functionality.
335
336To get a functional firewall configuration for Fedora do the following:
337
338::
339
340 sudo service iptables save
341 sudo systemctl disable firewalld
342 sudo systemctl enable iptables
343 sudo systemctl stop firewalld
344 sudo systemctl start iptables
345
346
347To get a functional firewall configuration for distributions containing ufw,
348disable ufw. Note ufw is generally not enabled by default in Ubuntu. To
349disable ufw if it was enabled, do the following:
350
351::
352
353 sudo service iptables save
354 sudo ufw disable
355
Sean M. Collinsd8aa10e2015-10-09 12:21:30 -0400356Configuring Extension Drivers for the ML2 Plugin
357------------------------------------------------
Sean M. Collins872a2622015-10-06 12:45:06 -0400358
Sean M. Collinsd8aa10e2015-10-09 12:21:30 -0400359Extension drivers for the ML2 plugin are set with the variable
360`Q_ML2_PLUGIN_EXT_DRIVERS`, and includes the 'port_security' extension
361by default. If you want to remove all the extension drivers (even
362'port_security'), set `Q_ML2_PLUGIN_EXT_DRIVERS` to blank.
Sean M. Collins872a2622015-10-06 12:45:06 -0400363