Score:0

Parallel OpenVPN Connection Over multiple Libvirt Network Interfaces

cn flag

Let's Say That I have 20 VMs (Host: Ubuntu, Using Qemu-KVM, libvirt) and that I would use different network interfaces for different groups of vms. (1-6 using Network1, 7-15 using Network2, 16-20 using Network3). The Network interfaces were created by libvirt. And I would want The network interfaces to use a openVPN connection. (So Network1 uses conn1, Network2 uses conn2, Network3 uses conn3) to serve the purpose which is that the first group of vms all use the conn1 and so on...
What I wouldn't want is to run the openvpn inside each VM.
So is there a way?
if so how advanced is the way (cause I'm kinda a newbie :) )
and How would I go about it? (I would even appreciate knowing what subject of networking I should study)

Score:0
za flag
  1. Create four bridges:
    • Internet access bridge
    • Network 1
    • Network 2
    • Network 3

Notice "Network N" bridges don't need to have an IP assigned on the host.

  1. Create three VPN Gateway VMs:
    • VPN1 participates in "Internet" and "Network 1"
    • ...
  2. Each of these VMs should run one OpenVPN client, which accesses its VPN through the "Internet" interface. The other "Network N" interface is for communicating with other VMs who happened to live the corresponding network bridge
  3. The rest VMs should only participate in the corresponding network (so no direct communication with the host) and have their corresponding VPN VM to be the default gateway.

I think this is easiest configuration to build and understand. Another way is to run all VPNs on the host and use policy routing or VRFs (which is essentially same thing) or network namespaces to assign VMs to corresponding VPN.

Fred Smith avatar
cn flag
Oh thanks for your help. although I don't understand what you just said 100%, at least I now know what to look into. P.S: sorry I can't upvote. not enough rep
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.