Discussion:
Can't connect to WiFi when the wired and the wireless interfaces are bonded
(too old to reply)
Doron Behar
2018-05-15 08:27:11 UTC
Permalink
I've bonded my wireless and wired network interfaces with
systemd-networkd using an active-backup mode.

These are the configuration files I have:

/etc/systemd/network/10-bond0.netdev

[NetDev]
Name=bond0
Kind=bond

[Bond]
Mode=active-backup

----

/etc/systemd/network/20-wired.network
[Match]
Name=enp0s25

[Network]
Bond=bond0

----

/etc/systemd/network/25-wireless.network

[Match]
Name=wlp2s0

[Network]
Bond=bond0

----

/etc/systemd/network/35-tethering.network

[Match]
Name=enp0s20u*

[Network]
Bond=bond0

----

/etc/systemd/network/40-bond0.network

[Match]
Name=bond0

[Network]
DHCP=yes

----

I've noticed that if I boot without any internet connection, WiFi or
Ethernet, and I connect to a WiFi network (only after the boot),
`wpa_supplicant` reports I'm connected to the WiFi network but I'm not
connected to the internet.

Here is the output of `networkctl status`:

● State: degraded
Address: fe80::a05d:c4ff:feca:efaa on bond0

And `networkctl list`:

IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 bond0 bond degraded configuring
3 enp0s25 ether no-carrier configuring
4 wlp2s0 wlan carrier configuring

4 links listed.

