subgraph / subgraph-os-issues

Subgraph OS issues repository
73 stars 10 forks source link

USB WiFi Not Working #300

Open xSmurf opened 6 years ago

xSmurf commented 6 years ago

There seems to be some upstream problem between wpa_supplicant and systemd's predictable interface (long) names. A lot of our users may want to use external wireless devices, this ticket will document attempts at fixing this.

First thing we can do is turn off the predictable long names for USB WiFi interfaces. For this we need to create the following two files:

/etc/udev/rules.d/73-usb-net-by-mac.rules

# Use MAC based names for network interfaces which are directly or indirectly
# on USB and have an universally administered (stable) MAC address (second bit
# is 0). Don't do this when ifnames is disabled via kernel command line or
# customizing/disabling 99-default.link (or previously 80-net-setup-link.rules).

IMPORT{cmdline}="net.ifnames"
ENV{net.ifnames}=="0", GOTO="usb_net_by_mac_end"
SUBSYSTEMS=="usb", ENV{DEVTYPE}=="wlan", GOTO="usb_net_by_mac_end"

ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb", NAME=="", \
    ATTR{address}=="?[014589cd]:*", \
    TEST!="/etc/udev/rules.d/80-net-setup-link.rules", \
    TEST!="/etc/systemd/network/99-default.link", \
    IMPORT{builtin}="net_id", NAME="$env{ID_NET_NAME_MAC}"

LABEL="usb_net_by_mac_end"

/etc/systemd/network/30-usbwifi.link

[Match]
Type=wlan
Path=*-usb*

[Link]
NamePolicy=kernel onboard slot path

NetworkManager app armor profile might also require some tinkering with.