blob: bdbeaaa7a8b176dd169b0daf2c0b9b22e5cd591d [file] [log] [blame]
Sean Daguebc883df2016-08-12 07:21:59 -04001=====================
2 DevStack Networking
3=====================
4
5An important part of the DevStack experience is networking that works
6by default for created guests. This might not be optimal for your
Peter Stachowski0dab8d62016-11-21 20:36:31 +00007particular testing environment, so this document tries its best to
Sean Daguebc883df2016-08-12 07:21:59 -04008explain what's going on.
9
10Defaults
11========
12
13If 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 Benton4bfbc292016-11-15 17:26:05 -080018* the demo project configured with fixed ips on a subnet allocated from
19 the 10.0.0.0/22 range
Peter Stachowski0dab8d62016-11-21 20:36:31 +000020* a ``br-ex`` interface controlled by neutron for all its networking
Sean Daguebc883df2016-08-12 07:21:59 -040021 (this is not connected to any physical interfaces).
Peter Stachowski0dab8d62016-11-21 20:36:31 +000022* DNS resolution for guests based on the resolv.conf for your host
Sean Daguebc883df2016-08-12 07:21:59 -040023* an ip masq rule that allows created guests to route out
24
25This creates an environment which is isolated to the single
26host. Guests can get to the external network for package
27updates. 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
40Locally Accessible Guests
41=========================
42
Peter Stachowski0dab8d62016-11-21 20:36:31 +000043If you want to make you guests accessible from other machines on your
Sean Daguebc883df2016-08-12 07:21:59 -040044network, we have to connect ``br-ex`` to a physical interface.
45
46Dedicated Guest Interface
47-------------------------
48
49If you have 2 or more interfaces on your devstack server, you can
50allocate an interface to neutron to fully manage. This **should not**
51be the same interface you use to ssh into the devstack server itself.
52
53This is done by setting with the ``PUBLIC_INTERFACE`` attribute.
54
55.. code-block:: bash
56
57 [[local|localrc]]
58 PUBLIC_INTERFACE=eth1
59
60That will put all layer 2 traffic from your guests onto the main
61network. When running in this mode the ip masq rule is **not** added
62in your devstack, you are responsible for making routing work on your
63local network.
64
65Shared 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
74If you need your guests accessible on the network, but only have 1
75interface (using something like a NUC), you can share your one
76network. But in order for this to work you need to manually set a lot
77of 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
88In order for this scenario to work the floating ip network must match
89the default networking on your server. This breaks HOST_IP detection,
90as we exclude the floating range by default, so you have to specify
91that manually.
92
93The ``PUBLIC_NETWORK_GATEWAY`` is the gateway that server would normally
94use to get off the network. ``Q_FLOATING_ALLOCATION_POOL`` controls
95the range of floating ips that will be handed out. As we are sharing
96your existing network, you'll want to give it a slice that your local
97dhcp server is not allocating. Otherwise you could easily have
98conflicting ip addresses, and cause havoc with your local network.
Kevin Benton4bfbc292016-11-15 17:26:05 -080099
100
101Private Network Addressing
102==========================
103
104The private networks addresses are controlled by the ``IPV4_ADDRS_SAFE_TO_USE``
105and the ``IPV6_ADDRS_SAFE_TO_USE`` variables. This allows users to specify one
106single variable of safe internal IPs to use that will be referenced whether or
107not subnetpools are in use.
108
109For IPv4, ``FIXED_RANGE`` and ``SUBNETPOOL_PREFIX_V4`` will just default to
110the value of ``IPV4_ADDRS_SAFE_TO_USE`` directly.
111
Peter Stachowski0dab8d62016-11-21 20:36:31 +0000112For IPv6, ``FIXED_RANGE_V6`` will default to the first /64 of the value of
Kevin Benton4bfbc292016-11-15 17:26:05 -0800113``IPV6_ADDRS_SAFE_TO_USE``. If ``IPV6_ADDRS_SAFE_TO_USE`` is /64 or smaller,
Peter Stachowski0dab8d62016-11-21 20:36:31 +0000114``FIXED_RANGE_V6`` will just use the value of that directly.
Kevin Benton4bfbc292016-11-15 17:26:05 -0800115``SUBNETPOOL_PREFIX_V6`` will just default to the value of
116``IPV6_ADDRS_SAFE_TO_USE`` directly.