Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to enable local network in ML2

Shulou Source: shulou.com Published: 2022-06-01 00:43:03 09月21日 Update

This article introduces you how to enable local network in ML2, the content is very detailed, interested friends can refer to, hope to be helpful to you.

The editor will create a variety of Neutorn networks, and we will first discuss local network.

The characteristic of local network is that it is not connected to any physical network card of the host, nor is it associated with any VLAN ID.

A bridge,instance is created for each local netwrok,ML2 linux-bridge and the tap device is connected to the bridge. Instance located in the same local network will connect to the same bridge so that the instance can communicate with each other.

Because bridge is not connected to the physical network card, instance cannot communicate with a network other than the host. At the same time, because each local network has its own bridge,bridge, there is no connection between the two local network, even if they are on the same host.

An example of local network:

Two local network are created, corresponding to two bridges, brqXXXX and brqYYYY.

VM0 and VM1 connect to brqXXXX through tap0 and tap1.

VM2 connects to brqYYYY through tap2.

VM0 and VM1 are in the same local network and can communicate with each other.

VM2 is located in another local network, and because brqXXXX and brqYYYY are not connected, VM2 cannot communicate with VM0 and VM1.

Next we will implement local network step by step.

Enable local network in ML2 configuration

Before creating a local network, make sure that ML2 has loaded local type driver. The configuration file for ML2 is located in / etc/neutron/plugins/ml2/ml2_conf.ini.

Type_drivers tells ML2 to load type driver for all five networks.

Type_drivers = local,flat,vlan,gre,vxlan

In this way we can create all types of networks (although only local networks are created in this section).

Both ordinary users and admin can create a network through CLI or Web GUI, but only amdin can specify the type of the network, so you need to use tenant_network_types to tell ML2 what kind of type network is created by default when ordinary users create a network in their Tenant (Project), where type is local.

Tenant_network_types = local

Tenant_network_types can specify a variety of type, such as:

Tenant_network_types = vlan, local

Its purpose is to create a vlan network first, and then create a local network when there is no vlan to create (such as running out of vlan id).

When the configuration file changes, you need to restart the Neutron-related services to take effect.

On how to enable local network in ML2 to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Network communication between two host configuration normal content host file more user network card help yes same creative function interest only Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS NVidia Linux Shulou Information Microsoft