| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 1 | ====================================== | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 2 | Using DevStack with neutron Networking | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 3 | ====================================== | 
 | 4 |  | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 5 | This guide will walk you through using OpenStack neutron with the ML2 | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 6 | plugin and the Open vSwitch mechanism driver. | 
 | 7 |  | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 8 |  | 
| Sean M. Collins | 2977b30 | 2016-01-25 09:10:52 -0500 | [diff] [blame] | 9 | .. _single-interface-ovs: | 
 | 10 |  | 
| Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 11 | Using Neutron with a Single Interface | 
 | 12 | ===================================== | 
 | 13 |  | 
 | 14 | In some instances, like on a developer laptop, there is only one | 
 | 15 | network interface that is available. In this scenario, the physical | 
 | 16 | interface is added to the Open vSwitch bridge, and the IP address of | 
 | 17 | the laptop is migrated onto the bridge interface. That way, the | 
 | 18 | physical interface can be used to transmit tenant network traffic, | 
 | 19 | the OpenStack API traffic, and management traffic. | 
 | 20 |  | 
 | 21 |  | 
 | 22 | Physical Network Setup | 
 | 23 | ---------------------- | 
 | 24 |  | 
 | 25 | In most cases where DevStack is being deployed with a single | 
 | 26 | interface, there is a hardware router that is being used for external | 
 | 27 | connectivity and DHCP. The developer machine is connected to this | 
| Mike Spreitzer | 4baa4ce | 2016-01-26 14:06:17 -0500 | [diff] [blame] | 28 | network and is on a shared subnet with other machines.  The | 
 | 29 | `local.conf` exhibited here assumes that 1500 is a reasonable MTU to | 
 | 30 | use on that network. | 
| Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 31 |  | 
 | 32 | .. nwdiag:: | 
 | 33 |  | 
 | 34 |         nwdiag { | 
 | 35 |                 inet [ shape = cloud ]; | 
 | 36 |                 router; | 
 | 37 |                 inet -- router; | 
 | 38 |  | 
 | 39 |                 network hardware_network { | 
 | 40 |                         address = "172.18.161.0/24" | 
 | 41 |                         router [ address = "172.18.161.1" ]; | 
| Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 42 |                         devstack-1 [ address = "172.18.161.6" ]; | 
| Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 43 |                 } | 
 | 44 |         } | 
 | 45 |  | 
 | 46 |  | 
 | 47 | DevStack Configuration | 
 | 48 | ---------------------- | 
 | 49 |  | 
| Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 50 | The following is a complete `local.conf` for the host named | 
 | 51 | `devstack-1`. It will run all the API and services, as well as | 
 | 52 | serving as a hypervisor for guest instances. | 
| Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 53 |  | 
 | 54 | :: | 
 | 55 |  | 
| Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 56 |         [[local|localrc]] | 
| Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 57 |         HOST_IP=172.18.161.6 | 
 | 58 |         SERVICE_HOST=172.18.161.6 | 
 | 59 |         MYSQL_HOST=172.18.161.6 | 
 | 60 |         RABBIT_HOST=172.18.161.6 | 
 | 61 |         GLANCE_HOSTPORT=172.18.161.6:9292 | 
 | 62 |         ADMIN_PASSWORD=secrete | 
| Swapnil (coolsvap) Kulkarni | c988bf6 | 2015-10-08 13:10:43 +0530 | [diff] [blame] | 63 |         DATABASE_PASSWORD=secrete | 
| Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 64 |         RABBIT_PASSWORD=secrete | 
 | 65 |         SERVICE_PASSWORD=secrete | 
| Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 66 |  | 
| Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 67 |         # Do not use Nova-Network | 
 | 68 |         disable_service n-net | 
 | 69 |         # Enable Neutron | 
 | 70 |         ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt,q-l3 | 
 | 71 |  | 
 | 72 |  | 
| Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 73 |         ## Neutron options | 
 | 74 |         Q_USE_SECGROUP=True | 
