Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How actually to setup Bridge interface in Debian Bookworm?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
afiadi
Posts: 12
Joined: 2021-07-22 11:57
Been thanked: 1 time

How actually to setup Bridge interface in Debian Bookworm?

#1 Post by afiadi »

Hai All
I've been spend 2 days for this problem but not getting being solved. But in Debian Bullseye there is no problem.
Oke this is for background informaton about my problem. I've installed Debian Bookworm upgrade from Debian Bullseye in my Laptop with host Fedora 35 in VMware workstation. In my vm i use 2 virtual network as a bridge then identified as ens33 and ens36 in vm. I create bridge network in Debian Bookworm(VM) guding from this tutorial. I'm using nmcli command
From official Debian:
https://wiki.debian.org/BridgeNetworkConnections
and
https://www.cyberciti.biz/faq/how-to-ad ... -on-linux/

All those guided is work, I'm successfuly create bridge interface on my VM or Debian Bookworm. But I realized this bridge interface. I named it bridge0 only can konek to my ip address in my lan, I tried to ping google this bridge0 interface receive destionation network unreachable. This is how i setup brigde in VM:
This is my active connection:

Code: Select all

$ sudo nmcli connection show --active
[sudo] password for afiadi: 
NAME               UUID                                  TYPE      DEVICE  
Sambungan kabel 1  d2335cdb-a578-3d3e-be00-a32570b17cf9  ethernet  ens33   
lxdbr0             2b8f65ba-b2d8-4a0f-b115-d9404edddba5  bridge    lxdbr0  
Sambungan kabel 2  6874079f-515f-3917-b7fe-31738885369a  ethernet  ens36   
docker0            4648a17f-c225-47cd-8da8-7bdbd23566c3  bridge    docker0 
virbr0             b0a32516[code]
-07cf-44be-841a-d8cdf0f71eb1 bridge virbr0
[/code]
Then I created bridge interface bridge0

Code: Select all

$ sudo nmcli connection add ifname bridge0 type bridge con-name bridge0
Koneksi 'bridge0' (1ca1e60c-7f1c-4fe4-88f4-d1387d2337b1) sukses ditambahkan.
$ sudo nmcli connection add type bridge-slave ifname ens33 master bridge0
Koneksi 'bridge-slave-ens33' (6cf8314b-103e-4f42-abd0-628e00de92e8) sukses ditambahkan.
Then shutdown interface ens33 and bringing up bridge0, show connection and bridge0 has IP address:

Code: Select all

$ sudo nmcli connection modify bridge0 bridge.stp no
$ nmcli -f bridge connection show bridge0
bridge.mac-address:                     --
bridge.stp:                             tidak
bridge.priority:                        32768
bridge.forward-delay:                   15
bridge.hello-time:                      2
bridge.max-age:                         20
bridge.ageing-time:                     300
bridge.group-forward-mask:              0
bridge.multicast-snooping:              ya
bridge.vlan-filtering:                  tidak
bridge.vlan-default-pvid:               1
bridge.vlans:                           --
$ sudo nmcli connection down "Sambungan kabel 1"
Koneksi 'Sambungan kabel 1' sukses dinonaktifkan (path aktif D-Bus: /org/freedesktop/NetworkManager/ActiveConnection/1)
$ sudo nmcli connection up bridge0
Koneksi sukses diaktifkan (master waiting for slaves) (path aktif D-Bus: /org/freedesktop/NetworkManager/ActiveConnection/8)
$ nmcli connection show
NAME                UUID                                  TYPE      DEVICE  
Sambungan kabel 2   6874079f-515f-3917-b7fe-31738885369a  ethernet  ens36   
bridge0             1ca1e60c-7f1c-4fe4-88f4-d1387d2337b1  bridge    bridge0 
lxdbr0              2b8f65ba-b2d8-4a0f-b115-d9404edddba5  bridge    lxdbr0  
docker0             4648a17f-c225-47cd-8da8-7bdbd23566c3  bridge    docker0 
virbr0              b0a32516-07cf-44be-841a-d8cdf0f71eb1  bridge    virbr0  
bridge-slave-ens33  6cf8314b-103e-4f42-abd0-628e00de92e8  ethernet  ens33   
Aishah              042a09d5-5e10-4e91-8037-c1fa4fd5089e  wifi      --      
Aishah 1            e6657586-6a99-4b2e-980e-39625ea94b09  wifi      --      
Aishah 2            6e3df94b-2de4-4361-ad35-3c011f264a73  wifi      --      
Aishah 3            b13c066f-405c-43ea-9bf7-1bdcab53ff15  wifi      --      
Sambungan kabel 1   d2335cdb-a578-3d3e-be00-a32570b17cf9  ethernet  --      
$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bridge0 state UP group default qlen 1000
    link/ether 00:0c:29:6a:7e:cb brd ff:ff:ff:ff:ff:ff
    altname enp2s1
3: ens36: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:6a:7e:d5 brd ff:ff:ff:ff:ff:ff
    altname enp2s4
    inet 192.168.1.9/24 brd 192.168.1.255 scope global noprefixroute ens36
       valid_lft forever preferred_lft forever
    inet6 fe80::47f4:afe5:bc7b:b239/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:e0:b0:be brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:2c:27:ea:68 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
