I'm rewriting my original question as I could advance on my issue.
I'm trying to bond eth0 + wifi on some combine mode to improve transfer rate on with my raspberry pi 3. After reading those docs below I got it to work partially.
- https://www.kernel.org/doc/html/latest/networking/bonding.html
- cat /usr/share/doc/ifenslave/examples/ethernet+hotplug_wifi
Issues:
- I want to combine those interfaces but they are working on some kind of fault tolerance only.
- Booting is taking too long
- Only wifi interface is connecting on boot time
- Ethernet interface once up works but alone, I'm assuming it due speedtest results.
My config:
pi@rpi-vpn:~ $ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source /etc/network/interfaces.d/*
auto bond0
iface bond0 inet dhcp
bond-slaves eth0 wlan0
bond-mode 0
bond-miimon 100
#bond-primary eth0
post-up route add default gw 192.168.1.1 bond0
pre-down route del default gw 192.168.1.1 bond0
# auto eth0
# iface eth0 inet manual
# bond-master bond0
# bond-mode 0
allow-hotplug wlan0
iface wlan0 inet manual
bond-master bond0
bond-mode 0
bond-miimon 100
bond-give-a-chance 10
wpa-bridge bond0
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Uncommenting eth0 interface I got no network at all
pi@rpi-vpn:~ $ ifconfig
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 192.168.1.142 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::6d93:61a8:77cf:7485 prefixlen 64 scopeid 0x20<link>
inet6 2a0c:5a80:1b05:8900:cd59:ab7a:fed7:2ca6 prefixlen 64 scopeid 0x0<global>
ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet)
RX packets 135443 bytes 127519700 (121.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 90394 bytes 77189328 (73.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
inet 192.168.1.142 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::6d93:61a8:77cf:7485 prefixlen 64 scopeid 0x20<link>
ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet)
RX packets 103684 bytes 103257937 (98.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 43267 bytes 35431464 (33.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 272 bytes 27315 (26.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 272 bytes 27315 (26.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wg0: flags=209<UP,POINTOPOINT,RUNNING,NOARP> mtu 1420
inet 10.215.153.1 netmask 255.255.255.0 destination 10.215.153.1
inet6 fd11:5ee:bad:c0de::1 prefixlen 64 scopeid 0x0<global>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
inet 192.168.1.142 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::c930:5fe9:1f4b:3e38 prefixlen 64 scopeid 0x20<link>
ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet)
RX packets 31859 bytes 24271757 (23.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 47216 bytes 41767893 (39.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
All the 3 interfaces bond0, eth0 and wlan0 have the same mac address that is the eth0 one.
The ip 192.168.1.142 is the ip reversed on my ISP router for eth0 mac address
Some other important settings:
pi@rpi-vpn:~ $ uname -a
Linux rpi-vpn 5.15.76-v7+ #1597 SMP Fri Nov 4 12:13:17 GMT 2022 armv7l GNU/Linux
pi@rpi-vpn:~ $ lsmod | grep bonding
bonding 147456 0
pi@rpi-vpn:~ $ systemctl status wpa_supplicant
● wpa_supplicant.service - WPA supplicant
Loaded: loaded (/lib/systemd/system/wpa_supplicant.service; disabled; vendor preset: enabled)
Active: inactive (dead)
pi@rpi-vpn:~ $ systemctl status dhcpcd.service
● dhcpcd.service - DHCP Client Daemon
Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/dhcpcd.service.d
└─wait.conf
Active: active (running) since Thu 2022-12-29 08:23:11 GMT; 17min ago
Docs: man:dhcpcd(8)
Process: 367 ExecStart=/usr/sbin/dhcpcd -w -q (code=exited, status=0/SUCCESS)
Tasks: 2 (limit: 1596)
CPU: 4.314s
CGroup: /system.slice/dhcpcd.service
├─568 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0
└─763 /usr/sbin/dhcpcd -w -q
Dec 29 08:28:05 rpi-vpn dhcpcd[763]: eth0: carrier acquired
Dec 29 08:28:05 rpi-vpn dhcpcd[763]: eth0: IAID eb:4c:42:ef
Dec 29 08:28:05 rpi-vpn dhcpcd[763]: eth0: IAID conflicts with one assigned to wlan0
Dec 29 08:28:05 rpi-vpn dhcpcd[763]: eth0: adding address fe80::6d93:61a8:77cf:7485
Dec 29 08:28:05 rpi-vpn dhcpcd[763]: eth0: soliciting an IPv6 router
Dec 29 08:28:06 rpi-vpn dhcpcd[763]: eth0: rebinding lease of 192.168.1.142
Dec 29 08:28:06 rpi-vpn dhcpcd[763]: eth0: probing address 192.168.1.142/24
Dec 29 08:28:11 rpi-vpn dhcpcd[763]: eth0: leased 192.168.1.142 for infinity
Dec 29 08:28:11 rpi-vpn dhcpcd[763]: eth0: adding route to 192.168.1.0/24
Dec 29 08:28:11 rpi-vpn dhcpcd[763]: eth0: adding default route via 192.168.1.1
pi@rpi-vpn:~ $ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 bond0
0.0.0.0 192.168.1.1 0.0.0.0 UG 202 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 204 0 0 bond0
0.0.0.0 192.168.1.1 0.0.0.0 UG 303 0 0 wlan0
10.215.153.0 0.0.0.0 255.255.255.0 U 0 0 0 wg0
192.168.1.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 204 0 0 bond0
192.168.1.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0
All the tests below were ran without change anything it just seems the first one was wifi only and the last one ethernet only.
pi@rpi-vpn:~ $ speedtest
Retrieving speedtest.net configuration...
Testing from XXX (x)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by XXX (xxx) [2.00 km]: 30.684 ms
Testing download speed................................................................................
Download: 9.20 Mbit/s
Testing upload speed......................................................................................................
Upload: 11.54 Mbit/s
pi@rpi-vpn:~ $ speedtest
Retrieving speedtest.net configuration...
Testing from XXX (x)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by XXXXX (xxxx) [0.88 km]: 29.03 ms
Testing download speed................................................................................
Download: 51.62 Mbit/s
Testing upload speed......................................................................................................
Upload: 37.49 Mbit/s
pi@rpi-vpn:~ $ speedtest
Retrieving speedtest.net configuration...
Testing from xxx (xxx)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by XXXXX (xxxx) [2.00 km]: 29.093 ms
Testing download speed................................................................................
Download: 78.98 Mbit/s
Testing upload speed......................................................................................................