| Christian Berendt | 1c39482 | 2015-09-10 12:15:16 +0200 | [diff] [blame] | 75 |         FLOATING_RANGE="172.18.161.0/24" | 
| Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 76 |         FIXED_RANGE="10.0.0.0/24" | 
 | 77 |         Q_FLOATING_ALLOCATION_POOL=start=172.18.161.250,end=172.18.161.254 | 
 | 78 |         PUBLIC_NETWORK_GATEWAY="172.18.161.1" | 
 | 79 |         Q_L3_ENABLED=True | 
 | 80 |         PUBLIC_INTERFACE=eth0 | 
| Sean M. Collins | 2977b30 | 2016-01-25 09:10:52 -0500 | [diff] [blame] | 81 |  | 
 | 82 |         # Open vSwitch provider networking configuration | 
| Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 83 |         Q_USE_PROVIDERNET_FOR_PUBLIC=True | 
 | 84 |         OVS_PHYSICAL_BRIDGE=br-ex | 
 | 85 |         PUBLIC_BRIDGE=br-ex | 
 | 86 |         OVS_BRIDGE_MAPPINGS=public:br-ex | 
 | 87 |  | 
 | 88 |  | 
| Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 89 | Adding Additional Compute Nodes | 
 | 90 | ------------------------------- | 
 | 91 |  | 
 | 92 | Let's suppose that after installing DevStack on the first host, you | 
 | 93 | also want to do multinode testing and networking. | 
 | 94 |  | 
 | 95 | Physical Network Setup | 
 | 96 | ~~~~~~~~~~~~~~~~~~~~~~ | 
 | 97 |  | 
 | 98 | .. nwdiag:: | 
 | 99 |  | 
 | 100 |         nwdiag { | 
 | 101 |                 inet [ shape = cloud ]; | 
 | 102 |                 router; | 
 | 103 |                 inet -- router; | 
 | 104 |  | 
 | 105 |                 network hardware_network { | 
 | 106 |                         address = "172.18.161.0/24" | 
 | 107 |                         router [ address = "172.18.161.1" ]; | 
 | 108 |                         devstack-1 [ address = "172.18.161.6" ]; | 
 | 109 |                         devstack-2 [ address = "172.18.161.7" ]; | 
 | 110 |                 } | 
 | 111 |         } | 
 | 112 |  | 
 | 113 |  | 
 | 114 | After DevStack installs and configures Neutron, traffic from guest VMs | 
 | 115 | flows out of `devstack-2` (the compute node) and is encapsulated in a | 
 | 116 | VXLAN tunnel back to `devstack-1` (the control node) where the L3 | 
 | 117 | agent is running. | 
 | 118 |  | 
 | 119 | :: | 
 | 120 |  | 
 | 121 |     stack@devstack-2:~/devstack$ sudo ovs-vsctl show | 
 | 122 |     8992d965-0ba0-42fd-90e9-20ecc528bc29 | 
 | 123 |         Bridge br-int | 
 | 124 |             fail_mode: secure | 
 | 125 |             Port br-int | 
 | 126 |                 Interface br-int | 
 | 127 |                     type: internal | 
 | 128 |             Port patch-tun | 
 | 129 |                 Interface patch-tun | 
 | 130 |                     type: patch | 
 | 131 |                     options: {peer=patch-int} | 
 | 132 |         Bridge br-tun | 
 | 133 |             fail_mode: secure | 
 | 134 |             Port "vxlan-c0a801f6" | 
 | 135 |                 Interface "vxlan-c0a801f6" | 
 | 136 |                     type: vxlan | 
 | 137 |                     options: {df_default="true", in_key=flow, local_ip="172.18.161.7", out_key=flow, remote_ip="172.18.161.6"} | 
 | 138 |             Port patch-int | 
 | 139 |                 Interface patch-int | 
 | 140 |                     type: patch | 
 | 141 |                     options: {peer=patch-tun} | 
 | 142 |             Port br-tun | 
 | 143 |                 Interface br-tun | 
 | 144 |                     type: internal | 
 | 145 |         ovs_version: "2.0.2" | 
 | 146 |  | 
 | 147 | Open vSwitch on the control node, where the L3 agent runs, is | 
 | 148 | configured to de-encapsulate traffic from compute nodes, then forward | 
 | 149 | it over the `br-ex` bridge, where `eth0` is attached. | 
 | 150 |  | 
 | 151 | :: | 
 | 152 |  | 
 | 153 |     stack@devstack-1:~/devstack$ sudo ovs-vsctl show | 
 | 154 |     422adeea-48d1-4a1f-98b1-8e7239077964 | 
 | 155 |         Bridge br-tun | 
 | 156 |             fail_mode: secure | 
 | 157 |             Port br-tun | 
 | 158 |                 Interface br-tun | 
 | 159 |                     type: internal | 
 | 160 |             Port patch-int | 
 | 161 |                 Interface patch-int | 
 | 162 |                     type: patch | 
 | 163 |                     options: {peer=patch-tun} | 
 | 164 |             Port "vxlan-c0a801d8" | 
 | 165 |                 Interface "vxlan-c0a801d8" | 
 | 166 |                     type: vxlan | 
 | 167 |                     options: {df_default="true", in_key=flow, local_ip="172.18.161.6", out_key=flow, remote_ip="172.18.161.7"} | 
 | 168 |         Bridge br-ex | 
 | 169 |             Port phy-br-ex | 
 | 170 |                 Interface phy-br-ex | 
 | 171 |                     type: patch | 
 | 172 |                     options: {peer=int-br-ex} | 
 | 173 |             Port "eth0" | 
 | 174 |                 Interface "eth0" | 
 | 175 |             Port br-ex | 
 | 176 |                 Interface br-ex | 
 | 177 |                     type: internal | 
 | 178 |         Bridge br-int | 
 | 179 |             fail_mode: secure | 
 | 180 |             Port "tapce66332d-ea" | 
 | 181 |                 tag: 1 | 
 | 182 |                 Interface "tapce66332d-ea" | 
 | 183 |                     type: internal | 
 | 184 |             Port "qg-65e5a4b9-15" | 
 | 185 |                 tag: 2 | 
 | 186 |                 Interface "qg-65e5a4b9-15" | 
 | 187 |                     type: internal | 
 | 188 |             Port "qr-33e5e471-88" | 
 | 189 |                 tag: 1 | 
 | 190 |                 Interface "qr-33e5e471-88" | 
 | 191 |                     type: internal | 
 | 192 |             Port "qr-acbe9951-70" | 
 | 193 |                 tag: 1 | 
 | 194 |                 Interface "qr-acbe9951-70" | 
 | 195 |                     type: internal | 
 | 196 |             Port br-int | 
 | 197 |                 Interface br-int | 
 | 198 |                     type: internal | 
 | 199 |             Port patch-tun | 
 | 200 |                 Interface patch-tun | 
 | 201 |                     type: patch | 
 | 202 |                     options: {peer=patch-int} | 
 | 203 |             Port int-br-ex | 
 | 204 |                 Interface int-br-ex | 
 | 205 |                     type: patch | 
 | 206 |                     options: {peer=phy-br-ex} | 
 | 207 |         ovs_version: "2.0.2" | 
 | 208 |  | 
 | 209 | `br-int` is a bridge that the Open vSwitch mechanism driver creates, | 
 | 210 | which is used as the "integration bridge" where ports are created, and | 
 | 211 | plugged into the virtual switching fabric. `br-ex` is an OVS bridge | 
 | 212 | that is used to connect physical ports (like `eth0`), so that floating | 
 | 213 | IP traffic for tenants can be received from the physical network | 
 | 214 | infrastructure (and the internet), and routed to tenant network ports. | 
 | 215 | `br-tun` is a tunnel bridge that is used to connect OpenStack nodes | 
 | 216 | (like `devstack-2`) together. This bridge is used so that tenant | 
 | 217 | network traffic, using the VXLAN tunneling protocol, flows between | 
 | 218 | each compute node where tenant instances run. | 
 | 219 |  | 
 | 220 |  | 
 | 221 |  | 
 | 222 | DevStack Compute Configuration | 
 | 223 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
 | 224 |  | 
 | 225 | The host `devstack-2` has a very minimal `local.conf`. | 
 | 226 |  | 
 | 227 | :: | 
 | 228 |  | 
 | 229 |     [[local|localrc]] | 
 | 230 |     HOST_IP=172.18.161.7 | 
 | 231 |     SERVICE_HOST=172.18.161.6 | 
 | 232 |     MYSQL_HOST=172.18.161.6 | 
 | 233 |     RABBIT_HOST=172.18.161.6 | 
 | 234 |     GLANCE_HOSTPORT=172.18.161.6:9292 | 
 | 235 |     ADMIN_PASSWORD=secrete | 
 | 236 |     MYSQL_PASSWORD=secrete | 
 | 237 |     RABBIT_PASSWORD=secrete | 
 | 238 |     SERVICE_PASSWORD=secrete | 
| Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 239 |  | 
 | 240 |     ## Neutron options | 
 | 241 |     PUBLIC_INTERFACE=eth0 | 
 | 242 |     ENABLED_SERVICES=n-cpu,rabbit,q-agt | 
 | 243 |  | 
 | 244 | Network traffic from `eth0` on the compute nodes is then NAT'd by the | 
 | 245 | controller node that runs Neutron's `neutron-l3-agent` and provides L3 | 
 | 246 | connectivity. | 
 | 247 |  | 
| Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 248 |  | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 249 | Neutron Networking with Open vSwitch and Provider Networks | 
 | 250 | ========================================================== | 
 | 251 |  | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 252 | In some instances, it is desirable to use neutron's provider | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 253 | networking extension, so that networks that are configured on an | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 254 | external router can be utilized by neutron, and instances created via | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 255 | Nova can attach to the network managed by the external router. | 
 | 256 |  | 
 | 257 | For example, in some lab environments, a hardware router has been | 
 | 258 | pre-configured by another party, and an OpenStack developer has been | 
 | 259 | given a VLAN tag and IP address range, so that instances created via | 
 | 260 | DevStack will use the external router for L3 connectivity, as opposed | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 261 | to the neutron L3 service. | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 262 |  | 
| Sean M. Collins | 4696db9 | 2015-10-09 12:31:57 -0400 | [diff] [blame] | 263 | Physical Network Setup | 
 | 264 | ---------------------- | 
 | 265 |  | 
 | 266 | .. nwdiag:: | 
 | 267 |  | 
 | 268 |         nwdiag { | 
 | 269 |                 inet [ shape = cloud ]; | 
 | 270 |                 router; | 
 | 271 |                 inet -- router; | 
 | 272 |  | 
 | 273 |                 network provider_net { | 
 | 274 |                         address = "203.0.113.0/24" | 
 | 275 |                         router [ address = "203.0.113.1" ]; | 
 | 276 |                         controller; | 
 | 277 |                         compute1; | 
 | 278 |                         compute2; | 
 | 279 |                 } | 
 | 280 |  | 
 | 281 |                 network control_plane { | 
 | 282 |                         router [ address = "10.0.0.1" ] | 
 | 283 |                         address = "10.0.0.0/24" | 
 | 284 |                         controller [ address = "10.0.0.2" ] | 
 | 285 |                         compute1 [ address = "10.0.0.3" ] | 
 | 286 |                         compute2 [ address = "10.0.0.4" ] | 
 | 287 |                 } | 
 | 288 |         } | 
 | 289 |  | 
 | 290 |  | 
