@@ -21,18 +21,23 @@ Switch configuration format::
2121 # interface will restore the default_vlan.
2222 ngs_port_default_vlan = <port default vlan>
2323
24+ The ``device_type `` entry is mandatory. Most other configuration entries
25+ are optional, see below.
26+
2427.. note ::
2528
2629 Switch will be selected by local_link_connection/switch_info
2730 or ngs_mac_address. So, you can use the switch MAC address to identify
2831 switches if local_link_connection/switch_info is not set.
2932
3033Examples
31- --------
34+ ========
35+
36+ These example device configuration snippets are assumed to be part to a
37+ specific file ``/etc/neutron/plugins/ml2/ml2_conf_genericswitch.ini ``, but
38+ they could also be added directly to ``/etc/neutron/plugins/ml2/ml2_conf.ini ``.
3239
33- Here is an example of
34- ``/etc/neutron/plugins/ml2/ml2_conf_genericswitch.ini ``
35- for the Cisco 300 series device::
40+ Here is an example for the Cisco 300 series device::
3641
3742 [genericswitch:sw-hostname]
3843 device_type = netmiko_cisco_s300
@@ -192,6 +197,9 @@ for an ArubaOS-CX switch::
192197 password = password
193198 ip = <switch mgmt ip address>
194199
200+ General configuration
201+ =====================
202+
195203Additionally the ``GenericSwitch `` mechanism driver needs to be enabled from
196204the ml2 config file ``/etc/neutron/plugins/ml2/ml2_conf.ini ``::
197205
@@ -200,9 +208,24 @@ the ml2 config file ``/etc/neutron/plugins/ml2/ml2_conf.ini``::
200208 type_drivers = local,flat,vlan,gre,vxlan
201209 mechanism_drivers = openvswitch,genericswitch
202210 ...
203- ...
204211
205- (Re)start ``neutron-server `` specifying this additional configuration file::
212+ Physical networks need to be declared in the ML2 config as well, with a range
213+ of VLANs that can be allocated to tenant networks. Several physical networks
214+ can coexist, possibly with overlapping VLAN ranges: in that case, each switch
215+ configuration needs to include its physical network, see :ref: `physicalnetworks `.
216+ Example of ``/etc/neutron/plugins/ml2/ml2_conf.ini `` with two physical networks::
217+
218+ [ml2_type_vlan]
219+ network_vlan_ranges = physnet1:700:799,physnet2:600:850
220+
221+ For a given physical network, it is possible to specify several disjoint
222+ ranges of VLANs by simply repeating the physical network name multiple times::
223+
224+ [ml2_type_vlan]
225+ network_vlan_ranges = physnet1:700:720,physnet1:750:760
226+
227+ (Re)start ``neutron-server `` specifying the additional configuration file
228+ containing switch configuration::
206229
207230 neutron-server \
208231 --config-file /etc/neutron/neutron.conf \
@@ -294,10 +317,12 @@ A particular case where this can cause problems is when a VLAN used for
294317the switch management interface, or any other port not managed by Neutron,
295318is removed by this Neutron driver.
296319
297- To stop networking generic switch trying to add or remove VLANs on the switch
298- administrator are expected to pre-add all enabled VLANs. Once those VLANs are
299- preconfigured on the switch, you can use the following configuration to stop
300- networking generic switch adding or removing any VLANs::
320+ To stop networking generic switch trying to add or remove VLANs on the switch,
321+ administrator are expected to pre-add all enabled VLANs as well as tagging
322+ these VLANs on trunk ports.
323+ Once those VLANs and trunk ports are preconfigured on the switch, you can
324+ use the following configuration to stop networking generic switch adding or
325+ removing any VLANs::
301326
302327 [genericswitch:device-hostname]
303328 ngs_manage_vlans = False
@@ -314,3 +339,50 @@ can be disabled::
314339
315340 [genericswitch:device-hostname]
316341 ngs_save_configuration = False
342+
343+ Trunk ports
344+ ===========
345+
346+ When VLANs are created on the switches, it is common to want to tag these
347+ VLANS on one or more trunk ports. To do this, you need to declare a
348+ comma-separated list of trunk ports that can be managed by Networking Generic
349+ Switch. It will then dynamically tag and untag VLANs on these ports whenever
350+ it creates and deletes VLANs. For example::
351+
352+ [genericswitch:device-hostname]
353+ ngs_trunk_ports = Ethernet1/48, Port-channel1
354+
355+ This is useful when managing several switches in the same physical network,
356+ because they are likely to be interconnected with trunk links.
357+ Another important use-case is to connect the DHCP agent with a trunk port,
358+ because the agent needs access to all active VLANs.
359+
360+ Note that this option is only used if ``ngs_manage_vlans = True ``.
361+
362+ .. _physicalnetworks :
363+
364+ Multiple physical networks
365+ ==========================
366+
367+ It is possible to use Networking Generic Switch to manage several physical
368+ networks. The desired physical network is selected by the Neutron API client
369+ when it creates the network object.
370+
371+ In this case, you may want to only create VLANs on switches that belong to the
372+ requested physical network, especially because VLAN ranges from separate
373+ physical networks may overlap. This also improves reconfiguration performance
374+ because fewer switches will need to be configured whenever a network is
375+ created/deleted.
376+
377+ To this end, each switch can be configured with a list of physical networks
378+ it belongs to::
379+
380+ [genericswitch:device-hostname]
381+ ngs_physical_networks = physnet1, physnet2
382+
383+ Physical network names should match the names defined in the ML2 configuration.
384+
385+ If no physical network is declared in a switch configuration, then VLANs for
386+ all physical networks will be created on this switch.
387+
388+ Note that this option is only used if ``ngs_manage_vlans = True ``.
0 commit comments