0

I am playing around with KVM and bridge network on a Debian 10 Host

Many tutorials tell to set the /etc/network/interfaces to something like this:

# The primary network interface
auto eth0
iface eth0 inet manual # was dhcp with ip 192.168.188.30 before

# bridge interface for kvm
auto br1
iface br1 inet static
bridge_ports eth0
bridge_stp off
address 192.168.188.246
network 192.168.188.0
netmask 255.255.255.0
broadcast 192.168.188.255
gateway 192.168.188.1
dns-nameservers 8.8.8.8

Why iface eth0 inet manual which makes the pc no longer available through 192.168.188.30?

Gladly I can reach the pc over 192.168.188.246 now.

Even when I set eth0 back to iface eth0 inet dhcp as long as the bridge network is defined I cannot reach the pc over 192.168.188.30 only 192.168.188.246 works.

What if I "apply" 192.168.188.246 to a KVM VM. I assume I would lock my self out, since I have no way to reach the host pc - only the VM (Did not test, scared, playing with remote sandbox)? If true, how can I be sure to always reach the host pc. Do I add another bridge br-host with 192.168.188.xx which will never be "applied" to a VM?

Basically I don't get why the default eth0 needs to be shut off (manual).

Edit: just to make clear

works for 192.168.188.30: dhcp

auto eth0
iface eth0 inet dhcp

# no bridge

works for 192.168.188.250

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.188.250
network 192.168.188.0
netmask 255.255.255.0
broadcast 192.168.188.255
gateway 192.168.188.1
dns-nameservers 8.8.8.8

# no bridge

does only work for 192.168.188.246 not 192.168.188.30:

# The primary network interface
auto eth0
iface eth0 inet dhcp <----- still dhcp

# bridge interface for kvm
auto br1
iface br1 inet static
bridge_ports eth0
bridge_stp off
address 192.168.188.246
network 192.168.188.0
netmask 255.255.255.0
broadcast 192.168.188.255
gateway 192.168.188.1
dns-nameservers 8.8.8.8

does only work for 192.168.188.246 not 192.168.188.250:

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.188.250
network 192.168.188.0
netmask 255.255.255.0
broadcast 192.168.188.255
gateway 192.168.188.1
dns-nameservers 8.8.8.8


# bridge interface for kvm
auto br1
iface br1 inet static
bridge_ports eth0
bridge_stp off
address 192.168.188.246
network 192.168.188.0
netmask 255.255.255.0
broadcast 192.168.188.255
gateway 192.168.188.1
dns-nameservers 8.8.8.8

EDIT 2

I had a missunderstanding. I thought the host is responsible for getting all the IP adresses which will then applied to the guests. I can just set the IP on the guest and it works. Now everything makes sense. Just had wrong assumption about bridge networks.

  • You haven't configured 192.168.188.30 as an address anywhere. Why would you expect it to be used? – Michael Hampton Feb 09 '21 at 20:27
  • @MichaelHampton even when i keep the default eth0, br1 will "overwrite" it.. see edit – TomGrill Games Feb 09 '21 at 20:49
  • If you wanted to use DHCP, then why did you configure a static address? – Michael Hampton Feb 09 '21 at 20:59
  • 1
    In other words, why not use DHCP for br1? Currently, if you applied 192.168.188.246 to a VM, the VM would have the same address as the bridge, which would probably make you unable to keep a connection to either. – berndbausch Feb 09 '21 at 22:00
  • I had a missunderstanding. I thought the host is responsible for getting all the IP adresses which will then applied to the guests. I can just set the IP on the guest and it works. Now everything makes sense. Just had wrong assumption about bridge networks. – TomGrill Games Feb 10 '21 at 19:08
  • consider every guest as own physical computer. From the network perspective these are the same. How can any computer to be "responsible for getting IP addresses" of other computers? – Nikita Kipriyanov Feb 19 '21 at 17:36

0 Answers0