| Sean M. Collins | 887f182 | 2015-10-12 10:36:34 -0400 | [diff] [blame] | 291 | On a compute node, the first interface, eth0 is used for the OpenStack | 
 | 292 | management (API, message bus, etc) as well as for ssh for an | 
 | 293 | administrator to access the machine. | 
 | 294 |  | 
 | 295 | :: | 
 | 296 |  | 
 | 297 |         stack@compute:~$ ifconfig eth0 | 
 | 298 |         eth0      Link encap:Ethernet  HWaddr bc:16:65:20:af:fc | 
 | 299 |                   inet addr:10.0.0.3 | 
 | 300 |  | 
 | 301 | eth1 is manually configured at boot to not have an IP address. | 
 | 302 | Consult your operating system documentation for the appropriate | 
 | 303 | technique. For Ubuntu, the contents of `/etc/network/interfaces` | 
 | 304 | contains: | 
 | 305 |  | 
 | 306 | :: | 
 | 307 |  | 
 | 308 |         auto eth1 | 
 | 309 |         iface eth1 inet manual | 
 | 310 |                 up ifconfig $IFACE 0.0.0.0 up | 
 | 311 |                 down ifconfig $IFACE 0.0.0.0 down | 
 | 312 |  | 
 | 313 | The second physical interface, eth1 is added to a bridge (in this case | 
 | 314 | named br-ex), which is used to forward network traffic from guest VMs. | 
 | 315 |  | 
 | 316 | :: | 
 | 317 |  | 
 | 318 |         stack@compute:~$ sudo ovs-vsctl add-br br-ex | 
 | 319 |         stack@compute:~$ sudo ovs-vsctl add-port br-ex eth1 | 
 | 320 |         stack@compute:~$ sudo ovs-vsctl show | 
 | 321 |         9a25c837-32ab-45f6-b9f2-1dd888abcf0f | 
 | 322 |             Bridge br-ex | 
 | 323 |                 Port br-ex | 
 | 324 |                     Interface br-ex | 
 | 325 |                         type: internal | 
 | 326 |                 Port phy-br-ex | 
 | 327 |                     Interface phy-br-ex | 
 | 328 |                         type: patch | 
 | 329 |                         options: {peer=int-br-ex} | 
 | 330 |                 Port "eth1" | 
 | 331 |                     Interface "eth1" | 
 | 332 |  | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 333 |  | 
 | 334 | Service Configuration | 
 | 335 | --------------------- | 
 | 336 |  | 
 | 337 | **Control Node** | 
 | 338 |  | 
 | 339 | In this example, the control node will run the majority of the | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 340 | OpenStack API and management services (keystone, glance, | 
 | 341 | nova, neutron) | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 342 |  | 
 | 343 |  | 
 | 344 | **Compute Nodes** | 
 | 345 |  | 
 | 346 | In this example, the nodes that will host guest instances will run | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 347 | the ``neutron-openvswitch-agent`` for network connectivity, as well as | 
 | 348 | the compute service ``nova-compute``. | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 349 |  | 
 | 350 | DevStack Configuration | 
 | 351 | ---------------------- | 
 | 352 |  | 
 | 353 | The following is a snippet of the DevStack configuration on the | 
 | 354 | controller node. | 
 | 355 |  | 
 | 356 | :: | 
 | 357 |  | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 358 |         HOST_IP=10.0.0.2 | 
 | 359 |         SERVICE_HOST=10.0.0.2 | 
 | 360 |         MYSQL_HOST=10.0.0.2 | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 361 |         RABBIT_HOST=10.0.0.2 | 
 | 362 |         GLANCE_HOSTPORT=10.0.0.2:9292 | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 363 |         PUBLIC_INTERFACE=eth1 | 
 | 364 |  | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 365 |         ADMIN_PASSWORD=secrete | 
 | 366 |         MYSQL_PASSWORD=secrete | 
 | 367 |         RABBIT_PASSWORD=secrete | 
 | 368 |         SERVICE_PASSWORD=secrete | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 369 |  | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 370 |         ## Neutron options | 
 | 371 |         Q_USE_SECGROUP=True | 
 | 372 |         ENABLE_TENANT_VLANS=True | 
 | 373 |         TENANT_VLAN_RANGE=3001:4000 | 
 | 374 |         PHYSICAL_NETWORK=default | 
 | 375 |         OVS_PHYSICAL_BRIDGE=br-ex | 
 | 376 |  | 
 | 377 |         Q_USE_PROVIDER_NETWORKING=True | 
 | 378 |         Q_L3_ENABLED=False | 
 | 379 |  | 
 | 380 |         # Do not use Nova-Network | 
 | 381 |         disable_service n-net | 
 | 382 |  | 
 | 383 |         # Neutron | 
 | 384 |         ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt | 
 | 385 |  | 
 | 386 |         ## Neutron Networking options used to create Neutron Subnets | 
 | 387 |  | 
