You are not logged in.

#1 2023-11-05 10:11:37

grimor
Member
From: Spain
Registered: 2023-10-27
Posts: 21

[SOLVED] bridge-utils doesn't work with network bridge

I want to create a network bridge for QEMU command-line.

With bridge-utils:

# pacman -S bridge-utils

# brctl addbr br0

$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff

# brctl addif br0 enp2s0

# brctl show
bridge name	bridge id		STP enabled	interfaces
br0		8000.6e5dd845f209	no		enp2s0

# ip link set dev br0 up

$ ping -c 2 archlinux.org
ping: archlinux.org: Temporary failure in name resolution

But without network bridge works fine:

# ping -c 2 archlinux.org
PING archlinux.org (95.217.163.246) 56(84) bytes of data.
64 bytes from archlinux.org (95.217.163.246): icmp_seq=1 ttl=50 time=60.1 ms
64 bytes from archlinux.org (95.217.163.246): icmp_seq=2 ttl=50 time=60.1 ms

--- archlinux.org ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 60.103/60.121/60.140/0.018 ms

Last edited by grimor (2023-11-20 11:01:31)

Offline

#2 2023-11-06 10:31:47

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,102

Re: [SOLVED] bridge-utils doesn't work with network bridge

You need to give the bridge an ip-address and default route.

On a system where the bridge takes over the main network interface, you typically use the same ip-address & route used by the main card before it became a bridge.

https://wiki.archlinux.org/title/Networ … nterface_2 has more details


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2023-11-06 12:50:12

grimor
Member
From: Spain
Registered: 2023-10-27
Posts: 21

Re: [SOLVED] bridge-utils doesn't work with network bridge

Thanks for your answer, Lone_Wolf.

$ ip address show enp2s0
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.18.59/24 brd 192.168.18.255 scope global dynamic noprefixroute enp2s0
       valid_lft 3336sec preferred_lft 3336sec
    inet6 fe80::448c:9b75:e8d5:22b7/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
       
$ ip route show dev enp2s0
default via 192.168.18.1 proto dhcp src 192.168.18.59 metric 100 
192.168.18.0/24 proto kernel scope link src 192.168.18.59 metric 100

# brctl addbr br0

# ip address add 192.168.18.59/24 dev br0

# ip link set dev br0 up

# brctl addif br0 enp2s0 ; ip address del 192.168.18.59/24 dev enp2s0

$ ping -c 2 archlinux.org
ping: archlinux.org: Temporary failure in name resolution

I think tutorial doesn't explain how put default gateway (192.168.18.1)

Last edited by grimor (2023-11-20 11:02:06)

Offline

#4 2023-11-07 10:34:33

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,102

Re: [SOLVED] bridge-utils doesn't work with network bridge

Some more investigation is needed to verify basic network connectivity .

Please post the outputs of

$ ip route
$ ping -c 5 192.168.18.1
$ ping -c 5 95.217.163.246
$ ip -6 route
$ ping -c 5 2a01:4f9:c010:6b1f::1

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2023-11-07 15:33:40

grimor
Member
From: Spain
Registered: 2023-10-27
Posts: 21

Re: [SOLVED] bridge-utils doesn't work with network bridge

Thanks again, Lone_Wolf.

$ ip route
default via 192.168.18.1 dev enp2s0 proto dhcp src 192.168.18.59 metric 100 
192.168.18.0/24 dev enp2s0 proto kernel scope link src 192.168.18.59 metric 100


$ ping -c 5 192.168.18.1
PING 192.168.18.1 (192.168.18.1) 56(84) bytes of data.
64 bytes from 192.168.18.1: icmp_seq=1 ttl=64 time=0.695 ms
64 bytes from 192.168.18.1: icmp_seq=2 ttl=64 time=0.596 ms
64 bytes from 192.168.18.1: icmp_seq=3 ttl=64 time=0.584 ms
64 bytes from 192.168.18.1: icmp_seq=4 ttl=64 time=0.644 ms
64 bytes from 192.168.18.1: icmp_seq=5 ttl=64 time=0.668 ms

