Ed B
2021-Apr-10 15:12 UTC
Confusion over networking configuration - I might be able to do some documentation
Hi libvirt users, I have been using libvirt on Debian Linux for a few months. (Mostly with virt-manager. I haven't yet learned all of the command line commands.) I'm currently confused by bridge mode networking, which I think is what I require to address the particular use case, which I will describe: My use case: Prior to this I have been using routed mode to organize my VMs. Most of the VMs I deploy are for services (web servers, mail servers, etc) so I require them to have static IP addresses on my local network. ==== An aside / comment: I *can* set those static IPs using the command line virsh net-edit (from memory) command and then change the settings in the xml files. However, since this seems like something that many users would require regularly it would be nice to be able to set static IP in the GUI when configuring with virt-manager. I assume that the same people who maintain libvirt also maintain virt-manager? If I'm wrong please re-direct me. Returning to the main discussion: It would be more convenient for me personally if I were able to set the IP addresses of these VMs using static addresses configured via an external DHCP server. I believe I can do this if my network is in "bridge" mode instead of NAT or Routed. I know this should be possible from reading information online but there doesn't seem to be any option for this in the virt-manager GUI. ==== To give more details on my setup: My network has a pfsense instance which is able to provide IP addresses to local machines. I would like to use the same pfsense machine to provide IP addresses to virtual machines. If I am not mistaken, the only way to do this would be to bridge the network on which the VMs reside to the network on which the pfsense machine resides. I will provide some screenshots to illustrate my confusion. When creating a new virtual network, I assume that I do not want to enable DHCPv4, because I want the pfsense system to allocate IP addresses. I do not know whether I should leave "Enable ipv4 network address space definition" or what the value should be. See image below. [cid:4e926d97-7a58-4350-93cc-0db7c401c075] Further in the setup (step 4), I assume I need to choose "Forward to physical network" rather than "Isolated virtual network". For the destination option, I do not know what should be chosen. I don't fully understand how this option works. For "Mode" there are three options: NAT, Routed and finally "Open". I cannot find any documentation which indicates what "Open" means. NAT and Routed are clearly not the correct options here - by a process of elimination that would imply that "Open" means "bridged" but I have a feeling that this is incorrect and I don't understand something else. Again, see screengrab below. [cid:f2ea4e34-c418-48d3-86b2-d7ff1002990a] I am quite keen to contribute something to documentation. At the moment I don't understand enough about how libvirt works to be able to do this. Apologies if my questions have been directed to the wrong people. If this is the case could you please re-direct me to the right place to ask such questions? Best regards -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20210410/a8388c73/attachment.htm> -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 51867 bytes Desc: image.png URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20210410/a8388c73/attachment.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 58888 bytes Desc: image.png URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20210410/a8388c73/attachment-0001.png>
Gianluca Cecchi
2021-Apr-12 12:28 UTC
Confusion over networking configuration - I might be able to do some documentation
On Mon, Apr 12, 2021 at 2:02 PM Ed B <HYPER-NOVA at live.co.uk> wrote:> > ==== To give more details on my setup: My network has a pfsense instance > which is able to provide IP addresses to local machines. I would like to > use the same pfsense machine to provide IP addresses to virtual machines. > If I am not mistaken, the only way to do this would be to bridge the > network on which the VMs reside to the network on which the pfsense machine > resides. > >If I compare with my Fedora 33 configuration (libvirt 3.0.0 and virt-manager 3.2.0) when you want bridged mode, you don't have to add a network, but when you add a vnic or customize an existing vnic, in network source you can put it on one of the existing virtual networks or you have two additional options: . Macvtap device . Bridge device So you should choose the last one HIH, Gianluca -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20210412/ab21f607/attachment.htm>
Pavel Hrdina
2021-Apr-12 19:04 UTC
Confusion over networking configuration - I might be able to do some documentation
On Sat, Apr 10, 2021 at 03:12:24PM +0000, Ed B wrote:> Hi libvirt users, > > I have been using libvirt on Debian Linux for a few months. (Mostly with virt-manager. I haven't yet learned all of the command line commands.) > > I'm currently confused by bridge mode networking, which I think is what I require to address the particular use case, which I will describe: > > My use case: > > Prior to this I have been using routed mode to organize my VMs. Most of the VMs I deploy are for services (web servers, mail servers, etc) so I require them to have static IP addresses on my local network. > > ==== An aside / comment: I *can* set those static IPs using the command line virsh net-edit (from memory) command and then change the settings in the xml files. However, since this seems like something that many users would require regularly it would be nice to be able to set static IP in the GUI when configuring with virt-manager. I assume that the same people who maintain libvirt also maintain virt-manager? If I'm wrong please re-direct me. > > Returning to the main discussion: It would be more convenient for me personally if I were able to set the IP addresses of these VMs using static addresses configured via an external DHCP server. I believe I can do this if my network is in "bridge" mode instead of NAT or Routed. I know this should be possible from reading information online but there doesn't seem to be any option for this in the virt-manager GUI. > > ==== To give more details on my setup: My network has a pfsense instance which is able to provide IP addresses to local machines. I would like to use the same pfsense machine to provide IP addresses to virtual machines. If I am not mistaken, the only way to do this would be to bridge the network on which the VMs reside to the network on which the pfsense machine resides. > > I will provide some screenshots to illustrate my confusion. When creating a new virtual network, I assume that I do not want to enable DHCPv4, because I want the pfsense system to allocate IP addresses. I do not know whether I should leave "Enable ipv4 network address space definition" or what the value should be. See image below. > > [cid:4e926d97-7a58-4350-93cc-0db7c401c075] > > > Further in the setup (step 4), I assume I need to choose "Forward to physical network" rather than "Isolated virtual network". > > For the destination option, I do not know what should be chosen. I don't fully understand how this option works. > > For "Mode" there are three options: NAT, Routed and finally "Open". I cannot find any documentation which indicates what "Open" means. NAT and Routed are clearly not the correct options here - by a process of elimination that would imply that "Open" means "bridged" but I have a feeling that this is incorrect and I don't understand something else. Again, see screengrab below. > > [cid:f2ea4e34-c418-48d3-86b2-d7ff1002990a] > > I am quite keen to contribute something to documentation. At the moment I don't understand enough about how libvirt works to be able to do this. > > Apologies if my questions have been directed to the wrong people. If this is the case could you please re-direct me to the right place to ask such questions? > > Best regardsHi, what you are looking for is no longer available using virt-manager. The functionality to create host network interfaces like bridge was removed in virt-manager 2.0.0. Looking at Debian packages the current stable release uses virt-manager 2.0.0. In order to create a bridge interface on your host you need to use other means. For example Debian has its own wiki [1] that describes the process. You will need to edit /etc/network/interfaces to create a permanent bridge configuration. Once you have the bridge created, you would be able to see it in virt-manager when installing new VMs or editing network interface for existing VMs where you simply pick your bridge. More details in `Debian/Ubuntu Bridging` here [2]. Pavel [1] <https://wiki.debian.org/BridgeNetworkConnections> [2] <https://wiki.libvirt.org/page/Networking#Debian.2FUbuntu_Bridging> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20210412/649711bf/attachment.sig>