| Sean M. Collins | d72b839 | 2015-06-18 12:40:09 -0400 | [diff] [blame] | 388 |         FIXED_RANGE="203.0.113.0/24" | 
| syed ahsan shamim zaidi | 512be7d | 2015-10-20 21:20:27 +0000 | [diff] [blame] | 389 |         NETWORK_GATEWAY=203.0.113.1 | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 390 |         PROVIDER_SUBNET_NAME="provider_net" | 
 | 391 |         PROVIDER_NETWORK_TYPE="vlan" | 
 | 392 |         SEGMENTATION_ID=2010 | 
 | 393 |  | 
 | 394 | In this configuration we are defining FIXED_RANGE to be a | 
| Sean M. Collins | d72b839 | 2015-06-18 12:40:09 -0400 | [diff] [blame] | 395 | publicly routed IPv4 subnet. In this specific instance we are using | 
 | 396 | the special TEST-NET-3 subnet defined in `RFC 5737 <http://tools.ietf.org/html/rfc5737>`_, | 
 | 397 | which is used for documentation.  In your DevStack setup, FIXED_RANGE | 
 | 398 | would be a public IP address range that you or your organization has | 
 | 399 | allocated to you, so that you could access your instances from the | 
 | 400 | public internet. | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 401 |  | 