--- 192.168.18.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4054ms
rtt min/avg/max/mdev = 0.584/0.637/0.695/0.042 ms


$ ping -c 5 95.217.163.246
PING 95.217.163.246 (95.217.163.246) 56(84) bytes of data.
64 bytes from 95.217.163.246: icmp_seq=1 ttl=50 time=60.2 ms
64 bytes from 95.217.163.246: icmp_seq=2 ttl=50 time=60.0 ms
64 bytes from 95.217.163.246: icmp_seq=3 ttl=50 time=60.1 ms
64 bytes from 95.217.163.246: icmp_seq=4 ttl=50 time=60.1 ms
64 bytes from 95.217.163.246: icmp_seq=5 ttl=50 time=60.1 ms

--- 95.217.163.246 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 60.021/60.069/60.154/0.044 ms


$ ip -6 route
fe80::/64 dev enp2s0 proto kernel metric 1024 pref medium


$ ping -c 5 2a01:4f9:c010:6b1f::1
ping: connect: Network is unreachable

Offline

#6 2023-11-08 11:38:52

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,102

Re: [SOLVED] bridge-utils doesn't work with network bridge

$ ping -4 -c 5 archlinux.org

Also please post from before the bridge is setup

$ ip address
$ ip route
$ ip -6 route

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#7 2023-11-08 17:27:14

grimor
Member
From: Spain
Registered: 2023-10-27
Posts: 21

Re: [SOLVED] bridge-utils doesn't work with network bridge

Thanks, Lone_Wolf.

$ ping -4 -c 5 archlinux.org
PING archlinux.org (95.217.163.246) 56(84) bytes of data.
64 bytes from archlinux.org (95.217.163.246): icmp_seq=1 ttl=50 time=60.3 ms
64 bytes from archlinux.org (95.217.163.246): icmp_seq=2 ttl=50 time=60.1 ms
64 bytes from archlinux.org (95.217.163.246): icmp_seq=3 ttl=50 time=60.0 ms
64 bytes from archlinux.org (95.217.163.246): icmp_seq=4 ttl=50 time=60.3 ms
64 bytes from archlinux.org (95.217.163.246): icmp_seq=5 ttl=50 time=60.1 ms

--- archlinux.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4007ms
rtt min/avg/max/mdev = 59.992/60.150/60.285/0.106 ms


# brctl addbr br0


# ip address add 192.168.18.59/24 dev br0


$ ip address
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 noprefixroute 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether f4:6d:04:93:e0:fa brd ff:ff:ff:ff:ff:ff
    inet 192.168.18.59/24 brd 192.168.18.255 scope global dynamic noprefixroute enp2s0
       valid_lft 3144sec preferred_lft 3144sec
    inet6 fe80::448c:9b75:e8d5:22b7/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 6e:5d:d8:45:f2:09 brd ff:ff:ff:ff:ff:ff
    inet 192.168.18.59/24 scope global br0
       valid_lft forever preferred_lft forever
       
       
$ ip route
default via 192.168.18.1 dev enp2s0 proto dhcp src 192.168.18.59 metric 100 
192.168.18.0/24 dev enp2s0 proto kernel scope link src 192.168.18.59 metric 100


$ ip -6 route
fe80::/64 dev enp2s0 proto kernel metric 1024 pref medium

Offline

#8 2023-11-08 18:14:18

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,102

Re: [SOLVED] bridge-utils doesn't work with network bridge

You probably have an incorrect ipv6 setup in the bridged network, but I need to be sure.

Rephrasing:

boot your normal non-bridged network

run and post outputs of

$ ip address
$ ip route
$ ip -6 route

bringup the bridge and configure it, then run & post output of

