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

How to learn the basics of KVM Network Virtualization

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

Share

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

This article to share with you is about how to learn KVM network virtualization foundation, Xiaobian think quite practical, so share to everyone to learn, I hope you can have some harvest after reading this article, not much to say, follow Xiaobian to see it.

Network virtualization is the most complex part of virtualization technology and the most difficult to learn. However, because the network is a very important resource in virtualization, it must be chewed down even if it is hard.

To give you an idea of the complexity of virtualized networks, look at the following diagram

This is the logical diagram of the virtual network of compute nodes (which can be understood as KVM hosts) given on the OpenStack official website. There are many network devices on it, and the hierarchy is also very complex.

The first time I saw this picture, I was really jumped.

However, don't be afraid. A skyscraper rises from the ground. No matter how complex the virtual network is, it is also composed of some basic components. As long as we understand the concept of these basic components and the logical relationship between them, we can deeply understand the architecture of virtual networks, and then virtualized networks in cloud environments are not a problem.

Let's learn about two of the most important things in network virtualization: Linux Bridge and VLAN

Linux Bridge Basic concepts

Suppose the host has a physical NIC eth0 connected to the external network, and a VM1 runs on it. Now there is a question: How can VM1 access the external network?

There are at least two options.

Assign physical NIC eth0 directly to VM1, but there are many problems with it:

The host does not have a network card and cannot be accessed;

New virtual machines, such as VM2, also don't have a NIC.

See below for recommended solutions.

Assign VM1 a virtual network card vnet0, connect eth0 and vnet0 through Linux Bridge br0, as shown in the following figure.

Linux Bridge is a device used to do TCP/IP Layer 2 protocol switching on Linux. Its function can be simply understood as a Layer 2 switch or Hub. Multiple network devices can be connected to the same Linux Bridge, and when one device receives a packet, Linux Bridge forwards the data to the other devices.

In the above example, when data arrives at eth0, br0 forwards the data to vnet0, so that VM1 can receive data from the external network; in turn, VM1 sends data to vnet0, and br0 forwards the data to eth0, thus achieving communication between VM1 and the external network.

Now we add a VM2, as shown below

VM2's virtual NIC vnet1 is also connected to br0. VM1 and VM2 can now communicate with each other, and both VM1 and VM2 can communicate with the external network.

The above is how to learn the basics of KVM network virtualization, Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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