| John Kasperski | bdc0fa8 | 2015-11-23 11:56:33 -0600 | [diff] [blame] | 402 | The following is the DevStack configuration on | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 403 | compute node 1. | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 404 |  | 
 | 405 | :: | 
 | 406 |  | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 407 |         HOST_IP=10.0.0.3 | 
 | 408 |         SERVICE_HOST=10.0.0.2 | 
 | 409 |         MYSQL_HOST=10.0.0.2 | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 410 |         RABBIT_HOST=10.0.0.2 | 
 | 411 |         GLANCE_HOSTPORT=10.0.0.2:9292 | 
 | 412 |         ADMIN_PASSWORD=secrete | 
 | 413 |         MYSQL_PASSWORD=secrete | 
 | 414 |         RABBIT_PASSWORD=secrete | 
 | 415 |         SERVICE_PASSWORD=secrete | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 416 |  | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 417 |         # Services that a compute node runs | 
 | 418 |         ENABLED_SERVICES=n-cpu,rabbit,q-agt | 
 | 419 |  | 
| Sean M. Collins | 2977b30 | 2016-01-25 09:10:52 -0500 | [diff] [blame] | 420 |         ## Open vSwitch provider networking options | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 421 |         PHYSICAL_NETWORK=default | 
 | 422 |         OVS_PHYSICAL_BRIDGE=br-ex | 
 | 423 |         PUBLIC_INTERFACE=eth1 | 
 | 424 |         Q_USE_PROVIDER_NETWORKING=True | 
 | 425 |         Q_L3_ENABLED=False | 
 | 426 |  | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 427 | Compute node 2's configuration will be exactly the same, except | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 428 | ``HOST_IP`` will be ``10.0.0.4`` | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 429 |  | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 430 | When DevStack is configured to use provider networking (via | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 431 | ``Q_USE_PROVIDER_NETWORKING`` is True and ``Q_L3_ENABLED`` is False) - | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 432 | DevStack will automatically add the network interface defined in | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 433 | ``PUBLIC_INTERFACE`` to the ``OVS_PHYSICAL_BRIDGE`` | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 434 |  | 
 | 435 | For example, with the above  configuration, a bridge is | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 436 | created, named ``br-ex`` which is managed by Open vSwitch, and the | 
 | 437 | second interface on the compute node, ``eth1`` is attached to the | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 438 | bridge, to forward traffic sent by guest VMs. | 
