WiFi Access Point in Linux (part 1)

I found a WiFi card in an old HP box. Someone gave me an antenna for it - I wanted to turn it into an alternate WiFi access point as my WiFi router requires regular reboots as our mobile devices regularly fail to connect.

As it's getting quite late, I thought I'd better make a quick note on what I had to do to enable hostapd to work.

It was failing to go into Master mode - would only accept Monitor or Ad-Hoc modes.

Turns out, needed to turn off hardware encryption on the driver.

modprobe --remove rt73usb
modprobe rt73usb nohwcrypt=Y
service hostapd start

And, success. Note that iwconfig wlan0 mode Master also failed.

To make it permanent: in your favourite editor, create file called /etc/modprobe.d/rt73usb.conf and add this:

options rt73usb nohwcrypt

inside.

To check the possible options on a kernel driver, for example the rt73usb being discussed here:

modinfo rt73usb

Here's the final, crucial line of output from the above command:

parm: nohwcrypt:Disable hardware encryption. (bool)

Must now get DHCPD.conf set up (for virbr0 and vnet0 - for KVM not for WiFi), and proper packet forwarding as my phone's connecting but not getting traffic through.

A couple of things suggested:

echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -I POSTROUTING 1 -o eth0 -j MASQUERADE

Note that I inserted -I an entry into the POSTROUTING table, instead of the recommended -A append. This is more important with the FORWARD chain, as CentOS has a nice, secure default final rule of REJECT ALL.

The IP forwarding was already set up, and the iptables thing didn't work for me.


See where I revisit this issue at part 2.
Will investigate what I did wrong in the morning.


SOLVED: See solution in this comment.