Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

OpenStack practice (2): Linux Bridge implementation of Local Network

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

version information

openstack version pike control node host openstack-controller (ubuntu 16.04.5) 172.27.34.37

Compute node host openstack-computer (ubuntu 16.04.5) 172.27.34.38

Mirrors cirros-0.3.3-x86_64-disk.img

Ubuntu installation details: Ubuntu 16.04.5 lvm installation full record

Openstack installation details: OpenStack practice (1): DevStack under Ubuntu 16.04 to build p version of OpenStack

Local network

Local networks are isolated from other networks and nodes. It is not connected to any physical NIC of the host, nor is it associated with any VLAN ID. An instance in the local network can only communicate with an instance located on the same node and on the same network. The local network is mainly used for stand-alone testing.

Target:cirros01 and cirros02 communicate, cirros03 does not communicate with cirros01 and cirros02, and all three virtual machines do not communicate with the host machine. The network topology is as follows:

1. Making Mirrors

Upload the media cirros-0.3.3-x86_64-disk.img to/tmp directory, image download address: http://download.cirros-cloud.net/

Making Mirrors:

root@openstack-controller:~# su - stackstack@openstack-controller:~$ source devstack/openrc admin adminstack@openstack-controller:~$ glance image-create --name cirros-cli --file /tmp/cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare --progress

View the new image:

2. Configure local network in ML2

1. Neutron uses ML2 as the core plugin by default. Edit the configuration file of ML2/etc/neutron/plugins/ml2/ml2_conf.ini for control nodes and compute nodes respectively.

tenant_network_types = local mechanism_drivers = linuxbridgetype_drivers = local,flat,vlan,gre,vxlan,geneve

2. Restart neutron service

stack@openstack-controller:~$ sudo systemctl restart devstack@q*

Creating a Local Network

1. Create local-network01

Next, configure the subnet

subnet is 172.16.1.0/24

Subnet segments are 172.16.1.2 to 172.16.1.50

2. Create localnetwork02

localnetwork01 is created. Similarly, localnetwork02 is created. The network segments are 172.16.1.51 to 172.16.1.100.

IV. Creating an instance

Because DHCP agent runs on the control node, the traffic of local network can only be limited to the local node, so DHCP request sent by instance deployed by compute node cannot reach the control node, and IP address cannot be obtained.

The instances in this article are located in the control node

1. View instance types

stack@openstack-controller:~$ nova flavor-list

This article selects m1.tiny

2. View host names and zones

stack@openstack-controller:~$ nova service-list

3. Specify the control node to start virtual machines cirros01 and cirros02, and the network is localnetwork01

stack@openstack-controller:~$ nova boot --flavor m1.tiny --image cirros-cli --availability-zone nova:openstack-controller --nic net-name=localnetwork01 cirros01

stack@openstack-controller:~$ nova boot --flavor m1.tiny --image cirros-cli --availability-zone nova:openstack-controller --nic net-name=localnetwork01 cirros02

4. Create a new virtual machine cirros03 with localnetwork02

stack@openstack-controller:~$ nova boot --flavor m1.tiny --image cirros-cli --availability-zone nova:openstack-controller --nic net-name=localnetwork02 cirros03

5. Console View New Instance

6. View Virtual Network Cards

Command View Tap

root@openstack-controller:~# brctl show

Control Panel View

You can see that Linux bridge01 brq91c5618d-18 contains the virtual network cards tap08d6746a-10 and tap4909a73b-da, and Linux bridge02 brq7bd9076e-84 contains the virtual network card tap3efd4160-79.

V. Testing

Log in to cirros01, cirros02, cirros03, ping each other and ping the host respectively

1.cirros01

The IP obtained is 172.16.1.19

ping cirros02 is connected, ping cirros03 is not connected to the host.

2.cirros02

The IP obtained is 172.16.1.12

ping cirros01 is connected, ping cirros03 is not connected to the host.

3.cirros03

The IP obtained is 172.16.1.52

ping cirros01, cirros02, and the host do not work.

Test results met expectations

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report