| Sean M. Collins | 872a262 | 2015-10-06 12:45:06 -0400 | [diff] [blame] | 439 |  | 
 | 440 | Miscellaneous Tips | 
 | 441 | ================== | 
 | 442 |  | 
| Mike Spreitzer | 4baa4ce | 2016-01-26 14:06:17 -0500 | [diff] [blame] | 443 | Non-Standard MTU on the Physical Network | 
 | 444 | ---------------------------------------- | 
 | 445 |  | 
 | 446 | DevStack defaults to assume that the MTU on the physical network | 
 | 447 | is 1500.  A different MTU can be specified by adding the following to | 
 | 448 | the `localrc` part of `local.conf` on each machine. | 
 | 449 |  | 
 | 450 | :: | 
| Sean M. Collins | f81ae88 | 2016-02-01 14:00:20 -0500 | [diff] [blame] | 451 |  | 
| Mike Spreitzer | 4baa4ce | 2016-01-26 14:06:17 -0500 | [diff] [blame] | 452 |     Q_ML2_PLUGIN_PATH_MTU=1500 | 
 | 453 |  | 
| Sean M. Collins | 872a262 | 2015-10-06 12:45:06 -0400 | [diff] [blame] | 454 |  | 
 | 455 | Disabling Next Generation Firewall Tools | 
 | 456 | ---------------------------------------- | 
 | 457 |  | 
 | 458 | DevStack does not properly operate with modern firewall tools.  Specifically | 
 | 459 | it will appear as if the guest VM can access the external network via ICMP, | 
 | 460 | but UDP and TCP packets will not be delivered to the guest VM.  The root cause | 
 | 461 | of the issue is that both ufw (Uncomplicated Firewall) and firewalld (Fedora's | 
 | 462 | firewall manager) apply firewall rules to all interfaces in the system, rather | 
 | 463 | then per-device.  One solution to this problem is to revert to iptables | 
 | 464 | functionality. | 
 | 465 |  | 
 | 466 | To get a functional firewall configuration for Fedora do the following: | 
 | 467 |  | 
 | 468 | :: | 
 | 469 |  | 
 | 470 |          sudo service iptables save | 
 | 471 |          sudo systemctl disable firewalld | 
 | 472 |          sudo systemctl enable iptables | 
 | 473 |          sudo systemctl stop firewalld | 
 | 474 |          sudo systemctl start iptables | 
 | 475 |  | 
 | 476 |  | 
 | 477 | To get a functional firewall configuration for distributions containing ufw, | 
 | 478 | disable ufw.  Note ufw is generally not enabled by default in Ubuntu.  To | 
 | 479 | disable ufw if it was enabled, do the following: | 
 | 480 |  | 
 | 481 | :: | 
 | 482 |  | 
 | 483 |         sudo service iptables save | 
 | 484 |         sudo ufw disable | 
 | 485 |  | 
| Sean M. Collins | d8aa10e | 2015-10-09 12:21:30 -0400 | [diff] [blame] | 486 | Configuring Extension Drivers for the ML2 Plugin | 
 | 487 | ------------------------------------------------ | 
