This is an old revision of the document!
So I found a PCI Wi-Fi 5 device, and I decided to put it in my diskless system that boots Arch Linux from NFS, and turn it into a Wi-Fi access point, hoping to improve reception in my living room. Should be easy, right?
We're gonna use hostapd
for this. The problem is, hostapd
will want to bridge the Ethernet connection to the Wi-Fi device, which means temporarily shutting down Ethernet while creating a bridged connection, a thing the NFS client won't like at all and will throw the whole system into a nasty I/O deadlock.
Solution: creating that bridge in the initramfs, ideally before the root is mounted and at the same time the system brings up the networking.
#!/bin/sh ip link add name $2 type bridge ip link set dev $2 up ip link set $1 up ip link set $1 master $2
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<wired MAC address>", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eno1", RUN+="/usr/bin/bridge-add eno1 br0"
eno1
with your actual wired device name and add its MAC address! Also, make bridge-add
executable with chmod +x /usr/bin/bridge-add
.
Add the correct modules and files to your initramfs generator config:
MODULES=(nfsv4 bridge) BINARIES=(/usr/bin/mount.nfs4 /usr/bin/bridge-add) FILES=(/usr/lib/udev/rules.d/70-persistent-net.rules)
Then you can replace eth0
with br0
in your kernel command line on your bootloader:
ip=:::::br0:dhcp nfsroot=192.168.1.10:/arch
Run mkinitcpio, reboot, and hopefully you have a usable system again, but now with a br0
device.
Now you can continue with the instructions on Software access point.
5 GHz networking? Can't use it on my end
Ideally you want to configure hostapd.conf
with hw_mode=a
to use Wi-Fi 5 (aka 802.11ac) capabilities but if Wi-Fi 4 (802.11n) is fine you can use hw_mode=g
.