$ ping -4 -c 5 archlinux.org

P.S. no need to thank me in every post


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#9 2023-11-09 12:12:50

grimor
Member
From: Spain
Registered: 2023-10-27
Posts: 21

Re: [SOLVED] bridge-utils doesn't work with network bridge

I don't have IPv6. My Internet provider took it away from me because it caused problems with Wi-Fi. But bridge-utils works fine on my Debian-based distributions:
https://wiki.debian.org/BridgeNetworkConnections


$ ip address
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 noprefixroute 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.18.59/24 brd 192.168.18.255 scope global dynamic noprefixroute enp2s0
       valid_lft 3370sec preferred_lft 3370sec
    inet6 fe80::448c:9b75:e8d5:22b7/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
       
       
$ ip route
default via 192.168.18.1 dev enp2s0 proto dhcp src 192.168.18.59 metric 100 
192.168.18.0/24 dev enp2s0 proto kernel scope link src 192.168.18.59 metric 100


$ ip -6 route
fe80::/64 dev enp2s0 proto kernel metric 1024 pref medium


# brctl addbr br0


# ip address add 192.168.18.59/24 br0
Error: either "local" is duplicate, or "br0" is a garbage.


# brctl addif br0 enp2s0 ; ip address del 192.168.18.59/24 dev enp2s0


$ ping -4 -c 5 archlinux.org
ping: connect: Network is unreachable

Last edited by grimor (2023-11-20 11:03:17)

Offline

#10 2023-11-09 13:11:35

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,102

Re: [SOLVED] bridge-utils doesn't work with network bridge

I don't have IPv6.

But bridge-utils works fine on my Debian-based distributions:
https://wiki.debian.org/BridgeNetworkConnections

That debian guide is for IPv4 networks, but on archlinux IPv6 is enabled by default .


Does the system the bridge is on exclusively use fixed wired ethernet ?
If so, disabling IPv6 completely seems like the best option for you.

https://wiki.archlinux.org/title/IPv6#D … ctionality mentions a kernel parameter that will do that.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#11 2023-11-09 16:00:03

grimor
Member
From: Spain
Registered: 2023-10-27
Posts: 21

Re: [SOLVED] bridge-utils doesn't work with network bridge

# nano /etc/sysctl.d/40-ipv6.conf

net.ipv6.conf.enp2s0.disable_ipv6 = 1


# systemctl restart systemd-sysctl.service


$ ip address
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
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.18.59/24 brd 192.168.18.255 scope global dynamic noprefixroute enp2s0
       valid_lft 3450sec preferred_lft 3450sec
       
       
$ ip -6 route


# brctl addbr br0


# ip address add 192.168.18.59/24 br0
Error: either "local" is duplicate, or "br0" is a garbage.


# ip link set dev br0 up


# brctl addif br0 enp2s0 ; ip address del 192.168.18.59/24 dev enp2s0


$ ping -c 2 archlinux.org
ping: archlinux.org: Temporary failure in name resolution

Same problem with kernel parameter:

linux /boot/vmlinuz-linux root=UUID=5c629824-747d-4824-868b-183755046566 rw quiet ipv6.disable=1

Last edited by grimor (2023-11-20 11:03:36)

Offline

#12 2023-11-09 17:05:55

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,102

Re: [SOLVED] bridge-utils doesn't work with network bridge

you did reboot after setting the kernel parameter ?

time to look at name resolving.

$ traceroute archlinux.org       #comes-with-traceroute_package
$ drill @1.1.1.1 archlinux.org #comes_with_ldns_package
$ drill archlinux.org

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#13 2023-11-09 18:15:27

grimor
Member
From: Spain
Registered: 2023-10-27
Posts: 21

Re: [SOLVED] bridge-utils doesn't work with network bridge

I add kernel parameters to the GRUB boot screen and I boot with F10 buttom:

yBXPh9Vl.png


With normal network (and without IPv6):

