OpenStack Train version of dual-node installation (12) create a virtual network
Part 12 Creating a Virtual Network
preparations
1. Check network communication between nodes
ping at the control node
ping c1
ping 10.8.20.42
2. Delete NetworkManager package
Execution at both control and compute nodes
yum remove NetworkManager -y
create a virtual network
Creating virtual networks involves creating networks and subnets, which can be created using both command line and dashboard methods.
The following command line is used to create a virtual network in the control node. The operation mode of dashboard is not described here.
create a network
. admin-openrc
openstack network create --share --external --provider-physical-network provider --provider-network-type flat vm-network
Parameter Description:
--share indicates that all projects can use this network, otherwise only the creator can use it.
--external indicates external network
--provider-physical-network provider
Indicates the provider of the physical network, corresponding to the following neutron configuration file, where provider is a label, which can be changed to other, but the two places must be unified.
[ml2_type_flat]
flat_networks = provider
--provider-network-type flat
Indicates that the network created here is flat type, that is, when the instance connects to this network, it is in the same network segment as the physical network and has no vlan and other functions.
vm-network Network name
create subnets
This creates a Layer 2 network, so the subnet and the external network are a segment.
openstack subnet create --network vm-network --allocation-pool start=10.8.20.50,end=10.8.20.60 --dns-nameserver 10.8.20.1 --gateway 10.8.20.1 --subnet-range 10.8.20.0/24 vm-subnetwork
Parameter Description:
--network indicates the parent network
--allocation-pool start= 10.8.20.50, end =10.8.20.60 Indicates the subnet start and end addresses
--dns-nameserver Indicates the DNS server
--gateway indicates the gateway address
--subnet-range indicates the subnet segment
vm-subnetwork subnet name
check the network configuration
Do the following at the control node
. admin-openrc
openstack network list
ip a
You can see that a bridge brqb81e99e7 -4c and a tap device tapac26 de13-99@if2 have been created. Their specific functions are described in the following section.
Restart the network.
systemctl restart network
Check the network card information again
ip a
You can see that eth2 has been bridged under brqb81e99e7-4c, which is the effect to be achieved.
Install brctl again to view
yum install bridge-utils -y
brctl show
Since the bridge of the compute node in the experiment is created after the first instance is started, it is possible to not check the compute node first.