Skip to contentSkip to conversation

How to run separate iwd for every wifi dongle on the same host?

DISCUSSION zlinuxboy at outlook.com 3 participants 5 messages Apr 21, 2022

lore
Share & tools
lore

zlinuxboy at outlook.com

#0 lore raw

I am trying to plug 3 wifi dongle into one SBC(odroid c2 running armbian 22.01), wish to run separate iwd instance for each wifi dongle, in order to connect different ssid and acquire dhcp ip address and assign to them.

I have successfully implement with systemd-networkd+vrf+iwd, assign three wifi dongle to different vrf. start iwd, all three wifi dongle could connect to the same ssid and get different ip with dhcp, including default route.

but when I assign different wifi dongle to the same ssid with different psk(my ap is aerohive, support ppsk, everything user have a different private key. cisco, ruckus, aruba has such the same feature), iwd could not save the multiple config for the same ssid, because the same ssid share one config. so any possible to run separate iwd for every wifi dongle?

#1 lore raw

Hi,

Quoted 3 lines · zlinuxboy(a)outlook.com

I am trying to plug 3 wifi dongle into one SBC(odroid c2 running armbian 22.01), wish to run separate iwd instance for each wifi dongle, in order to connect different ssid and acquire dhcp ip address and assign to them.

I have successfully implement with systemd-networkd+vrf+iwd, assign three wifi dongle to different vrf. start iwd, all three wifi dongle could connect to the same ssid and get different ip with dhcp, including default route.

vrf?

Quoted 2 lines

but when I assign different wifi dongle to the same ssid with different psk(my ap is aerohive, support ppsk, everything user have a different private key. cisco, ruckus, aruba has such the same feature), iwd could not save the multiple config for the same ssid, because the same ssid share one config. so any possible to run separate iwd for every wifi dongle?

I don't think you'd be able to accomplish this easily with iwd as of today. You can try running a private system bus (dbus) for each iwd instance and using phy filtering (see 'iwd --help') so that each iwd instance only manages the particular phy you want. Or use namespaces. But you'd need to access each iwd instance via its private bus/namespace separately. You'd also need to override the state directory for each iwd instance.

Also, iwd isn't aware of SAE password identities (I assume this is what you mean by PPSK). Or is this something else?

Anyhow, you'd probably need to add some intelligence into iwd for it to use multiple PSKs on the same SSID properly within the same iwd instance.

Regards,
-Denis

#2 lore raw

could you elaborate more details about how to create private dbus and start iwd instance to attach these dbus? I am totally new on these field.Thanks in advanced.

#3 lore raw

Hi,

Quoted 1 line · zlinuxboy(a)outlook.com

could you elaborate more details about how to create private dbus and start iwd instance to attach these dbus?

You can take a look at the ell dbus unit test, to get the general idea:

https://git.kernel.org/pub/scm/libs/ell/ell.git/tree/unit/test-dbus.c

Also look at iwd's test-runner, it does something similar as well.

https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/tools/utils.py#n266

Basically you need to:

1. Start a private dbus-daemon instance at a private address.
2. Point iwd to this dbus-daemon instance by setting the DBUS_SYSTEM_BUS_ADDRESS environment variable prior to starting iwd.
3. Override iwd's STATE_DIRECTORY or CONFIGURATION_DIRECTORY as needed by setting the appropriate environment variables (see 'man 8 iwd').
4. Each iwd instance would only be accessible via the private dbus daemon instance. So 'iwctl' or your own dbus client would need to use the private dbus address(es) from step 1.

Probably something else I'm not thinking of? Hope this helps.

Regards,
-Denis

#4 lore raw
In reply to Denis Kenzior

Hi Denis,

Quoted 8 lines
Quoted 2 lines

I am trying to plug 3 wifi dongle into one SBC(odroid c2 running armbian 22.01), wish to run separate iwd instance for each wifi dongle, in order to connect different ssid and acquire dhcp ip address and assign to them. I have successfully implement with systemd-networkd+vrf+iwd, assign three wifi dongle to different vrf. start iwd, all three wifi dongle could connect to the same ssid and get different ip with dhcp, including default route.

vrf?

Quoted 1 line

but when I assign different wifi dongle to the same ssid with different psk(my ap is aerohive, support ppsk, everything user have a different private key. cisco, ruckus, aruba has such the same feature), iwd could not save the multiple config for the same ssid, because the same ssid share one config. so any possible to run separate iwd for every wifi dongle?

I don't think you'd be able to accomplish this easily with iwd as of today. You can try running a private system bus (dbus) for each iwd instance and using phy filtering (see 'iwd --help') so that each iwd instance only manages the particular phy you want. Or use namespaces. But you'd need to access each iwd instance via its private bus/namespace separately. You'd also need to override the state directory for each iwd instance.

you can use the environment variables STATE_DIRECTORY and CONFIGURATION_DIRECTORY to point to separate directories for storage and config.

Regards

Marcel