Sean Dague | bc883df | 2016-08-12 07:21:59 -0400 | [diff] [blame] | 1 | ===================== |
| 2 | DevStack Networking |
| 3 | ===================== |
| 4 | |
| 5 | An important part of the DevStack experience is networking that works |
| 6 | by default for created guests. This might not be optimal for your |
Peter Stachowski | 0dab8d6 | 2016-11-21 20:36:31 +0000 | [diff] [blame] | 7 | particular testing environment, so this document tries its best to |
Sean Dague | bc883df | 2016-08-12 07:21:59 -0400 | [diff] [blame] | 8 | explain what's going on. |
| 9 | |
| 10 | Defaults |
| 11 | ======== |
| 12 | |
| 13 | If you don't specify any configuration you will get the following: |
| 14 | |
| 15 | * neutron (including l3 with openvswitch) |
| 16 | * private project networks for each openstack project |
| 17 | * a floating ip range of 172.24.4.0/24 with the gateway of 172.24.4.1 |
Kevin Benton | 4bfbc29 | 2016-11-15 17:26:05 -0800 | [diff] [blame] | 18 | * the demo project configured with fixed ips on a subnet allocated from |
| 19 | the 10.0.0.0/22 range |
Peter Stachowski | 0dab8d6 | 2016-11-21 20:36:31 +0000 | [diff] [blame] | 20 | * a ``br-ex`` interface controlled by neutron for all its networking |
Sean Dague | bc883df | 2016-08-12 07:21:59 -0400 | [diff] [blame] | 21 | (this is not connected to any physical interfaces). |
Peter Stachowski | 0dab8d6 | 2016-11-21 20:36:31 +0000 | [diff] [blame] | 22 | * DNS resolution for guests based on the resolv.conf for your host |
Sean Dague | bc883df | 2016-08-12 07:21:59 -0400 | [diff] [blame] | 23 | * an ip masq rule that allows created guests to route out |
| 24 | |
| 25 | This creates an environment which is isolated to the single |
| 26 | host. Guests can get to the external network for package |
| 27 | updates. Tempest tests will work in this environment. |
| 28 | |
| 29 | .. note:: |
| 30 | |
| 31 | By default all OpenStack environments have security group rules |
| 32 | which block all inbound packets to guests. If you want to be able |
| 33 | to ssh / ping your created guests you should run the following. |
| 34 | |
| 35 | .. code-block:: bash |
| 36 | |
| 37 | openstack security group rule create --proto icmp --dst-port 0 default |
| 38 | openstack security group rule create --proto tcp --dst-port 22 default |
| 39 | |
| 40 | Locally Accessible Guests |
| 41 | ========================= |
| 42 | |
Peter Stachowski | 0dab8d6 | 2016-11-21 20:36:31 +0000 | [diff] [blame] | 43 | If you want to make you guests accessible from other machines on your |
Sean Dague | bc883df | 2016-08-12 07:21:59 -0400 | [diff] [blame] | 44 | network, we have to connect ``br-ex`` to a physical interface. |
| 45 | |
| 46 | Dedicated Guest Interface |
| 47 | ------------------------- |
| 48 | |
| 49 | If you have 2 or more interfaces on your devstack server, you can |
| 50 | allocate an interface to neutron to fully manage. This **should not** |
| 51 | be the same interface you use to ssh into the devstack server itself. |
| 52 | |
| 53 | This is done by setting with the ``PUBLIC_INTERFACE`` attribute. |
| 54 | |
| 55 | .. code-block:: bash |
| 56 | |
| 57 | [[local|localrc]] |
| 58 | PUBLIC_INTERFACE=eth1 |
| 59 | |
| 60 | That will put all layer 2 traffic from your guests onto the main |
| 61 | network. When running in this mode the ip masq rule is **not** added |
| 62 | in your devstack, you are responsible for making routing work on your |
| 63 | local network. |
| 64 | |
| 65 | Shared Guest Interface |
| 66 | ---------------------- |
| 67 | |
| 68 | .. warning:: |
| 69 | |
| 70 | This is not a recommended configuration. Because of interactions |
| 71 | between ovs and bridging, if you reboot your box with active |
| 72 | networking you may loose network connectivity to your system. |
| 73 | |
| 74 | If you need your guests accessible on the network, but only have 1 |
| 75 | interface (using something like a NUC), you can share your one |
| 76 | network. But in order for this to work you need to manually set a lot |
| 77 | of addresses, and have them all exactly correct. |
| 78 | |
| 79 | .. code-block:: bash |
| 80 | |
| 81 | [[local|localrc]] |
| 82 | PUBLIC_INTERFACE=eth0 |
| 83 | HOST_IP=10.42.0.52 |
| 84 | FLOATING_RANGE=10.42.0.52/24 |
| 85 | PUBLIC_NETWORK_GATEWAY=10.42.0.1 |
| 86 | Q_FLOATING_ALLOCATION_POOL=start=10.42.0.250,end=10.42.0.254 |
| 87 | |
| 88 | In order for this scenario to work the floating ip network must match |
| 89 | the default networking on your server. This breaks HOST_IP detection, |
| 90 | as we exclude the floating range by default, so you have to specify |
| 91 | that manually. |
| 92 | |
| 93 | The ``PUBLIC_NETWORK_GATEWAY`` is the gateway that server would normally |
| 94 | use to get off the network. ``Q_FLOATING_ALLOCATION_POOL`` controls |
| 95 | the range of floating ips that will be handed out. As we are sharing |
| 96 | your existing network, you'll want to give it a slice that your local |
| 97 | dhcp server is not allocating. Otherwise you could easily have |
| 98 | conflicting ip addresses, and cause havoc with your local network. |
Kevin Benton | 4bfbc29 | 2016-11-15 17:26:05 -0800 | [diff] [blame] | 99 | |
| 100 | |
| 101 | Private Network Addressing |
| 102 | ========================== |
| 103 | |
| 104 | The private networks addresses are controlled by the ``IPV4_ADDRS_SAFE_TO_USE`` |
| 105 | and the ``IPV6_ADDRS_SAFE_TO_USE`` variables. This allows users to specify one |
| 106 | single variable of safe internal IPs to use that will be referenced whether or |
| 107 | not subnetpools are in use. |
| 108 | |
| 109 | For IPv4, ``FIXED_RANGE`` and ``SUBNETPOOL_PREFIX_V4`` will just default to |
| 110 | the value of ``IPV4_ADDRS_SAFE_TO_USE`` directly. |
| 111 | |
Peter Stachowski | 0dab8d6 | 2016-11-21 20:36:31 +0000 | [diff] [blame] | 112 | For IPv6, ``FIXED_RANGE_V6`` will default to the first /64 of the value of |
Kevin Benton | 4bfbc29 | 2016-11-15 17:26:05 -0800 | [diff] [blame] | 113 | ``IPV6_ADDRS_SAFE_TO_USE``. If ``IPV6_ADDRS_SAFE_TO_USE`` is /64 or smaller, |
Peter Stachowski | 0dab8d6 | 2016-11-21 20:36:31 +0000 | [diff] [blame] | 114 | ``FIXED_RANGE_V6`` will just use the value of that directly. |
Kevin Benton | 4bfbc29 | 2016-11-15 17:26:05 -0800 | [diff] [blame] | 115 | ``SUBNETPOOL_PREFIX_V6`` will just default to the value of |
| 116 | ``IPV6_ADDRS_SAFE_TO_USE`` directly. |