$ traceroute archlinux.org
traceroute to archlinux.org (95.217.163.246), 30 hops max, 60 byte packets
 1  _gateway (192.168.18.1)  0.393 ms * *
 2  84.236.214.1 (84.236.214.1)  4.340 ms  4.383 ms  4.427 ms
 3  192.168.120.21 (192.168.120.21)  3.035 ms  3.033 ms  3.063 ms
 4  10.50.45.125 (10.50.45.125)  3.087 ms  3.942 ms  3.986 ms
 5  10.50.111.217 (10.50.111.217)  9.716 ms  9.963 ms  10.463 ms
 6  10.50.43.254 (10.50.43.254)  10.701 ms *  9.191 ms
 7  185.1.192.151 (185.1.192.151)  39.216 ms  39.463 ms core9.fra.hetzner.com (213.239.252.18)  39.463 ms
 8  core31.hel1.hetzner.com (213.239.224.165)  59.787 ms core9.fra.hetzner.com (213.239.252.18)  39.501 ms  39.783 ms
 9  core32.hel1.hetzner.com (213.239.224.154)  60.356 ms spine1.cloud1.hel1.hetzner.com (88.198.249.90)  60.513 ms core31.hel1.hetzner.com (213.239.224.165)  60.265 ms
10  * spine1.cloud1.hel1.hetzner.com (88.198.245.254)  62.633 ms spine2.cloud1.hel1.hetzner.com (88.198.242.250)  60.802 ms
11  * 22680.your-cloud.host (65.108.116.185)  60.450 ms *
12  archlinux.org (95.217.163.246)  60.227 ms !X 22680.your-cloud.host (65.108.116.185)  60.329 ms  60.206 ms


$ drill @1.1.1.1 archlinux.org
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 14794
;; flags: qr rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 
;; QUESTION SECTION:
;; archlinux.org.	IN	A

;; ANSWER SECTION:
archlinux.org.	752	IN	A	95.217.163.246

;; AUTHORITY SECTION:

;; ADDITIONAL SECTION:

;; Query time: 9 msec
;; SERVER: 1.1.1.1
;; WHEN: Thu Nov  9 18:51:56 2023
;; MSG SIZE  rcvd: 47


$ drill archlinux.org
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 38345
;; flags: qr rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 0 
;; QUESTION SECTION:
;; archlinux.org.	IN	A

;; ANSWER SECTION:
archlinux.org.	2548	IN	A	95.217.163.246

;; AUTHORITY SECTION:
archlinux.org.	739	IN	NS	hydrogen.ns.hetzner.com.
archlinux.org.	739	IN	NS	helium.ns.hetzner.de.
archlinux.org.	739	IN	NS	oxygen.ns.hetzner.com.

;; ADDITIONAL SECTION:

;; Query time: 2 msec
;; SERVER: 84.236.142.142
;; WHEN: Thu Nov  9 18:52:39 2023
;; MSG SIZE  rcvd: 139

With "network bridge" (and without IPv6):

