On Sun, Jan 2, 2022 at 1:01 PM Grant Taylor
<gtay...@gentoo.tnetconsulting.net> wrote:
>
> What I remember doing was re-configuring the (primary) network interface
> so that it came up without an IP address and was added as a member to a
> newly created bridge.  As part of that I moved the system's IP
> address(es) from the underlying Ethernet interface to the newly created
> Bridge interface.
>

That is basically what I had to do.

With systemd-networkd the relevant stuff in /etc/systemd/network was:
eth-bridge.network:
[Match]
Name=e*

[Network]
Bridge=brkvm

(you'll need a more specific name I'm guessing since you have more
than one interface - the name to match should be the physical
interface name)

brkvm.netdev:
[NetDev]
Name=brkvm
Kind=bridge

(this creates the bridge interface, which the physical interface will
attach to due to the previous file)

brkvm.network:
[Match]
Name=brkvm

[Network]
DNS=...
Address=...
Gateway=...

(this will give the bridge interface an IP/etc - most likely you'll
just set this file up the way you'd otherwise be setting up your
physical network.  This can use dhcp.)

Then you'll tell virt-manager to use the brkvm bridge for all your VMs
that you want bridged.  Note that you can also use this bridge for
things like containers if they use virtual interfaces.  They'll just
see the host network directly, with their own virtual interfaces, so
they can use DHCP to obtain IPs on the host network.

In your case with dual interfaces you'll want to put the bridge on
whichever interface you want shared.  The other interface can remain
untouched.

The brkvm interface will otherwise behave the way eth0 or whatever
used to behave before you attached it to the bridge.  Note that the
physical interface attached to the bridge will not have an IP.  It
just relays traffic from the bridge to the physical network.

You could also just drop the first file if you wanted to have a bridge
not attached to any physical networks.  VMs could still attach to it
and talk to each other.  Though, I think virt-manager might provide
other ways to do this.

All of the above are systemd-specific.  Most network managers provide
some proper way to set up a bridge and you should probably do that.
You can do it all with just a shell script instead I suppose.

-- 
Rich

Reply via email to