blob: b0a89070fb795c01fe420328bc8779fd1513713a [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
8Network Interface Configuration
9===============================
10
Shilla Saebi2ed09d82015-04-21 15:02:13 -040011To use neutron, it is suggested that two network interfaces be present
Sean M. Collins34296012014-10-27 11:57:20 -040012in the host operating system.
13
14The first interface, eth0 is used for the OpenStack management (API,
15message bus, etc) as well as for ssh for an administrator to access
16the machine.
17
18::
19
20 stack@compute:~$ ifconfig eth0
21 eth0 Link encap:Ethernet HWaddr bc:16:65:20:af:fc
22 inet addr:192.168.1.18
23
24eth1 is manually configured at boot to not have an IP address.
25Consult your operating system documentation for the appropriate
Juan Antonio Osorio Roblesb7c1ce42014-11-28 14:19:19 +020026technique. For Ubuntu, the contents of `/etc/network/interfaces`
Sean M. Collins34296012014-10-27 11:57:20 -040027contains:
28
29::
30
31 auto eth1
32 iface eth1 inet manual
33 up ifconfig $IFACE 0.0.0.0 up
34 down ifconfig $IFACE 0.0.0.0 down
35
36The second physical interface, eth1 is added to a bridge (in this case
37named br-ex), which is used to forward network traffic from guest VMs.
38Network traffic from eth1 on the compute nodes is then NAT'd by the
39controller node that runs Neutron's `neutron-l3-agent` and provides L3
40connectivity.
41
42::
43
44 stack@compute:~$ sudo ovs-vsctl add-br br-ex
45 stack@compute:~$ sudo ovs-vsctl add-port br-ex eth1
46 stack@compute:~$ sudo ovs-vsctl show
47 9a25c837-32ab-45f6-b9f2-1dd888abcf0f
48 Bridge br-ex
49 Port br-ex
50 Interface br-ex
51 type: internal
52 Port phy-br-ex
53 Interface phy-br-ex
54 type: patch
55 options: {peer=int-br-ex}
56 Port "eth1"
57 Interface "eth1"
58
59
60
61
Steven Dake3a6b1282014-12-31 14:27:22 -070062Disabling Next Generation Firewall Tools
63========================================
64
Shilla Saebi2ed09d82015-04-21 15:02:13 -040065DevStack does not properly operate with modern firewall tools. Specifically
Steven Dake3a6b1282014-12-31 14:27:22 -070066it will appear as if the guest VM can access the external network via ICMP,
67but UDP and TCP packets will not be delivered to the guest VM. The root cause
68of the issue is that both ufw (Uncomplicated Firewall) and firewalld (Fedora's
69firewall manager) apply firewall rules to all interfaces in the system, rather
70then per-device. One solution to this problem is to revert to iptables
71functionality.
72
73To get a functional firewall configuration for Fedora do the following:
74
75::
76
77 sudo service iptables save
78 sudo systemctl disable firewalld
79 sudo systemctl enable iptables
80 sudo systemctl stop firewalld
81 sudo systemctl start iptables
82
83
84To get a functional firewall configuration for distributions containing ufw,
85disable ufw. Note ufw is generally not enabled by default in Ubuntu. To
86disable ufw if it was enabled, do the following:
87
88::
89
90 sudo service iptables save
91 sudo ufw disable
92
93
94
95
Sean M. Collins34296012014-10-27 11:57:20 -040096Neutron Networking with Open vSwitch
97====================================
98
Shilla Saebi2ed09d82015-04-21 15:02:13 -040099Configuring neutron, OpenStack Networking in DevStack is very similar to
Sean M. Collins34296012014-10-27 11:57:20 -0400100configuring `nova-network` - many of the same configuration variables
101(like `FIXED_RANGE` and `FLOATING_RANGE`) used by `nova-network` are
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400102used by neutron, which is intentional.
Sean M. Collins34296012014-10-27 11:57:20 -0400103
104The only difference is the disabling of `nova-network` in your
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400105local.conf, and the enabling of the neutron components.
Sean M. Collins34296012014-10-27 11:57:20 -0400106
107
108Configuration
109-------------
110
111::
112
113 FIXED_RANGE=10.0.0.0/24
114 FLOATING_RANGE=192.168.27.0/24
115 PUBLIC_NETWORK_GATEWAY=192.168.27.2
116
117 disable_service n-net
118 enable_service q-svc
119 enable_service q-agt
120 enable_service q-dhcp
121 enable_service q-meta
122 enable_service q-l3
123
124 Q_USE_SECGROUP=True
125 ENABLE_TENANT_VLANS=True
126 TENANT_VLAN_RANGE=1000:1999
127 PHYSICAL_NETWORK=default
128 OVS_PHYSICAL_BRIDGE=br-ex
129
130In this configuration we are defining FLOATING_RANGE to be a
131subnet that exists in the private RFC1918 address space - however in
132in a real setup FLOATING_RANGE would be a public IP address range.
133
Yalei Wanga48e5dc2015-03-06 17:05:11 +0800134Note that extension drivers for the ML2 plugin is set by
135`Q_ML2_PLUGIN_EXT_DRIVERS`, and it includes 'port_security' by default. If you
136want to remove all the extension drivers (even 'port_security'), set
137`Q_ML2_PLUGIN_EXT_DRIVERS` to blank.
138
Sean M. Collins34296012014-10-27 11:57:20 -0400139Neutron Networking with Open vSwitch and Provider Networks
140==========================================================
141
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400142In some instances, it is desirable to use neutron's provider
Sean M. Collins34296012014-10-27 11:57:20 -0400143networking extension, so that networks that are configured on an
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400144external router can be utilized by neutron, and instances created via
Sean M. Collins34296012014-10-27 11:57:20 -0400145Nova can attach to the network managed by the external router.
146
147For example, in some lab environments, a hardware router has been
148pre-configured by another party, and an OpenStack developer has been
149given a VLAN tag and IP address range, so that instances created via
150DevStack will use the external router for L3 connectivity, as opposed
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400151to the neutron L3 service.
Sean M. Collins34296012014-10-27 11:57:20 -0400152
153
154Service Configuration
155---------------------
156
157**Control Node**
158
159In this example, the control node will run the majority of the
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400160OpenStack API and management services (keystone, glance,
161nova, neutron)
Sean M. Collins34296012014-10-27 11:57:20 -0400162
163
164**Compute Nodes**
165
166In this example, the nodes that will host guest instances will run
167the `neutron-openvswitch-agent` for network connectivity, as well as
168the compute service `nova-compute`.
169
170DevStack Configuration
171----------------------
172
173The following is a snippet of the DevStack configuration on the
174controller node.
175
176::
177
178 PUBLIC_INTERFACE=eth1
179
180 ## Neutron options
181 Q_USE_SECGROUP=True
182 ENABLE_TENANT_VLANS=True
183 TENANT_VLAN_RANGE=3001:4000
184 PHYSICAL_NETWORK=default
185 OVS_PHYSICAL_BRIDGE=br-ex
186
187 Q_USE_PROVIDER_NETWORKING=True
188 Q_L3_ENABLED=False
189
190 # Do not use Nova-Network
191 disable_service n-net
192
193 # Neutron
194 ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt
195
196 ## Neutron Networking options used to create Neutron Subnets
197
198 FIXED_RANGE="10.1.1.0/24"
199 PROVIDER_SUBNET_NAME="provider_net"
200 PROVIDER_NETWORK_TYPE="vlan"
201 SEGMENTATION_ID=2010
202
203In this configuration we are defining FIXED_RANGE to be a
Kennan35663102015-01-20 16:19:49 +0800204subnet that exists in the private RFC1918 address space - however
Sean M. Collins34296012014-10-27 11:57:20 -0400205in a real setup FIXED_RANGE would be a public IP address range, so
206that you could access your instances from the public internet.
207
208The following is a snippet of the DevStack configuration on the
209compute node.
210
211::
212
213 # Services that a compute node runs
214 ENABLED_SERVICES=n-cpu,rabbit,q-agt
215
216 ## Neutron options
217 Q_USE_SECGROUP=True
218 ENABLE_TENANT_VLANS=True
219 TENANT_VLAN_RANGE=3001:4000
220 PHYSICAL_NETWORK=default
221 OVS_PHYSICAL_BRIDGE=br-ex
222 PUBLIC_INTERFACE=eth1
223 Q_USE_PROVIDER_NETWORKING=True
224 Q_L3_ENABLED=False
225
226When DevStack is configured to use provider networking (via
227`Q_USE_PROVIDER_NETWORKING` is True and `Q_L3_ENABLED` is False) -
228DevStack will automatically add the network interface defined in
229`PUBLIC_INTERFACE` to the `OVS_PHYSICAL_BRIDGE`
230
231For example, with the above configuration, a bridge is
232created, named `br-ex` which is managed by Open vSwitch, and the
233second interface on the compute node, `eth1` is attached to the
Shilla Saebi2ed09d82015-04-21 15:02:13 -0400234bridge, to forward traffic sent by guest VMs.