Yes, mostly as others have reported in replies to your post.
The key bit is bridge - and I suspect this will never become the
as-shipped configuration by default, because of potential complications, security, etc.
So bridge, you'll almost certainly need the relevant package(s), e.g. bridge-utils. I've always done this without Network Manager, using
instead the basic if-up, if-down, /etc/network/interfaces, etc. Your
results may vary in those regards (not sure how capable Network Manager
is or would be for such, but I'd guess it ought be sufficiently
capable).
So, bridge, as other(s) have pointed out, wired Ethernet interface,
might be possible on (some) Wi-Fi, but many Wi-Fi interfaces and/or
their APs/routers thereof won't handle/allow it or pass the relevant
traffic, etc.
So, key bits with bridge, you can have multiple IP addresses on bridge, different subnets, etc., and likewise also tie multiple interfaces on
same bridge - the latter bit is the key point - they all have access to
that same traffic (for better and/or worse), possibly excepting if you
do some types of filtering on them (e.g. specific firewalling).
So, example, I've got physical interface eth0 (yeah, old school name, I
got tired of the interface name changing every time the hardware
changed in the slightest or even BIOS/CMOS/NVRAM was updated or settings
were changed, even with same Ethernet MAC address ... so ... I added
udev rule to pin the name to eth0), it's got direct raw Internet access
... it also has DHCP/ra, and possibly also DHCP6 servers on it, though
those automated means will give RFC-1918 IPv4 IPs that are behind
(external to the host) router NAT, but it gets raw direct unfiltered
Internet IPv6, and Internet IPv4 is directly available also if so
(statically) configured for it.
So, the bridge configuration, example from this host (and in libvirt &
friends, I use both the default NAT and my bridged configuration,
depending what I want for the VM). Relevant bits from
/etc/network/interfaces, and I omit showing some workarounds for an
apparently still present bug in the kernel's driver for the interface,
and also some IPv6 and other stuff to disable certain autoconfiguration:
auto br0
iface br0 inet static
bridge_waitport 0
bridge_ports eth0
address 96.86.170.226
netmask 255.255.255.248
network 96.86.170.224
broadcast 96.86.170.231
gateway 96.86.170.230
auto br0:0
allow-hotplug br0:0
iface br0:0 inet static
address 10.1.10.2/24
netmask 255.255.255.0
auto br0:1
allow-hotplug br0:1
iface br0:1 inet static
address 192.168.55.1
netmask 255.255.255.0
Note that the address of the physical host goes not on eth0, but on br0.
I also have multiple subnets on that interface. So, basically any
interface I bridge to that bridge interface can potentially talk
directly to and is very much on, all those subnets (if I want/need to
filter that out, there are other ways to do that).
So, on to libvirt & friends:
In virt-manager for, e.g. VM using bridge (br0) rather than default:
Show virtual hardware details (bulb icon)
click on the NIC
Details
Virtual Network Interface
Network source: bride device...
Device name: br0
$ virsh dumpxml balug | sed -ne '/<interface /,/<\/interface>/p'
<interface type='bridge'>
<mac address='52:54:00:13:51:99'/>
<source bridge='br0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
I typically build the VMs by copying, modifying, and running TEMPLATE
program I wrote:
https://www.mpaoli.net/~root/bin/TEMPLATE
which then leverages virt-install
Anyway, different VMs I'll set up different ways, depending what I
want/need. Some I'll put on the bridged interface, some on NAT, some
I'll even give two interfaces and put one on each, and depending what I need/want on each, I may do autoconfiguration of IPv4 and/or IPv6, or
they may be manually/"static" configurations - or even some of both for
same protocol and interface, and even different subnets, notably as the
br0 interface has multiple subnets on it.
And yes, allows me to do fairly complex network things. E.g. I've got quasi-"production" VM that typically has uptime exceeding the physical
hosts it resides on. As needed/desired, I live migrate it between the
two physical hosts - same Internet IP addresses, Ethernet MAC address,
etc., and with the lovely --copy-storage-all, it all manages that
without the two physical hosts even having any physical storage in
common, with virsh, etc. handling the data copy sync and transfer over
the network (and secured over ssh). So, yeah, balug.org - the VM
hosting that and fair number of other domains/sites ... yes, it live
migrates between physical hosts.
On Fri, Jun 6, 2025 at 11:11 AM Charles Curley <
charlescurley@charlescurley.com> wrote:
I'm setting up a new machine running trixie to run virtual machines,
using virt-manager. virt-manager sets up a natted network for the
virtual machines.
Is it possible to set things up so that the virtual machines are on the
same network as the host machine? The host is on 192.168.100.0/24. Can
I have the virtual machines also on 192.168.100.0?
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)