And the output of `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: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether a2:5d:c4:ca:ef:aa brd ff:ff:ff:ff:ff:ff
inet6 fe80::a05d:c4ff:feca:efaa/64 scope link
valid_lft forever preferred_lft forever
3: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc fq_codel master bond0 state DOWN group default qlen 1000
link/ether a2:5d:c4:ca:ef:aa brd ff:ff:ff:ff:ff:ff
4: wlp2s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
link/ether a2:5d:c4:ca:ef:aa brd ff:ff:ff:ff:ff:ff

Is this how it is supposed to behave? Is `systemd-networkd` supposed to be
used only for servers without roaming internet connections that change
after boot?
Bruce A. Johnson
2018-05-15 21:39:47 UTC
Permalink
Doron,

I don't see any mention of DHCP in  your wireless network definition, so
I'm dubious that your system has made any attempt at getting an IP
address on wlp2s0. Try adding /DHCP=yes/ to the /[Network]/ section of
25-wireless.network.

I haven't done a wireless setup with systemd yet, nor have I tried the
active-backup configuration you're working with, so I may be completely
wrong. Please let me know whether or not it works.

Thanks!

Bruce A. Johnson
Herndon, Virginia
Post by Doron Behar
I've bonded my wireless and wired network interfaces with
systemd-networkd using an active-backup mode.
/etc/systemd/network/10-bond0.netdev
[NetDev]
Name=bond0
Kind=bond
[Bond]
Mode=active-backup
----
/etc/systemd/network/20-wired.network
[Match]
Name=enp0s25
[Network]
Bond=bond0
----
/etc/systemd/network/25-wireless.network
[Match]
Name=wlp2s0
[Network]
Bond=bond0
----
/etc/systemd/network/35-tethering.network
[Match]
Name=enp0s20u*
[Network]
Bond=bond0
----
/etc/systemd/network/40-bond0.network
[Match]
Name=bond0
[Network]
DHCP=yes
----
I've noticed that if I boot without any internet connection, WiFi or
Ethernet, and I connect to a WiFi network (only after the boot),
`wpa_supplicant` reports I'm connected to the WiFi network but I'm not
connected to the internet.
● State: degraded
Address: fe80::a05d:c4ff:feca:efaa on bond0
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 bond0 bond degraded configuring
3 enp0s25 ether no-carrier configuring
4 wlp2s0 wlan carrier configuring
4 links listed.
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: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether a2:5d:c4:ca:ef:aa brd ff:ff:ff:ff:ff:ff
inet6 fe80::a05d:c4ff:feca:efaa/64 scope link
valid_lft forever preferred_lft forever
3: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc fq_codel master bond0 state DOWN group default qlen 1000
link/ether a2:5d:c4:ca:ef:aa brd ff:ff:ff:ff:ff:ff
4: wlp2s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
link/ether a2:5d:c4:ca:ef:aa brd ff:ff:ff:ff:ff:ff
Is this how it is supposed to behave? Is `systemd-networkd` supposed to be
used only for servers without roaming internet connections that change
after boot?
_______________________________________________
systemd-devel mailing list
https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Mantas Mikulėnas
2018-05-16 06:14:01 UTC
Permalink
On Wed, May 16, 2018 at 12:47 AM Bruce A. Johnson <
Post by Bruce A. Johnson
Doron,
I don't see any mention of DHCP in your wireless network definition, so
I'm dubious that your system has made any attempt at getting an IP address
on wlp2s0. Try adding *DHCP=yes* to the *[Network]* section of
25-wireless.network.
I haven't done a wireless setup with systemd yet, nor have I tried the
active-backup configuration you're working with, so I may be completely
wrong. Please let me know whether or not it works.
I believe the individual bonded interfaces don't *need* to speak IP at all;
only the 'main' bond itself does.
--
Mantas Mikulėnas
Doron Behar
2018-05-16 11:10:56 UTC
Permalink
I agree. This is what I understood from the manual pages. I've even
tried to run `dhcpcd wlp2s0` manually after I've connected to the WiFi
network and it didn't help either. Here is `dhcpcd`'s output:

DUID 00:01:00:01:22:58:f0:ec:34:13:e8:35:48:e6
wlp2s0: IAID c4:ca:ef:aa
wlp2s0: adding address fe80::bf80:8309:6514:f4ff
wlp2s0: soliciting a DHCP lease
wlp2s0: soliciting an IPv6 router
wlp2s0: offered 192.168.43.146 from 192.168.43.1
wlp2s0: probing address 192.168.43.146/24
wlp2s0: leased 192.168.43.146 for 3600 seconds
wlp2s0: adding route to 192.168.43.0/24
wlp2s0: adding default route via 192.168.43.1
forked to background, child pid 1142

It does seem to be working yet I'm not really connected to the internet,
`ping 8.8.8.8` doesn't work.
Post by Mantas Mikulėnas
On Wed, May 16, 2018 at 12:47 AM Bruce A. Johnson <
Post by Bruce A. Johnson
Doron,
I don't see any mention of DHCP in your wireless network definition, so
I'm dubious that your system has made any attempt at getting an IP address
on wlp2s0. Try adding *DHCP=yes* to the *[Network]* section of
25-wireless.network.
I haven't done a wireless setup with systemd yet, nor have I tried the
active-backup configuration you're working with, so I may be completely
wrong. Please let me know whether or not it works.
I believe the individual bonded interfaces don't *need* to speak IP at all;
only the 'main' bond itself does.
--
Mantas Mikulėnas
Bruce A. Johnson
2018-05-16 16:01:17 UTC
Permalink
Mantas seems to be correct that I was giving you a bum steer about
putting the DHCP=Yes into 25-wireless.network. I haven't used bonding
before, either. So please consider advice from someone who actually
knows what he/she's doing in preference to anything I suggest.

Have a look at how systemd obtains the IP address on the [presumably
working] wired connection.

# journalctl -b | grep DHCP
May 16 15:32:47 rl-000db948364a systemd-networkd[382]: en01: DHCPv4 address 192.168.3.200/24 via 192.168.3.1

My Ethernet interface is called /en01/. I would expect your log to say
it's /bond0/. Given that wireless interfaces look a lot like Ethernet
interfaces, I don't see that you've done anything wrong, and maybe if
you run dhcpd manually on  bond0 for diagnostic purposes, you'll see a
better result in your test. The other thing would be to ping the default
gateway (192.168.43.1 in your log), in case ICMP to the outside world is
blocked. (The router might also block ICMP pings, though. It depends on
the paranoia level of the network administrator.) If you've just brought
up dhcpd, it's still running, and the IP layer is down already, that
suggests to me that systemd-networkd has gotten in the way.

With wired interfaces, I swap the cable around all the time and
systemd-networkd properly picks up the new IP configuration from DHCP.
Maybe try a setup without the bond interface and see whether you can get
IP working over wireless. I would expect systemd-networkd to gracefully
handle DHCP configuration when you go out of range of the transmitter
and return, or if you move to another SSID that's set up in
wpa-supplicant. If that works, it suggests an issue with interface bonding.

Another thing you might do is set up .network files for the interfaces
that include a route metric of 0 for the wired (preferred) interface and
1 for the wireless:

[Match]
Name=en02

[Network]
Description=WAN connection on en02
DHCP=yes

[DHCP]
RouteMetric=1

I'm using those successfully in my set-up, but the two interfaces are
separate subnets. Still, I would expect it to work were they on the same
subnet.

I hope this helps, and I'm looking forward to learning more from what
you find out and what others suggest.

Bruce A. Johnson
Herndon, Virginia
Post by Doron Behar
I agree. This is what I understood from the manual pages. I've even
tried to run `dhcpcd wlp2s0` manually after I've connected to the WiFi
DUID 00:01:00:01:22:58:f0:ec:34:13:e8:35:48:e6
wlp2s0: IAID c4:ca:ef:aa
wlp2s0: adding address fe80::bf80:8309:6514:f4ff
wlp2s0: soliciting a DHCP lease
wlp2s0: soliciting an IPv6 router
wlp2s0: offered 192.168.43.146 from 192.168.43.1
wlp2s0: probing address 192.168.43.146/24
wlp2s0: leased 192.168.43.146 for 3600 seconds
wlp2s0: adding route to 192.168.43.0/24
wlp2s0: adding default route via 192.168.43.1
forked to background, child pid 1142
It does seem to be working yet I'm not really connected to the internet,
`ping 8.8.8.8` doesn't work.
        .     .    .
Post by Doron Behar
Post by Mantas Mikulėnas
I believe the individual bonded interfaces don't *need* to speak IP at all;
only the 'main' bond itself does.
--
Mantas Mikulėnas
Doron Behar
2018-05-16 16:34:20 UTC
Permalink
Currently I'm not residing at home were I use both interfaces to connect
to the same network, so I can't test this setup right now. In the
following experiments results following your suggestions, I didn't
connect any Ethernet cable.
Post by Bruce A. Johnson
Mantas seems to be correct that I was giving you a bum steer about
putting the DHCP=Yes into 25-wireless.network. I haven't used bonding
before, either. So please consider advice from someone who actually
knows what he/she's doing in preference to anything I suggest.
Have a look at how systemd obtains the IP address on the [presumably
working] wired connection.
# journalctl -b | grep DHCP
May 16 15:32:47 rl-000db948364a systemd-networkd[382]: en01: DHCPv4 address 192.168.3.200/24 via 192.168.3.1
When I connect to the WiFi network only after boot, the command you used
above doesn't produce any output.
Post by Bruce A. Johnson
My Ethernet interface is called /en01/. I would expect your log to say
it's /bond0/. Given that wireless interfaces look a lot like Ethernet
interfaces, I don't see that you've done anything wrong, and maybe if
you run dhcpd manually on  bond0 for diagnostic purposes, you'll see a
better result in your test. The other thing would be to ping the default
gateway (192.168.43.1 in your log), in case ICMP to the outside world is
blocked. (The router might also block ICMP pings, though. It depends on
the paranoia level of the network administrator.) If you've just brought
up dhcpd, it's still running, and the IP layer is down already, that
suggests to me that systemd-networkd has gotten in the way.
Well first of all, running `dhcpcd bond0` when I connect to the WiFi network only after
boot gives me this:

dhcp6_listen: Address already in use
DUID 00:01:00:01:22:58:f0:ec:34:13:e8:35:48:e6
bond0: IAID c4:ca:ef:aa
bond0: soliciting an IPv6 router
bond0: soliciting a DHCP lease
bond0: no IPv6 Routers available

And it's stuck there for a really long time..

As for `ping`ing `192.168.43.1`, I get this output:

connect: Network is unreachable

My network infrastructure at the moment is a WiFi hotspot of my Android
device.
Post by Bruce A. Johnson
With wired interfaces, I swap the cable around all the time and
systemd-networkd properly picks up the new IP configuration from DHCP.
Maybe try a setup without the bond interface and see whether you can get
IP working over wireless. I would expect systemd-networkd to gracefully
handle DHCP configuration when you go out of range of the transmitter
and return, or if you move to another SSID that's set up in
wpa-supplicant. If that works, it suggests an issue with interface bonding.
As for moving away and returning to the range of a WiFi networks, it
should be noted that it works great without having a bonding
configuration - when using just a dumb `wireless.network` with:

[Match]
Name=wlp2s0

[Network]
DHCP=yes
Post by Bruce A. Johnson
Another thing you might do is set up .network files for the interfaces
that include a route metric of 0 for the wired (preferred) interface and
[Match]
Name=en02
[Network]
Description=WAN connection on en02
DHCP=yes
[DHCP]
RouteMetric=1
Adding the entry `RouteMetric=1` for the `[DHCP]` section in my
`bonding.network` doesn't help at all.

Should I open an issue on systemd's issues tracker?
Post by Bruce A. Johnson
I'm using those successfully in my set-up, but the two interfaces are
separate subnets. Still, I would expect it to work were they on the same
subnet.
I hope this helps, and I'm looking forward to learning more from what
you find out and what others suggest.
Bruce A. Johnson
Herndon, Virginia
Post by Doron Behar
I agree. This is what I understood from the manual pages. I've even
tried to run `dhcpcd wlp2s0` manually after I've connected to the WiFi
DUID 00:01:00:01:22:58:f0:ec:34:13:e8:35:48:e6
wlp2s0: IAID c4:ca:ef:aa
wlp2s0: adding address fe80::bf80:8309:6514:f4ff
wlp2s0: soliciting a DHCP lease
wlp2s0: soliciting an IPv6 router
wlp2s0: offered 192.168.43.146 from 192.168.43.1
wlp2s0: probing address 192.168.43.146/24
wlp2s0: leased 192.168.43.146 for 3600 seconds
wlp2s0: adding route to 192.168.43.0/24
wlp2s0: adding default route via 192.168.43.1
forked to background, child pid 1142
It does seem to be working yet I'm not really connected to the internet,
`ping 8.8.8.8` doesn't work.
        .     .    .
Post by Doron Behar
Post by Mantas Mikulėnas
I believe the individual bonded interfaces don't *need* to speak IP at all;
only the 'main' bond itself does.
--
Mantas Mikulėnas
Bruce A. Johnson
2018-05-16 17:25:34 UTC
Permalink
I didn't see your in-line comments at first. I'm not part of the systemd
development team (I'm just a "consumer", trying to give back), so I
don't feel comfortable advising you to open a ticket, but I would at
this point if I were you. I'll add a few more comments in-line below.

Good luck!

Bruce A. Johnson
Herndon, Virginia
Post by Doron Behar
Currently I'm not residing at home were I use both interfaces to connect
to the same network, so I can't test this setup right now. In the
following experiments results following your suggestions, I didn't
connect any Ethernet cable.
Post by Bruce A. Johnson
Mantas seems to be correct that I was giving you a bum steer about
putting the DHCP=Yes into 25-wireless.network. I haven't used bonding
before, either. So please consider advice from someone who actually
knows what he/she's doing in preference to anything I suggest.
Have a look at how systemd obtains the IP address on the [presumably
working] wired connection.
# journalctl -b | grep DHCP
May 16 15:32:47 rl-000db948364a systemd-networkd[382]: en01: DHCPv4 address 192.168.3.200/24 via 192.168.3.1
When I connect to the WiFi network only after boot, the command you used
above doesn't produce any output.
If there is nothing from systemd-networkd about the IP address
assignment and you having a working IP environment, it sounds like
you're getting the IP address outside the systemd framework. That would
probably preclude it from working with the active-backup configuration
under systemd. I'm not sure whether wpa-supplicant does anything about
getting an IP address, not having been there yet myself.
Post by Doron Behar
Post by Bruce A. Johnson
My Ethernet interface is called /en01/. I would expect your log to say
it's /bond0/. Given that wireless interfaces look a lot like Ethernet
interfaces, I don't see that you've done anything wrong, and maybe if
you run dhcpd manually on  bond0 for diagnostic purposes, you'll see a
better result in your test. The other thing would be to ping the default
gateway (192.168.43.1 in your log), in case ICMP to the outside world is
blocked. (The router might also block ICMP pings, though. It depends on
the paranoia level of the network administrator.) If you've just brought
up dhcpd, it's still running, and the IP layer is down already, that
suggests to me that systemd-networkd has gotten in the way.
Well first of all, running `dhcpcd bond0` when I connect to the WiFi network only after
dhcp6_listen: Address already in use
DUID 00:01:00:01:22:58:f0:ec:34:13:e8:35:48:e6
bond0: IAID c4:ca:ef:aa
bond0: soliciting an IPv6 router
bond0: soliciting a DHCP lease
bond0: no IPv6 Routers available
And it's stuck there for a really long time..
connect: Network is unreachable
My network infrastructure at the moment is a WiFi hotspot of my Android
The gateway address would depend on the wireless network you're using,
so if you were working from home WiFi before and are now working from a
WiFi hotspot, there are reasonable odds the gateway address would be
different. To find your gateway address without reading the log output
from dhcpd, run /ip route/ and pick up the address on the default line:

$ ip route
default via 10.100.1.1 dev en01 proto static metric 100
10.100.1.0/24 dev en01 proto kernel scope link src 10.100.1.64 metric 100

In this example, the default gateway is 10.100.1.1, so if I were
checking basic IP connectivity, I'd ping that address. (Although,
honestly, if you have a default route, your IP is working and you're
good to go.)
Post by Doron Behar
device.
Post by Bruce A. Johnson
With wired interfaces, I swap the cable around all the time and
systemd-networkd properly picks up the new IP configuration from DHCP.
Maybe try a setup without the bond interface and see whether you can get
IP working over wireless. I would expect systemd-networkd to gracefully
handle DHCP configuration when you go out of range of the transmitter
and return, or if you move to another SSID that's set up in
wpa-supplicant. If that works, it suggests an issue with interface bonding.
As for moving away and returning to the range of a WiFi networks, it
should be noted that it works great without having a bonding
[Match]
Name=wlp2s0
[Network]
DHCP=yes
Post by Bruce A. Johnson
Another thing you might do is set up .network files for the interfaces
that include a route metric of 0 for the wired (preferred) interface and
[Match]
Name=en02
[Network]
Description=WAN connection on en02
DHCP=yes
[DHCP]
RouteMetric=1
Adding the entry `RouteMetric=1` for the `[DHCP]` section in my
`bonding.network` doesn't help at all.
I should have specified you'd need two separate files and no bond
interfaces. In my case, I've got 80-en01.network and 80-en02.network,
and the above is the content of the 80-en02.network file. The
80-en01.network file has /Name=en01/ and /RouteMetric=0/. Both (wired)
interfaces are up simultaneously, and I want all traffic to normally go
through en01. I have host routes with a route metric of 0 for the
addresses I want to reach on en02. If either interface loses
connectivity, all traffic goes through the remaining interface.
Post by Doron Behar
Should I open an issue on systemd's issues tracker?
Doron Behar
2018-05-16 19:42:09 UTC
Permalink
I've found out that I'm experiencing this problem regardless of whether
the WiFi network was present or not when I booted - which is different
from what I've initially reported in my 1st message.

I've created an issue report on systemd's issue tracker, I hope to get
more support there -
Post by Bruce A. Johnson
I didn't see your in-line comments at first. I'm not part of the systemd
development team (I'm just a "consumer", trying to give back), so I
don't feel comfortable advising you to open a ticket, but I would at
this point if I were you. I'll add a few more comments in-line below.
Good luck!
Bruce A. Johnson
Herndon, Virginia
Post by Doron Behar
Currently I'm not residing at home were I use both interfaces to connect
to the same network, so I can't test this setup right now. In the
following experiments results following your suggestions, I didn't
connect any Ethernet cable.
Post by Bruce A. Johnson
Mantas seems to be correct that I was giving you a bum steer about
putting the DHCP=Yes into 25-wireless.network. I haven't used bonding
before, either. So please consider advice from someone who actually
knows what he/she's doing in preference to anything I suggest.
Have a look at how systemd obtains the IP address on the [presumably
working] wired connection.
# journalctl -b | grep DHCP
May 16 15:32:47 rl-000db948364a systemd-networkd[382]: en01: DHCPv4 address 192.168.3.200/24 via 192.168.3.1
When I connect to the WiFi network only after boot, the command you used
above doesn't produce any output.
If there is nothing from systemd-networkd about the IP address
assignment and you having a working IP environment, it sounds like
you're getting the IP address outside the systemd framework. That would
probably preclude it from working with the active-backup configuration
under systemd. I'm not sure whether wpa-supplicant does anything about
getting an IP address, not having been there yet myself.
Post by Doron Behar
Post by Bruce A. Johnson
My Ethernet interface is called /en01/. I would expect your log to say
it's /bond0/. Given that wireless interfaces look a lot like Ethernet
interfaces, I don't see that you've done anything wrong, and maybe if
you run dhcpd manually on  bond0 for diagnostic purposes, you'll see a
better result in your test. The other thing would be to ping the default
gateway (192.168.43.1 in your log), in case ICMP to the outside world is
blocked. (The router might also block ICMP pings, though. It depends on
the paranoia level of the network administrator.) If you've just brought
up dhcpd, it's still running, and the IP layer is down already, that
suggests to me that systemd-networkd has gotten in the way.
Well first of all, running `dhcpcd bond0` when I connect to the WiFi network only after
dhcp6_listen: Address already in use
DUID 00:01:00:01:22:58:f0:ec:34:13:e8:35:48:e6
bond0: IAID c4:ca:ef:aa
bond0: soliciting an IPv6 router
bond0: soliciting a DHCP lease
bond0: no IPv6 Routers available
And it's stuck there for a really long time..
connect: Network is unreachable
My network infrastructure at the moment is a WiFi hotspot of my Android
The gateway address would depend on the wireless network you're using,
so if you were working from home WiFi before and are now working from a
WiFi hotspot, there are reasonable odds the gateway address would be
different. To find your gateway address without reading the log output
$ ip route
default via 10.100.1.1 dev en01 proto static metric 100
10.100.1.0/24 dev en01 proto kernel scope link src 10.100.1.64 metric 100
In this example, the default gateway is 10.100.1.1, so if I were
checking basic IP connectivity, I'd ping that address. (Although,
honestly, if you have a default route, your IP is working and you're
good to go.)
Post by Doron Behar
device.
Post by Bruce A. Johnson
With wired interfaces, I swap the cable around all the time and
systemd-networkd properly picks up the new IP configuration from DHCP.
Maybe try a setup without the bond interface and see whether you can get
IP working over wireless. I would expect systemd-networkd to gracefully
handle DHCP configuration when you go out of range of the transmitter
and return, or if you move to another SSID that's set up in
wpa-supplicant. If that works, it suggests an issue with interface bonding.
As for moving away and returning to the range of a WiFi networks, it
should be noted that it works great without having a bonding
[Match]
Name=wlp2s0
[Network]
DHCP=yes
Post by Bruce A. Johnson
Another thing you might do is set up .network files for the interfaces
that include a route metric of 0 for the wired (preferred) interface and
[Match]
Name=en02
[Network]
Description=WAN connection on en02
DHCP=yes
[DHCP]
RouteMetric=1
Adding the entry `RouteMetric=1` for the `[DHCP]` section in my
`bonding.network` doesn't help at all.
I should have specified you'd need two separate files and no bond
interfaces. In my case, I've got 80-en01.network and 80-en02.network,
and the above is the content of the 80-en02.network file. The
80-en01.network file has /Name=en01/ and /RouteMetric=0/. Both (wired)
interfaces are up simultaneously, and I want all traffic to normally go
through en01. I have host routes with a route metric of 0 for the
addresses I want to reach on en02. If either interface loses
connectivity, all traffic goes through the remaining interface.
Post by Doron Behar
Should I open an issue on systemd's issues tracker?
_______________________________________________
systemd-devel mailing list
https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Doron Behar
2018-05-16 19:51:01 UTC
Permalink
I've found out that I'm experiencing this problem regardless of whether
the WiFi network was present or not when I booted - which is different
from what I've initially reported in my 1st message.

I've created an issue report on systemd's issue tracker, I hope to get
more support there - https://github.com/systemd/systemd/issues/9011
Post by Bruce A. Johnson
I didn't see your in-line comments at first. I'm not part of the systemd
development team (I'm just a "consumer", trying to give back), so I
don't feel comfortable advising you to open a ticket, but I would at
this point if I were you. I'll add a few more comments in-line below.
Good luck!
Bruce A. Johnson
Herndon, Virginia
Post by Doron Behar
Currently I'm not residing at home were I use both interfaces to connect
to the same network, so I can't test this setup right now. In the
following experiments results following your suggestions, I didn't
connect any Ethernet cable.
Post by Bruce A. Johnson
Mantas seems to be correct that I was giving you a bum steer about
putting the DHCP=Yes into 25-wireless.network. I haven't used bonding
before, either. So please consider advice from someone who actually
knows what he/she's doing in preference to anything I suggest.
Have a look at how systemd obtains the IP address on the [presumably
working] wired connection.
# journalctl -b | grep DHCP
May 16 15:32:47 rl-000db948364a systemd-networkd[382]: en01: DHCPv4 address 192.168.3.200/24 via 192.168.3.1
When I connect to the WiFi network only after boot, the command you used
above doesn't produce any output.
If there is nothing from systemd-networkd about the IP address
assignment and you having a working IP environment, it sounds like
you're getting the IP address outside the systemd framework. That would
probably preclude it from working with the active-backup configuration
under systemd. I'm not sure whether wpa-supplicant does anything about
getting an IP address, not having been there yet myself.
Post by Doron Behar
Post by Bruce A. Johnson
My Ethernet interface is called /en01/. I would expect your log to say
it's /bond0/. Given that wireless interfaces look a lot like Ethernet
interfaces, I don't see that you've done anything wrong, and maybe if
you run dhcpd manually on  bond0 for diagnostic purposes, you'll see a
better result in your test. The other thing would be to ping the default
gateway (192.168.43.1 in your log), in case ICMP to the outside world is
blocked. (The router might also block ICMP pings, though. It depends on
the paranoia level of the network administrator.) If you've just brought
up dhcpd, it's still running, and the IP layer is down already, that
suggests to me that systemd-networkd has gotten in the way.
Well first of all, running `dhcpcd bond0` when I connect to the WiFi network only after
dhcp6_listen: Address already in use
DUID 00:01:00:01:22:58:f0:ec:34:13:e8:35:48:e6
bond0: IAID c4:ca:ef:aa
bond0: soliciting an IPv6 router
bond0: soliciting a DHCP lease
bond0: no IPv6 Routers available
And it's stuck there for a really long time..
connect: Network is unreachable
My network infrastructure at the moment is a WiFi hotspot of my Android
The gateway address would depend on the wireless network you're using,
so if you were working from home WiFi before and are now working from a
WiFi hotspot, there are reasonable odds the gateway address would be
different. To find your gateway address without reading the log output
$ ip route
default via 10.100.1.1 dev en01 proto static metric 100
10.100.1.0/24 dev en01 proto kernel scope link src 10.100.1.64 metric 100
In this example, the default gateway is 10.100.1.1, so if I were
checking basic IP connectivity, I'd ping that address. (Although,
honestly, if you have a default route, your IP is working and you're
good to go.)
Post by Doron Behar
device.
Post by Bruce A. Johnson
With wired interfaces, I swap the cable around all the time and
systemd-networkd properly picks up the new IP configuration from DHCP.
Maybe try a setup without the bond interface and see whether you can get
IP working over wireless. I would expect systemd-networkd to gracefully
handle DHCP configuration when you go out of range of the transmitter
and return, or if you move to another SSID that's set up in
wpa-supplicant. If that works, it suggests an issue with interface bonding.
As for moving away and returning to the range of a WiFi networks, it
should be noted that it works great without having a bonding
[Match]
Name=wlp2s0
[Network]
DHCP=yes
Post by Bruce A. Johnson
Another thing you might do is set up .network files for the interfaces
that include a route metric of 0 for the wired (preferred) interface and
[Match]
Name=en02
[Network]
Description=WAN connection on en02
DHCP=yes
[DHCP]
RouteMetric=1
Adding the entry `RouteMetric=1` for the `[DHCP]` section in my
`bonding.network` doesn't help at all.
I should have specified you'd need two separate files and no bond
interfaces. In my case, I've got 80-en01.network and 80-en02.network,
and the above is the content of the 80-en02.network file. The
80-en01.network file has /Name=en01/ and /RouteMetric=0/. Both (wired)
interfaces are up simultaneously, and I want all traffic to normally go
through en01. I have host routes with a route metric of 0 for the
addresses I want to reach on en02. If either interface loses
connectivity, all traffic goes through the remaining interface.
Post by Doron Behar
Should I open an issue on systemd's issues tracker?
_______________________________________________
systemd-devel mailing list
https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Loading...