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 |
| 7 | particular testing environment, so this document tries it's best to |
| 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 |
| 18 | * the demo project configured with fixed ips on 10.0.0.0/24 |
| 19 | * a ``br-ex`` interface controlled by neutron for all it's networking |
| 20 | (this is not connected to any physical interfaces). |
| 21 | * DNS resolution for guests based on the resolv.conf for you host |
| 22 | * an ip masq rule that allows created guests to route out |
| 23 | |
| 24 | This creates an environment which is isolated to the single |
| 25 | host. Guests can get to the external network for package |
| 26 | updates. Tempest tests will work in this environment. |
| 27 | |
| 28 | .. note:: |
| 29 | |
| 30 | By default all OpenStack environments have security group rules |
| 31 | which block all inbound packets to guests. If you want to be able |
| 32 | to ssh / ping your created guests you should run the following. |
| 33 | |
| 34 | .. code-block:: bash |
| 35 | |
| 36 | openstack security group rule create --proto icmp --dst-port 0 default |
| 37 | openstack security group rule create --proto tcp --dst-port 22 default |
| 38 | |
| 39 | Locally Accessible Guests |
| 40 | ========================= |
| 41 | |
| 42 | If you want to make you guests accessible other machines on your |
| 43 | network, we have to connect ``br-ex`` to a physical interface. |
| 44 | |
| 45 | Dedicated Guest Interface |
| 46 | ------------------------- |
| 47 | |
| 48 | If you have 2 or more interfaces on your devstack server, you can |
| 49 | allocate an interface to neutron to fully manage. This **should not** |
| 50 | be the same interface you use to ssh into the devstack server itself. |
| 51 | |
| 52 | This is done by setting with the ``PUBLIC_INTERFACE`` attribute. |
| 53 | |
| 54 | .. code-block:: bash |
| 55 | |
| 56 | [[local|localrc]] |
| 57 | PUBLIC_INTERFACE=eth1 |
| 58 | |
| 59 | That will put all layer 2 traffic from your guests onto the main |
| 60 | network. When running in this mode the ip masq rule is **not** added |
| 61 | in your devstack, you are responsible for making routing work on your |
| 62 | local network. |
| 63 | |
| 64 | Shared Guest Interface |
| 65 | ---------------------- |
| 66 | |
| 67 | .. warning:: |
| 68 | |
| 69 | This is not a recommended configuration. Because of interactions |
| 70 | between ovs and bridging, if you reboot your box with active |
| 71 | networking you may loose network connectivity to your system. |
| 72 | |
| 73 | If you need your guests accessible on the network, but only have 1 |
| 74 | interface (using something like a NUC), you can share your one |
| 75 | network. But in order for this to work you need to manually set a lot |
| 76 | of addresses, and have them all exactly correct. |
| 77 | |
| 78 | .. code-block:: bash |
| 79 | |
| 80 | [[local|localrc]] |
| 81 | PUBLIC_INTERFACE=eth0 |
| 82 | HOST_IP=10.42.0.52 |
| 83 | FLOATING_RANGE=10.42.0.52/24 |
| 84 | PUBLIC_NETWORK_GATEWAY=10.42.0.1 |
| 85 | Q_FLOATING_ALLOCATION_POOL=start=10.42.0.250,end=10.42.0.254 |
| 86 | |
| 87 | In order for this scenario to work the floating ip network must match |
| 88 | the default networking on your server. This breaks HOST_IP detection, |
| 89 | as we exclude the floating range by default, so you have to specify |
| 90 | that manually. |
| 91 | |
| 92 | The ``PUBLIC_NETWORK_GATEWAY`` is the gateway that server would normally |
| 93 | use to get off the network. ``Q_FLOATING_ALLOCATION_POOL`` controls |
| 94 | the range of floating ips that will be handed out. As we are sharing |
| 95 | your existing network, you'll want to give it a slice that your local |
| 96 | dhcp server is not allocating. Otherwise you could easily have |
| 97 | conflicting ip addresses, and cause havoc with your local network. |