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

What are the ways of networking virtual machines?

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

Share

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

This article introduces the relevant knowledge of "what are the virtual machine networking methods". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

Why do you need a virtual network? I'm pulling a cable in the real world, okay? In fact, it is completely OK, but if you do this, the cost will be very high, mainly in the following aspects:

1 , the customer needs a system, OK , to buy a server for the customer to use. A server can be used for at least 10 years. During this period, customers and you have dissolved the partnership. Do you still want this server? Don't forget, buy this server at that time, but spent the price, but also put the server in the cabinet, wiring and so on these processes.

2. The customer said,"I don't have enough memory in this system. What should I do?" I'm using a real server. What else can I do? Take the server down and put the memory stick back on. this process, if the client side is still using the server, you just get it down like this? there is another point. this process requires manual labor. is this labor cost included? A need for a person, if the scale up, tens of thousands of servers, including 100 servers need to replace memory, and then use manpower to solve the problem?

3. Low utilization rate of resources. The client only needs a 4-core 8G configuration, but the server generally does not have such a low configuration, so what about the remaining resources? Just sit idle.

4 , this server I gave this user to use, and then the use period expired, this user did not renew, is it necessary to reinstall the system after the next customer can use?

That's a big demand, right? So there's the concept of virtual machines.

Virtual machines want to access the Internet, you need to talk about virtual machines in the network is how to work.

If you've moved virtual machines around on your laptop, you'll be familiar with the three ways virtual machines can be networked: host-only, bridged, and NAT.

host-only mode

This pattern, generally not used, but also to introduce.

This mode provides only mutual access between physical machines and virtual machines, only data exchange between physical machines and virtual machines can be realized, but virtual machines have no way to access the Internet. There are two ways to exchange data between physical machines and virtual machines: dynamic IP addresses and static IP addresses.

If you are using dynamic IP addresses, you need to do one more step: share your network. If static IP addresses are used, the IP settings, gateway, DNS settings of the virtual machine should be the same as those of the virtual machine NIC.

At this point, your virtual machine is accessible to your physical machine.

But please note that your virtual machine cannot access the Internet at this time!!!

Host-only mode is only responsible for making your virtual machines and physical machines accessible to each other, not for networking your virtual machines. So this pattern, it's not commonly used.

After all, you flip virtual machines so you can build a cluster or something online, right?

Bridge mode

Bridging, bridging means that everyone is in the same area, but it needs a bridge to connect them.

There is a premise: that is, everyone should be in an area, that is, distance can not be too far. Otherwise you're at the North Pole and I'm at the South Pole, and the bridge doesn't work, right.

In this way, networking virtual machines is the fastest. Because it is similar to you have another computer in the local area network, as long as the virtual machine is located in the physical machine can access the Internet, then through the bridge mode, you can also access the Internet.

However, one thing to note is to ensure that the virtual machine IP and IP in the local area network does not conflict.

If your physical machine is located in the local area network IP address is not limited, use this method on the line, and relatively friendly to beginners. If IP addresses are scarce, it is best not to use this method to access the Internet.

NAT ( Network address translate ) mode

In fact, NAT networking this way, not only in virtual machines have applications, in practice there are applications. For example: your company bought a public IP : 114.114.114.114, but you found that there are many IP addresses in the company.

This is the NAT pattern. The specific working principle is: an IP address inside the company is 192.168.111.111 This address wants to access the Internet , at this time the IP address sent by the request will be packaged into a packet, and then this packet will pass through a gateway or router, the gateway or router IP address is the public network IP bought by the company. This gateway or router in order to send data packets, packets of IP protocol layer data changes (that is NAT ), so you can very smoothly access the Internet . The existence of this method solves two problems: 1 , the scarcity of IP addresses; 2 , the company's local area network IP can also access the Internet.

The same is true for NAT mode Internet access in virtual machines. So the virtual machine network IP address, even if the physical machine and the IP address of the local area network is not the same, even not in a network segment, is OK. In this case, the IP address of the physical machine is equivalent to the gateway of the virtual machine, so in this mode, the virtual machine can ping the physical machine, but the physical machine cannot ping the virtual machine.

In this mode, there are two ways to network: one is to obtain IP address dynamically, another is to set static IP address.

Similarly, for novices, virtual machine networking mode, using dynamic access to IP address is good, specifically in the configuration file, just need to change onboot to yes , and then restart the network card, virtual machine can be connected to the network.

If you want to set a static IP address, you need to modify the gateway, subnet mask and DNS of the virtual machine NIC.

"What are the virtual machine networking methods?" The content is introduced here. Thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

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

Internet Technology

Wechat

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

12
Report