| Sean M. Collins | 872a262 | 2015-10-06 12:45:06 -0400 | [diff] [blame] | 488 |  | 
| Sean M. Collins | d8aa10e | 2015-10-09 12:21:30 -0400 | [diff] [blame] | 489 | Extension drivers for the ML2 plugin are set with the variable | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 490 | ``Q_ML2_PLUGIN_EXT_DRIVERS``, and includes the 'port_security' extension | 
| Sean M. Collins | d8aa10e | 2015-10-09 12:21:30 -0400 | [diff] [blame] | 491 | by default. If you want to remove all the extension drivers (even | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 492 | 'port_security'), set ``Q_ML2_PLUGIN_EXT_DRIVERS`` to blank. | 
| Sean M. Collins | 872a262 | 2015-10-06 12:45:06 -0400 | [diff] [blame] | 493 |  | 
| Sean M. Collins | 2977b30 | 2016-01-25 09:10:52 -0500 | [diff] [blame] | 494 |  | 
 | 495 | Using Linux Bridge instead of Open vSwitch | 
 | 496 | ------------------------------------------ | 
 | 497 |  | 
 | 498 | The configuration for using the Linux Bridge ML2 driver is fairly | 
 | 499 | straight forward. The Linux Bridge configuration for DevStack is similar | 
 | 500 | to the :ref:`Open vSwitch based single interface <single-interface-ovs>` | 
 | 501 | setup, with small modifications for the interface mappings. | 
 | 502 |  | 
 | 503 |  | 
 | 504 | :: | 
 | 505 |  | 
 | 506 |     [[local|localrc]] | 
 | 507 |     HOST_IP=172.18.161.6 | 
 | 508 |     SERVICE_HOST=172.18.161.6 | 
 | 509 |     MYSQL_HOST=172.18.161.6 | 
 | 510 |     RABBIT_HOST=172.18.161.6 | 
 | 511 |     GLANCE_HOSTPORT=172.18.161.6:9292 | 
 | 512 |     ADMIN_PASSWORD=secrete | 
 | 513 |     DATABASE_PASSWORD=secrete | 
 | 514 |     RABBIT_PASSWORD=secrete | 
 | 515 |     SERVICE_PASSWORD=secrete | 
 | 516 |  | 
 | 517 |     # Do not use Nova-Network | 
 | 518 |     disable_service n-net | 
 | 519 |     # Enable Neutron | 
 | 520 |     ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt,q-l3 | 
 | 521 |  | 
 | 522 |  | 
 | 523 |     ## Neutron options | 
 | 524 |     Q_USE_SECGROUP=True | 
 | 525 |     FLOATING_RANGE="172.18.161.0/24" | 
 | 526 |     FIXED_RANGE="10.0.0.0/24" | 
 | 527 |     Q_FLOATING_ALLOCATION_POOL=start=172.18.161.250,end=172.18.161.254 | 
 | 528 |     PUBLIC_NETWORK_GATEWAY="172.18.161.1" | 
 | 529 |     Q_L3_ENABLED=True | 
 | 530 |     PUBLIC_INTERFACE=eth0 | 
 | 531 |  | 
 | 532 |     Q_USE_PROVIDERNET_FOR_PUBLIC=True | 
 | 533 |  | 
 | 534 |     # Linuxbridge Settings | 
 | 535 |     Q_AGENT=linuxbridge | 
 | 536 |     LB_PHYSICAL_INTERFACE=eth0 | 
 | 537 |     PUBLIC_PHYSICAL_NETWORK=default | 
 | 538 |     LB_INTERFACE_MAPPINGS=default:eth0 | 
| Igor Duarte Cardoso | 3095ff5 | 2016-01-19 18:07:47 +0000 | [diff] [blame] | 539 |  | 
 | 540 | Creating specific OVS bridges for physical networks | 
 | 541 | --------------------------------------------------- | 
 | 542 |  | 
 | 543 | When using the Open vSwitch ML2 mechanism driver, it is possible to | 
 | 544 | have multiple Open vSwitch bridges meant for physical networking be | 
 | 545 | automatically created by setting the ``OVS_BRIDGE_MAPPINGS`` to a list of | 
 | 546 | physical network to bridge name associations with the following syntax: | 
 | 547 |  | 
 | 548 | :: | 
 | 549 |     OVS_BRIDGE_MAPPINGS=net1name:bridge1name,net2name:bridge2name,<...> | 
 | 550 |  | 
 | 551 | Also, ``OVS_BRIDGE_MAPPINGS`` has precedence over ``PHYSICAL_NETWORK`` and | 
 | 552 | ``OVS_PHYSICAL_BRIDGE``, meaning that if the former is set, the latter | 
 | 553 | ones will be ignored. When ``OVS_BRIDGE_MAPPINGS`` is not set, the other | 
 | 554 | variables will still be evaluated. |