neige d'aoust

knowledge, art, and other stuff

User Tools

Site Tools


wifi_ap_diskless

This is an old revision of the document!


Wi-Fi access point on a diskless system

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?

The problem

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.

We could also make a NAT, which would avoid the creation of a bridge, but that's boring, and I don't want a NAT inside of my NAT. The devices connected to the access point should be able to join my home network on the same level as all my other devices connected via wired or other access points.
/usr/bin/bridge-add
#!/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
/usr/lib/udev/rules.d/70-persistent-net.rules
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"
Don't forget to replace 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:

/etc/mkinitcpio.conf
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.

FIXME 5 GHz networking?

wifi_ap_diskless.1749657302.txt.gz · Last modified: by Yuki