6: lxdbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 00:16:3e:15:5c:6d brd ff:ff:ff:ff:ff:ff
    inet 10.160.20.1/24 scope global lxdbr0
       valid_lft forever preferred_lft forever
    inet6 fd42:a02e:7c83:d83c::1/64 scope global 
       valid_lft forever preferred_lft forever
7: bridge0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 22:92:36:84:25:8f brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.5/24 brd 192.168.1.255 scope global dynamic noprefixroute bridge0
       valid_lft 86331sec preferred_lft 86331sec
    inet6 fe80::2280:d9bf:7329:95ff/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
afiadi@debian-bookworm:~$ 

$ sudo bridge link show
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master bridge0 state forwarding priority 32 cost 100  
And this is the SS, after creating bridge0 the routing table like SS, below, still can ping gogole.com or has access to the internet because default is ens36
Image
This after ens36 default route I delete with ip route delete default
Image

My bridge0 still can connect to ip address in lan but always destination host unreachable if tried to ping to google.com or to internet. I don't know how to solve this problem I tried to Debian Bullseye that works perfectly and normally.. How to solve this problem so I can use bridge interface normally?

Thanks You in Advance
Best regards,
Afiadi

afiadi
Posts: 12
Joined: 2021-07-22 11:57
Been thanked: 1 time

Re: How actually to setup Bridge interface in Debian Bookworm?

#2 Post by afiadi »

I tried to fresh install Debian Bookworm in another laptop with VMware workstation, but still my bridge interface in VM cannot ping google. In the fresh installation I choose lxqt and lxde then i just to know if my debian use networking debian manager, with connman as GUI network manager. I tried to create file bridge0 in /etc/network./interfaces.d/bridge0.
with brct l show and ip addr the bridge0 is recognized and has bridge network master to ens33, but if i delete default route from ens34 the bridge0 still the same can't connect to the internet. Until now i can;t solved this problem, so sad. Can anyone have a clue to solve this problem, maybe I'm missed something. or maybe i must switch to systemd-networkd networking system, because I tried in systemd-networkd is working normally? if yes please give me valid link to guide me to switch my debian networking system to systemd-networkd..


Thank You in Advance
Best regards,
Afiadi

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 551
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 75 times
Been thanked: 85 times

Re: How actually to setup Bridge interface in Debian Bookworm?

#3 Post by wizard10000 »

Not necessarily the "right" way to do it but I cheated and used Network Manager to create the bridge and then just told virt-manager to use it.

I've been gonna migrate that setup to /etc/network and go back to connman but just haven't done it yet.
we see things not as they are, but as we are.
-- anais nin

afiadi
Posts: 12
Joined: 2021-07-22 11:57
Been thanked: 1 time

Re: How actually to setup Bridge interface in Debian Bookworm?

#4 Post by afiadi »

I'm sorry for late reply, If i use bridge0 in my LXD container with set in profile parent: bridge0 is working but still cannot ping google.com. I tried to forget about setting bridge in Debian Bookworm with networking.service, I try ti make static IP address, with editing adn append some configuration to /etc/network/interface .
This is my interfaces network:

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interfaceallow-hotplug ens33
#iface ens33 inet dhcp
iface ens33 inet static
      address 192.168.1.200
      netmask 255.255.255.0
      network 192.168.1.0
      broadcast 192.168.255
      gateway 192.168.1,1
      dns-domain debian-bookworm.kalibedadung.id
      dns-nameservers 192.168.1.1

allow-hotplug ens34
#iface ens34 inet manual
iface ens34 inet static
      address 192.168.1.210
      netmask 255.255.255.0
      network 192.168.1.0
      broadcast 192.168.255
      gateway 192.168.1,1
      dns-domain debian-bookworm.kalibedadung.id
      dns-nameservers 192.168.1.1
Image

But after i restart the ip address at interface ens33 and ens34 didn't change. This is so weird even I can't change static ip address in Debian Bookworm, Anyone can explain why networking.service won't change to my static ip address which is manually configure in /etc/nnetwork/interfaces? Why is too hard to configure ip static in DEbian Bookworm even I follow guidance in debian wiki or other relevant webiste providing this tutorial?
Any sugestion and clue I'll appreciate. This won't happen in other distro even in Debian Bullseye, but debian bullseye using NetworkManager daemon, I can make bridge interface at Debian Bullseye.

Thank You in Advance

jmgibson1981
Posts: 294
Joined: 2015-06-07 14:38
Has thanked: 11 times
Been thanked: 32 times

Re: How actually to setup Bridge interface in Debian Bookworm?

#5 Post by jmgibson1981 »

Forgive me I don't see what you followed exactly.

NMCLI is a mess as far as I'm concerned. Go straight to the interfaces file. The one you posted above has no bridge. Your file also has a couple typos.

Code: Select all

gateway 192.168.1,1
comma where dot should be

Code: Select all

gateway 192.168.1.1
This is my entire bridge config file I use (adjusted for what I think you are looking for). Above my pay grade of course but some of the fields in the wiki imho are unnecessary, at least for me.

Code: Select all

auto lo
iface lo inet loopback

auto bridge0
iface bridge0 inet static
  address 192.168.1.5/24
  gateway 192.168.1.1
  dns-nameservers 192.168.1.1
  bridge_ports ens33
Done. If that isn't working then your issue is elsewhere.

*EDIT* This is in a virtual machine? You may need to enable some type of promiscuous mode for the virtual machines network in the vmware. I've had to do that on Virtual box when nesting containers in vms.

Post Reply