$ traceroute archlinux.org
ping: archlinux.org: Temporary failure in name resolution
Cannot handle "host" cmdline arg `archlinux.org' on position 1 (argc 1)


$ drill @1.1.1.1 archlinux.org
Error: error sending query: Could not send or receive, because of network error


$ drill archlinux.org
Error: error sending query: Could not send or receive, because of network error

Offline

#14 2023-11-11 11:59:56

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,102

Re: [SOLVED] bridge-utils doesn't work with network bridge

sanity check, with the bridge active & configured

$ ping -4 1.1.1.1
$ traceroute -4 1.1.1.1
$ drill -4 drill @1.1.1.1 archlinux.org

Incase all those 3 are succesfull, try

$ drill -4 archlinux.org
$ traceroute -4 archlinux.org

Last edited by Lone_Wolf (2023-11-11 12:02:34)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#15 2023-11-11 18:22:36

grimor
Member
From: Spain
Registered: 2023-10-27
Posts: 21

Re: [SOLVED] bridge-utils doesn't work with network bridge

# nano /etc/sysctl.d/40-ipv6.conf

net.ipv6.conf.enp2s0.disable_ipv6 = 1


# systemctl restart systemd-sysctl.service


$ ip address
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
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.18.59/24 brd 192.168.18.255 scope global dynamic noprefixroute enp2s0
    
    
# brctl addbr br0


# ip address add 192.168.18.59/24 br0
Error: either "local" is duplicate, or "br0" is a garbage.


# ip link set dev br0 up


# brctl addif br0 enp2s0 ; ip address del 192.168.18.59/24 dev enp2s0


$ ping -4 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
From 192.168.18.59 icmp_seq=1 Destination Host Unreachable
From 192.168.18.59 icmp_seq=2 Destination Host Unreachable
From 192.168.18.59 icmp_seq=3 Destination Host Unreachable
From 192.168.18.59 icmp_seq=4 Destination Host Unreachable
From 192.168.18.59 icmp_seq=5 Destination Host Unreachable
From 192.168.18.59 icmp_seq=6 Destination Host Unreachable
From 192.168.18.59 icmp_seq=7 Destination Host Unreachable
From 192.168.18.59 icmp_seq=8 Destination Host Unreachable
From 192.168.18.59 icmp_seq=9 Destination Host Unreachable
From 192.168.18.59 icmp_seq=10 Destination Host Unreachable
From 192.168.18.59 icmp_seq=11 Destination Host Unreachable
From 192.168.18.59 icmp_seq=12 Destination Host Unreachable
^C
--- 1.1.1.1 ping statistics ---
14 packets transmitted, 0 received, +12 errors, 100% packet loss, time 13175ms
pipe 3



$ traceroute -4 1.1.1.1
traceroute to 1.1.1.1 (1.1.1.1), 30 hops max, 60 byte packets
 1  archlinux (192.168.18.59)  1270.019 ms !H  1270.002 ms !H  1269.992 ms !H
 
 
$ drill -4 drill @1.1.1.1 archlinux.org
Error: error sending query: Could not send or receive, because of network error

Last edited by grimor (2023-11-20 11:04:37)

Offline

#16 2023-11-13 10:19:23

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,102

Re: [SOLVED] bridge-utils doesn't work with network bridge

In between attempts you did delete the bridge before recreating it ?

Delete a bridge, you need to first set it to down:

# ip link set dev bridge_name down
# brctl delbr bridge_name

If not, do that then repeat the commands in #14 .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#17 2023-11-13 20:29:30

Tarqi
Member
From: Ixtlan
Registered: 2012-11-27
Posts: 180
Website

Re: [SOLVED] bridge-utils doesn't work with network bridge

When you remove the ip from the physical interface, you also remove your default route. Add it to the bridge. AFAIK the best way would be:

1) create bridge
2) remove interface ip
3) add interface to the bridge
4) add ip to the bridge
5) add default route to the bridge

Edit: Sorry, I just saw that the default route was already mentioned in post #2 by Lone_Wolf. Did you ever set the route in your last tries? However, as it seems to be a dhcp provided ip on the physical interface, everything done here will get lost. You need to create the bridge first and then give dhcpcd (or whatever you use) the bridge interface.

Last edited by Tarqi (2023-11-13 20:36:56)


Knowing others is wisdom, knowing yourself is enlightenment. ~Lao Tse

Offline

#18 2023-11-13 21:53:09

grimor
Member
From: Spain
Registered: 2023-10-27
Posts: 21

Re: [SOLVED] bridge-utils doesn't work with network bridge

Lone_Wolf wrote:

In between attempts you did delete the bridge before recreating it ?

Of course.


Tarqi wrote:

5) add default route to the bridge

Thanks for your answer, Tarqi.
That's the problem. I already mentioned it in answer #3:

grimor wrote:

I think tutorial doesn't explain how put default gateway (192.168.18.1)

https://wiki.archlinux.org/title/Networ … nterface_2

How I put default gateway to bridge? neutral


# ip link set dev br0 down 
Cannot find device "br0"


# brctl delbr br0
bridge br0 doesn't exist; can't delete it


# nano /etc/sysctl.d/40-ipv6.conf

net.ipv6.conf.enp2s0.disable_ipv6 = 1


# systemctl restart systemd-sysctl.service


$ ip address
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 noprefixroute 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.18.59/24 brd 192.168.18.255 scope global dynamic noprefixroute enp2s0
    
    
$ ip route
default via 192.168.18.1 dev enp2s0 proto dhcp src 192.168.18.59 metric 100 
192.168.18.0/24 dev enp2s0 proto kernel scope link src 192.168.18.59 metric 100

* IP address attached to enp2s0: 192.168.18.59/24
* Default gateway: 192.168.18.1
* Bridge name: br0


# brctl addbr br0


# ip address add 192.168.18.59/24 dev br0


# ip link set dev br0 up


# brctl addif br0 enp2s0 ; ip address del 192.168.18.59/24 dev enp2s0


$ ping -4 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
From 192.168.18.59 icmp_seq=1 Destination Host Unreachable
From 192.168.18.59 icmp_seq=2 Destination Host Unreachable
From 192.168.18.59 icmp_seq=3 Destination Host Unreachable
From 192.168.18.59 icmp_seq=4 Destination Host Unreachable
From 192.168.18.59 icmp_seq=5 Destination Host Unreachable
From 192.168.18.59 icmp_seq=6 Destination Host Unreachable
^C
--- 1.1.1.1 ping statistics ---
7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6060ms
pipe 3


$ traceroute -4 1.1.1.1
traceroute to 1.1.1.1 (1.1.1.1), 30 hops max, 60 byte packets
 1  archlinux (192.168.18.59)  309.583 ms !H  309.564 ms !H  309.553 ms !H
 
 
$ drill -4 drill @1.1.1.1 archlinux.org
Error: error sending query: Could not send or receive, because of network error

I tried with a mobile phone network (Orange): same problem.

Last edited by grimor (2023-11-20 11:05:20)

Offline

#19 2023-11-14 02:06:53

solskog
Member
Registered: 2020-09-05
Posts: 462

Re: [SOLVED] bridge-utils doesn't work with network bridge

grimor wrote:

I want to create a network bridge for QEMU command-line.

If you don't mind using systemd-networkd. It will create a bridge interface br0 for the VM HOST and assign address/route you specified. For VM GUEST, qemu will create a tap interface attached to this bridge br0 and pass to the guest. If you need several guests with sharing the same bridge br0, you need use different id in qemu config below, e.g: tap_0_GROUP, tap_1_GROUP.
After the guest started, you need to configure the guest interface inside guest VM.

::::::::::::::
br0Enp0s3.network
::::::::::::::
[Match]
Name=enp0s3
[Network]
Bridge=br0
::::::::::::::
br0.netdev
::::::::::::::
[NetDev]
Name=br0
Kind=bridge
MACAddress=xx:00:00:cf:xx:b9
[Bridge]
VLANFiltering=1
STP=1
::::::::::::::
br0.network
::::::::::::::
[Match]
Name=br0
[Network]
DHCP=no
Address=x.x.x.x
Route=x.x.x.x
::::::::::::::
Qemu Config
::::::::::::::
-netdev tap,id=tap_0_GROUP,br=br0,ifname=tap_0_GROUP,script=no,vhost=on,downscript=no
-device virtio-net-pci,netdev=tap_0_GROUP,mac=xx:00:00:fa:xx:98

Last edited by solskog (2023-11-14 02:22:38)

Offline

#20 2023-11-14 10:08:12

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,102

Re: [SOLVED] bridge-utils doesn't work with network bridge

If we are going to suggest alternatives don't limit it to one . the archwiki bridge page mentions 3 alternatives (netctl, systemd-networkd  & networkmanager ) .

grimor, what do you use so the network card get its address & routes before it becomes a bridge ?

Last edited by Lone_Wolf (2023-11-14 10:09:17)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#21 2023-11-14 17:05:30

grimor
Member
From: Spain
Registered: 2023-10-27
Posts: 21

Re: [SOLVED] bridge-utils doesn't work with network bridge

Lone_Wolf wrote:

grimor, what do you use so the network card get its address & routes before it becomes a bridge ?

I use DHCP. And I think that's the problem: bridge-utils for Arch Linux works without DHCP... But it seems that systemd-networkd can work with DHCP (thanks, solskog):

# nano /etc/systemd/network/br0.netdev

[NetDev]
Name=br0
Kind=bridge
MACAddress=xx:00:00:cf:xx:b9
[Bridge]
VLANFiltering=1
STP=1


# systemctl restart systemd-networkd.service


$ ip a
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 noprefixroute 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet6 fe80::2544:65bb:eb05:bd04/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff

              
# nano /etc/systemd/network/br0enp2s0.network

[Match]
Name=enp2s0
[Network]
Bridge=br0


# nano /etc/systemd/network/br0.network

[Match]
Name=br0

[Network]
DHCP=ipv4
#DHCP=no
#Address=192.168.18.59/24
#Route=192.168.18.1


$ ip a
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 noprefixroute 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet6 fe80::2544:65bb:eb05:bd04/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.18.39/24 metric 1024 brd 192.168.18.255 scope global dynamic br0
       valid_lft 3125sec preferred_lft 3125sec
    inet6 fe80::9851:f4ff:fe1f:51ad/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever

And it seems that there is network!:

$ ping -c 2 archlinux.org
PING archlinux.org (95.217.163.246) 56(84) bytes of data.
64 bytes from archlinux.org (95.217.163.246): icmp_seq=1 ttl=50 time=60.0 ms
64 bytes from archlinux.org (95.217.163.246): icmp_seq=2 ttl=50 time=59.9 ms

--- archlinux.org ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 59.868/59.936/60.005/0.068 ms

Can bridge-utils be used with DHCP? hmm


Well. Now is QEMU time. But solskog's settings for QEMU don't work for me:

# qemu-system-x86_64 \
    -monitor stdio \
    -cpu host \
    -device intel-hda \
    -device hda-duplex \
    -k es \
    -machine accel=kvm \
    -m 2048 \
    -hda ~/Windows.7.qcow2 \
    -boot once=c,menu=off \
    -netdev tap,id=tap_0_GROUP,br=br0,ifname=tap_0_GROUP,script=no,vhost=on,downscript=no \
    -device virtio-net-pci,netdev=tap_0_GROUP,mac=xx:00:00:cf:xx:b9 \
    -usb -device usb-tablet \
    -rtc base=localtime \
    -name "Windows 7"

QEMU 8.1.2 monitor - type 'help' for more information
(qemu) qemu-system-x86_64: -device virtio-net-pci,netdev=tap_0_GROUP,mac=xx:00:00:cf:xx:b9: Property 'virtio-net-device.mac' doesn't take value 'xx:00:00:cf:xx:b9'

Last edited by grimor (2023-11-20 11:07:51)

Offline

#22 2023-11-15 00:28:42

solskog
Member
Registered: 2020-09-05
Posts: 462

Re: [SOLVED] bridge-utils doesn't work with network bridge

grimor wrote:

Property 'virtio-net-device.mac' doesn't take value 'xx:00:00:cf:xx:b9'

You need to use your own mac address. If you don't know how to recognize a real mac address, I suggest you learn some network basics first. Archlinux is a DIY distro. And qemu via command line is not that simple, there will be more rocks on the road to come.

Offline

#23 2023-11-15 09:43:59

grimor
Member
From: Spain
Registered: 2023-10-27
Posts: 21

Re: [SOLVED] bridge-utils doesn't work with network bridge

solskog wrote:

You need to use your own mac address. If you don't know how to recognize a real mac address, I suggest you learn some network basics first. Archlinux is a DIY distro. And qemu via command line is not that simple, there will be more rocks on the road to come.

OK. Thanks for advise.


$ ip address
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 noprefixroute 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet6 fe80::2544:65bb:eb05:bd04/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.18.59/24 metric 1024 brd 192.168.18.255 scope global dynamic br0
       valid_lft 3571sec preferred_lft 3571sec
    inet6 fe80::f66d:4ff:fe93:e0fa/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever

My own MAC address is xx:xx:xx:xx:xx:xx

So:

# nano /etc/systemd/network/br0.netdev

[NetDev]
Name=br0
Kind=bridge
MACAddress=xx:xx:xx:xx:xx:xx
[Bridge]
VLANFiltering=1
STP=1


# systemctl restart systemd-networkd.service


# qemu-system-x86_64 \
    -monitor stdio \
    -cpu host \
    -device intel-hda \
    -device hda-duplex \
    -k es \
    -machine accel=kvm \
    -m 2048 \
    -hda ~/Windows.7.qcow2 \
    -boot once=c,menu=off \
    -netdev tap,id=tap_0_GROUP,br=br0,ifname=tap_0_GROUP,script=no,vhost=on,downscript=no \
    -device virtio-net-pci,netdev=tap_0_GROUP,mac=xx:xx:xx:xx:xx:xx \
    -usb -device usb-tablet \
    -rtc base=localtime \
    -name "Windows 7"

QEMU 8.1.2 monitor - type 'help' for more information
(qemu)

QEMU guest boots correctly but no network:
lhZlNti.png

Last edited by grimor (2023-11-20 11:09:03)

Offline

#24 2023-11-15 10:12:50

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,102

Re: [SOLVED] bridge-utils doesn't work with network bridge

grimor wrote:

I use DHCP

DHCP is a protocol, you need a dhcp client to make use of that protocol.

systemd-networkd, netctl & NetworkManager are general network management tools that include a dhcp client .
dhcpcd (note the additonal 'cd')  & dhclient primary focus is on being dhcp clients.

getting tap networking with qemu working is tricky and requires several steps.

Study https://wiki.archlinux.org/title/QEMU#T … _with_QEMU and consider if you really want to use it.
Incase you do want that, think carefully which of the described methods you prefer.

Last edited by Lone_Wolf (2023-11-15 10:13:20)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#25 2023-11-15 12:52:51

grimor
Member
From: Spain
Registered: 2023-10-27
Posts: 21

Re: [SOLVED] bridge-utils doesn't work with network bridge

At least...

The easiest way: qemu-bridge-helper

# chmod u+s /usr/lib/qemu/qemu-bridge-helper

# chmod 755 /etc/qemu

# nano /etc/qemu/bridge.conf

allow br0


# qemu-system-x86_64 \
    -monitor stdio \
    -cpu host \
    -device intel-hda \
    -device hda-duplex \
    -k es \
    -machine accel=kvm \
    -m 2048 \
    -hda ~/Windows.7.qcow2 \
    -boot once=c,menu=off \
    -nic bridge
    -usb -device usb-tablet \
    -rtc base=localtime \
    -name "Windows 7"

QEMU 8.1.2 monitor - type 'help' for more information
(qemu)

and works fine.

I use QEMU VM guests (anothers OS and distros) for testing Wi-Fi wireless smartcard readers, and bridge mode is required.


I want to thank Tarqi, solskog and especially Lone_Wolf for all the help they have given me.

All the best.

Offline

Board footer

Powered by FluxBB