In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
This article will address a question: how does kvm guest use libvirt xml to define how to use virtual network?
1) nat, route, isolated, open type
Defining a virtual network in host creates a virtual bridge, which is equivalent to a switch. Guest only needs to connect to this switch.
Add to the xml of guest:
# virsh edit vm... Net1 is a virtual network that has been defined.
The above is the simplest xml, after saving will automatically add some necessary information, such as mac,pci address, model type and other information. Of course, it can also be specified manually.
2) user (Userspace SLIRP stack), vhost-user,Multicast tunnel, TCP tunnel,UDP unicast tunnel, etc.
Can only be referenced as interface in guest. For example, user is a type that can be used by non-privileged users provided by qemu. You can refer to it as follows:
(mac,pci address, model type will be automatically generated if it is not specified)
3) bridge (use an exsiting host linux bridge)
There is a linux bridge of its own, which can be defined as a network for guest (no more bridge will be created) or directly for guest. The two ways are essentially the same.
# virsh net-dumpxml birdge-net bridge-net # virsh edit vm... ...
You can also quote the bridge created by libvirt in (1) directly to guest:
4) macvtap (including four bridge,vepa,private,passthrough types), hostdev
You can define a network as an interface pool, refer to it in the form of network, or directly. With 3), the two ways are essentially the same.
Define interface pool
Direct-macvtap hostdev-net
Direct reference in guest
# virsh edit vm... ... # virsh edit vm... ...
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.