This post is dealing with the issues that have arisen from trying to turn my PC into a WiFi hotspot using hostapd in CentOS 6.5.
I have neglected this site so badly that I'd completely forgotten part 1, it is worth checking out.
I have a D-Link WiFi router (WBR-2310) that loses its ability to serve up WiFi connections to various mobile devices, requiring semi-frequent reboots of the router. This takes the network down for 30-35 seconds - a huge and unbearable burden.
The fix (number one) was to use an ancient LinkSys non-WiFi router as the household router and the D-Link as a WiFi Access Point.
Then I scavenged a USB WiFi card, which I mounted into my main tower.
This is to become a secondary WiFi access point.
hostapd to the rescue. Initially, I got a working setup, but that was prior to bringing the LinkSys into the equation. Now that I have two routers, I decided to revisit the hostapd backup solution.
Initially I'm aiming for an open (non-password-protected) AP, and the details of how to set up hostapd.conf are covered many other places elsewhere.
This has proven more difficult than anticipated, particularly since simply bringing up wlan0 and starting the hostapd service failed with unloaded driver error.
First of all, some details on the card:
As we can see, the card self-identifies as an Ralink RT2571W. However, the kernel drivers needed for it are not rt2500usb, nor rt2x00usb, nor what the kernel somehow auto-loaded, rndis_wlan.
Instead, one needs to load the rt73usb driver, and in my case, also unload the rndis_wlan:
Then, I want to make a persistent wlan0 interface that is active upon boot, so I made a file /etc/sysconfig/network-scripts/ifcfg-wlan0, and added these to it:
IPADDR=192.168.1.169
NETMASK=255.255.255.0
NETWORK=192.168.1.0
GATEWAY=192.168.1.1
ONBOOT=yes
MODE=AP
TYPE=Wireless
BOOTPROTO=none
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
# KEY_MGMT=WPA-PSK
# WPA_ALLOW_WPA=yes
# CIPHER_PAIRWISE=NONE
# CIPHER_GROUP=TKIP
PEERDNS=no
I run a DHCP server on the PC - you'll need something that will have the same functionality.
Now, one ought to be able to obtain an IP address on a WiFi enabled mobile device (at least if DHCPD is running on the main PC).
But in order to, say, ping that device, a routing table entry must be made to tell the PC how to find the mobile. In my case, the mobile is 192.168.1.96 and the WiFi card is wlan0:
Presto - the running ping from mobile to PC that was failing is now successful.
Now, a couple of iptables rules need to be applied, and this is where I'm having problems. I understand basic iptables rules just fine, but the ones I have just don't seem to be working.
I'll save my post for now and add more when I've dug into why the final steps are failing.
SOLVED: See solution added in comment