C
C
Caretaker2019-02-07 19:45:56
Debian
Caretaker, 2019-02-07 19:45:56

How to set up KVM virtualization with two bridges?

Greetings.
Input:
cat /etc/network/interfaces

auto lo
iface lo inet loopback

auto enp1s0f0
iface enp1s0f0 inet manual

auto br0
iface br0 inet static
    address XXX.XXX.XXX.AAA
    netmask 255.255.255.238
    gateway XXX.XXX.XXX.GGG
    network XXX.XXX.XXX.0
    broadcast XXX.XXX.XXX.255

    bridge_ports enp1s0f0
    bridge_maxwait 0
    bridge_stp off
    bridge_fd 0

auto br1
iface br1 inet static
    address 10.0.0.250
    netmask 255.255.255.0
    network 10.0.0.0

    bridge_ports none
    bridge_fd 0

There are 2 "LXC containers" running on the server, which are configured for these "bridges" and each has its own external IP-shnik (on br0), through which it goes to the outside world, and a local type (on br1) through which containers and the host communicate between themselves. Plus one "LXC-container", which works only through br1, does not have its own "exit to the world" and exits through the NAT of the host (on the host machine, packet forwarding 10.0.0.0/24 => enp1s0f0 is configured and it works).
It was required to run a "container" with strict limits on available resources. But since the way to control the use of memory in particular LXC is not suitable (you can’t beat the software, but it eats memory like a troglodyte until there is nothing left available). We started looking towards KVM, but we can’t configure it so that it works according to the principle of the third LXC container (not having its own Internet access via br1, but communicating with the outside world and other virtual machines and the host via br1).
Please help...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2019-02-07
@zuart

How will KVM help you, and indeed any virtualization in principle, if you can’t kill the soft, but it eats up memory without restrictions? All the same OOM will be.
Setting up a KVM network for your case is no different, give it one vif hooked to br1 and 10.0.0.250/24 as the default gateway. Except perhaps the fact that you need to specify the IP addressing settings in the guest itself. Well, or configure dhcp.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question