blob: c7a115360809b6163ed920924369490b223156de [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
Sean M. Collins34296012014-10-27 11:57:20 -040075Neutron Networking with Open vSwitch and Provider Networks
76==========================================================
77
Shilla Saebi2ed09d82015-04-21 15:02:13 -040078In some instances, it is desirable to use neutron's provider
Sean M. Collins34296012014-10-27 11:57:20 -040079networking extension, so that networks that are configured on an
Shilla Saebi2ed09d82015-04-21 15:02:13 -040080external router can be utilized by neutron, and instances created via
Sean M. Collins34296012014-10-27 11:57:20 -040081Nova can attach to the network managed by the external router.
82
83For example, in some lab environments, a hardware router has been
84pre-configured by another party, and an OpenStack developer has been
85given a VLAN tag and IP address range, so that instances created via
86DevStack will use the external router for L3 connectivity, as opposed
Shilla Saebi2ed09d82015-04-21 15:02:13 -040087to the neutron L3 service.
Sean M. Collins34296012014-10-27 11:57:20 -040088
Sean M. Collins4696db92015-10-09 12:31:57 -040089Physical Network Setup
90----------------------
91
92.. nwdiag::
93
94 nwdiag {
95 inet [ shape = cloud ];
96 router;
97 inet -- router;
98
99 network provider_net {
100 address = "203.0.113.0/24"
101 router [ address = "203.0.113.1" ];
102 controller;
103 compute1;
104 compute2;
105 }
106
107 network control_plane {
108 router [ address = "10.0.0.1" ]
109 address = "10.0.0.0/24"
110 controller [ address = "10.0.0.2" ]
111 compute1 [ address = "10.0.0.3" ]
112 compute2 [ address = "10.0.0.4" ]
113 }
114 }
115
116
Sean M. Collins887f1822015-10-12 10:36:34 -0400117On a compute node, the first interface, eth0 is used for the OpenStack
118management (API, message bus, etc) as well as for ssh for an
119administrator to access the machine.
120
121::
122
123 stack@compute:~$ ifconfig eth0
124 eth0 Link encap:Ethernet HWaddr bc:16:65:20:af:fc
125 inet addr:10.0.0.3
126
127eth1 is manually configured at boot to not have an IP address.
128Consult your operating system documentation for the appropriate
129technique. For Ubuntu, the contents of `/etc/network/interfaces`
130contains:
131
132::
133
134 auto eth1
135 iface eth1 inet manual
136 up ifconfig $IFACE 0.0.0.0 up
137 down ifconfig $IFACE 0.0.0.0 down
138
139The second physical interface, eth1 is added to a bridge (in this case
140named br-ex), which is used to forward network traffic from guest VMs.
141
142::
143
144 stack@compute:~$ sudo ovs-vsctl add-br br-ex
145 stack@compute:~$ sudo ovs-vsctl add-port br-ex eth1
146 stack@compute:~$ sudo ovs-vsctl show
147 9a25c837-32ab-45f6-b9f2-1dd888abcf0f
148 Bridge br-ex
149 Port br-ex
150 Interface br-ex
151 type: internal
152 Port phy-br-ex
153 Interface phy-br-ex
154 type: patch
155 options: {peer=int-br-ex}
156 Port "eth1"
157 Interface "eth1"
158
Sean M. Collins34296012014-10-27 11:57:20 -0400159
160Service Configuration
161---------------------
162
163**Control Node**
164
165In this example, the control node will run the majority of the
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400166OpenStack API and management services (keystone, glance,
167nova, neutron)
Sean M. Collins34296012014-10-27 11:57:20 -0400168
169
170**Compute Nodes**
171
172In this example, the nodes that will host guest instances will run
173the `neutron-openvswitch-agent` for network connectivity, as well as
174the compute service `nova-compute`.
175
176DevStack Configuration
177----------------------
178
179The following is a snippet of the DevStack configuration on the
180controller node.
181
182::
183
Sean M. Collins611cab42015-10-09 12:54:32 -0400184 HOST_IP=10.0.0.2
185 SERVICE_HOST=10.0.0.2
186 MYSQL_HOST=10.0.0.2
187 SERVICE_HOST=10.0.0.2
188 MYSQL_HOST=10.0.0.2
189 RABBIT_HOST=10.0.0.2
190 GLANCE_HOSTPORT=10.0.0.2:9292
Sean M. Collins34296012014-10-27 11:57:20 -0400191 PUBLIC_INTERFACE=eth1
192
Sean M. Collins611cab42015-10-09 12:54:32 -0400193 ADMIN_PASSWORD=secrete
194 MYSQL_PASSWORD=secrete
195 RABBIT_PASSWORD=secrete
196 SERVICE_PASSWORD=secrete
197 SERVICE_TOKEN=secrete
198
Sean M. Collins34296012014-10-27 11:57:20 -0400199 ## Neutron options
200 Q_USE_SECGROUP=True
201 ENABLE_TENANT_VLANS=True
202 TENANT_VLAN_RANGE=3001:4000
203 PHYSICAL_NETWORK=default
204 OVS_PHYSICAL_BRIDGE=br-ex
205
206 Q_USE_PROVIDER_NETWORKING=True
207 Q_L3_ENABLED=False
208
209 # Do not use Nova-Network
210 disable_service n-net
211
212 # Neutron
213 ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt
214
215 ## Neutron Networking options used to create Neutron Subnets
216
Sean M. Collinsd72b8392015-06-18 12:40:09 -0400217 FIXED_RANGE="203.0.113.0/24"
syed ahsan shamim zaidi512be7d2015-10-20 21:20:27 +0000218 NETWORK_GATEWAY=203.0.113.1
Sean M. Collins34296012014-10-27 11:57:20 -0400219 PROVIDER_SUBNET_NAME="provider_net"
220 PROVIDER_NETWORK_TYPE="vlan"
221 SEGMENTATION_ID=2010
222
223In this configuration we are defining FIXED_RANGE to be a
Sean M. Collinsd72b8392015-06-18 12:40:09 -0400224publicly routed IPv4 subnet. In this specific instance we are using
225the special TEST-NET-3 subnet defined in `RFC 5737 <http://tools.ietf.org/html/rfc5737>`_,
226which is used for documentation. In your DevStack setup, FIXED_RANGE
227would be a public IP address range that you or your organization has
228allocated to you, so that you could access your instances from the
229public internet.
Sean M. Collins34296012014-10-27 11:57:20 -0400230
Sean M. Collins611cab42015-10-09 12:54:32 -0400231The following is the DevStack configuration on
232compute node 1.
Sean M. Collins34296012014-10-27 11:57:20 -0400233
234::
235
Sean M. Collins611cab42015-10-09 12:54:32 -0400236 HOST_IP=10.0.0.3
237 SERVICE_HOST=10.0.0.2
238 MYSQL_HOST=10.0.0.2
239 SERVICE_HOST=10.0.0.2
240 MYSQL_HOST=10.0.0.2
241 RABBIT_HOST=10.0.0.2
242 GLANCE_HOSTPORT=10.0.0.2:9292
243 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 # Services that a compute node runs
250 ENABLED_SERVICES=n-cpu,rabbit,q-agt
251
252 ## Neutron options
Sean M. Collins34296012014-10-27 11:57:20 -0400253 PHYSICAL_NETWORK=default
254 OVS_PHYSICAL_BRIDGE=br-ex
255 PUBLIC_INTERFACE=eth1
256 Q_USE_PROVIDER_NETWORKING=True
257 Q_L3_ENABLED=False
258
Sean M. Collins611cab42015-10-09 12:54:32 -0400259Compute node 2's configuration will be exactly the same, except
260`HOST_IP` will be `10.0.0.4`
261
Sean M. Collins34296012014-10-27 11:57:20 -0400262When DevStack is configured to use provider networking (via
263`Q_USE_PROVIDER_NETWORKING` is True and `Q_L3_ENABLED` is False) -
264DevStack will automatically add the network interface defined in
265`PUBLIC_INTERFACE` to the `OVS_PHYSICAL_BRIDGE`
266
267For example, with the above configuration, a bridge is
268created, named `br-ex` which is managed by Open vSwitch, and the
269second interface on the compute node, `eth1` is attached to the
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400270bridge, to forward traffic sent by guest VMs.
Sean M. Collins872a2622015-10-06 12:45:06 -0400271
272Miscellaneous Tips
273==================
274
275
276Disabling Next Generation Firewall Tools
277----------------------------------------
278
279DevStack does not properly operate with modern firewall tools. Specifically
280it will appear as if the guest VM can access the external network via ICMP,
281but UDP and TCP packets will not be delivered to the guest VM. The root cause
282of the issue is that both ufw (Uncomplicated Firewall) and firewalld (Fedora's
283firewall manager) apply firewall rules to all interfaces in the system, rather
284then per-device. One solution to this problem is to revert to iptables
285functionality.
286
287To get a functional firewall configuration for Fedora do the following:
288
289::
290
291 sudo service iptables save
292 sudo systemctl disable firewalld
293 sudo systemctl enable iptables
294 sudo systemctl stop firewalld
295 sudo systemctl start iptables
296
297
298To get a functional firewall configuration for distributions containing ufw,
299disable ufw. Note ufw is generally not enabled by default in Ubuntu. To
300disable ufw if it was enabled, do the following:
301
302::
303
304 sudo service iptables save
305 sudo ufw disable
306
Sean M. Collinsd8aa10e2015-10-09 12:21:30 -0400307Configuring Extension Drivers for the ML2 Plugin
308------------------------------------------------
Sean M. Collins872a2622015-10-06 12:45:06 -0400309
Sean M. Collinsd8aa10e2015-10-09 12:21:30 -0400310Extension drivers for the ML2 plugin are set with the variable
311`Q_ML2_PLUGIN_EXT_DRIVERS`, and includes the 'port_security' extension
312by default. If you want to remove all the extension drivers (even
313'port_security'), set `Q_ML2_PLUGIN_EXT_DRIVERS` to blank.
Sean M. Collins872a2622015-10-06 12:45:06 -0400314