blob: dc2fc716173faadb50e3fa11c11073ebb13b2b5a [file] [log] [blame]
Sean M. Collins34296012014-10-27 11:57:20 -04001======================================
2Using DevStack with Neutron Networking
3======================================
4
5This guide will walk you through using OpenStack Neutron with the ML2
6plugin and the Open vSwitch mechanism driver.
7
8Network Interface Configuration
9===============================
10
11To use Neutron, it is suggested that two network interfaces be present
12in 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
62Neutron Networking with Open vSwitch
63====================================
64
65Configuring Neutron networking in DevStack is very similar to
66configuring `nova-network` - many of the same configuration variables
67(like `FIXED_RANGE` and `FLOATING_RANGE`) used by `nova-network` are
68used by Neutron, which is intentional.
69
70The only difference is the disabling of `nova-network` in your
71local.conf, and the enabling of the Neutron components.
72
73
74Configuration
75-------------
76
77::
78
79 FIXED_RANGE=10.0.0.0/24
80 FLOATING_RANGE=192.168.27.0/24
81 PUBLIC_NETWORK_GATEWAY=192.168.27.2
82
83 disable_service n-net
84 enable_service q-svc
85 enable_service q-agt
86 enable_service q-dhcp
87 enable_service q-meta
88 enable_service q-l3
89
90 Q_USE_SECGROUP=True
91 ENABLE_TENANT_VLANS=True
92 TENANT_VLAN_RANGE=1000:1999
93 PHYSICAL_NETWORK=default
94 OVS_PHYSICAL_BRIDGE=br-ex
95
96In this configuration we are defining FLOATING_RANGE to be a
97subnet that exists in the private RFC1918 address space - however in
98in a real setup FLOATING_RANGE would be a public IP address range.
99
100Neutron Networking with Open vSwitch and Provider Networks
101==========================================================
102
103In some instances, it is desirable to use Neutron's provider
104networking extension, so that networks that are configured on an
105external router can be utilized by Neutron, and instances created via
106Nova can attach to the network managed by the external router.
107
108For example, in some lab environments, a hardware router has been
109pre-configured by another party, and an OpenStack developer has been
110given a VLAN tag and IP address range, so that instances created via
111DevStack will use the external router for L3 connectivity, as opposed
112to the Neutron L3 service.
113
114
115Service Configuration
116---------------------
117
118**Control Node**
119
120In this example, the control node will run the majority of the
121OpenStack API and management services (Keystone, Glance,
122Nova, Neutron, etc..)
123
124
125**Compute Nodes**
126
127In this example, the nodes that will host guest instances will run
128the `neutron-openvswitch-agent` for network connectivity, as well as
129the compute service `nova-compute`.
130
131DevStack Configuration
132----------------------
133
134The following is a snippet of the DevStack configuration on the
135controller node.
136
137::
138
139 PUBLIC_INTERFACE=eth1
140
141 ## Neutron options
142 Q_USE_SECGROUP=True
143 ENABLE_TENANT_VLANS=True
144 TENANT_VLAN_RANGE=3001:4000
145 PHYSICAL_NETWORK=default
146 OVS_PHYSICAL_BRIDGE=br-ex
147
148 Q_USE_PROVIDER_NETWORKING=True
149 Q_L3_ENABLED=False
150
151 # Do not use Nova-Network
152 disable_service n-net
153
154 # Neutron
155 ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt
156
157 ## Neutron Networking options used to create Neutron Subnets
158
159 FIXED_RANGE="10.1.1.0/24"
160 PROVIDER_SUBNET_NAME="provider_net"
161 PROVIDER_NETWORK_TYPE="vlan"
162 SEGMENTATION_ID=2010
163
164In this configuration we are defining FIXED_RANGE to be a
165subnet that exists in the private RFC1918 address space - however in
166in a real setup FIXED_RANGE would be a public IP address range, so
167that you could access your instances from the public internet.
168
169The following is a snippet of the DevStack configuration on the
170compute node.
171
172::
173
174 # Services that a compute node runs
175 ENABLED_SERVICES=n-cpu,rabbit,q-agt
176
177 ## Neutron options
178 Q_USE_SECGROUP=True
179 ENABLE_TENANT_VLANS=True
180 TENANT_VLAN_RANGE=3001:4000
181 PHYSICAL_NETWORK=default
182 OVS_PHYSICAL_BRIDGE=br-ex
183 PUBLIC_INTERFACE=eth1
184 Q_USE_PROVIDER_NETWORKING=True
185 Q_L3_ENABLED=False
186
187When DevStack is configured to use provider networking (via
188`Q_USE_PROVIDER_NETWORKING` is True and `Q_L3_ENABLED` is False) -
189DevStack will automatically add the network interface defined in
190`PUBLIC_INTERFACE` to the `OVS_PHYSICAL_BRIDGE`
191
192For example, with the above configuration, a bridge is
193created, named `br-ex` which is managed by Open vSwitch, and the
194second interface on the compute node, `eth1` is attached to the
195bridge, to forward traffic sent by guest vms.