[Server-devel] Using a wifi dongle as an AP on the XSCE

Anna aschoolf at gmail.com
Sun Oct 27 23:58:43 EDT 2013


I've got a wifi dongle that I know supports AP mode.  I've previously used
it as an AP with hostapd and dnsmasq on an Ubuntu desktop.  So I wanted to
see how to go about using it with XSCE on an XO 1.75.

The model number printed on the thing is SMCWUSB-N2.  lsusb (once I
installed usbutils) reports this:
Bus 001 Device 004: ID 0cf3:1002 Atheros Communications, Inc. TP-Link
TL-WN821N v2 802.11n [Atheros AR9170]

The XO 1.75 needed firmware for it in /lib/firmware:
http://wireless.kernel.org/en/users/Drivers/carl9170#Firmware_binary

Plugged in the dongle and made sure it was recognized:

-bash-4.2# ifconfig
wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:22:2d:c0:12:e3  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Ensured that AP mode was listed under "Supported interface modes."

-bash-4.2# iw list
...
    Supported interface modes:
         * IBSS
         * managed
         * AP
         * AP/VLAN
         * monitor
         * P2P-client
         * P2P-GO

Install hostapd:
yum -y install hostapd

Some self-explanatory required edits at the bottom of
/etc/hostapd/hostapd.conf:

# Customize these for your local configuration...
interface=wlan0
hw_mode=g
channel=6
ssid=xsce

Before running the XSCE install, edit vars/default_vars.yml for wlan0:
#Network
xsce_networks:
    wan:
      iface: eth0
      ip: dhcp
    lan:
      iface: wlan0
      ip: 172.18.96.1
      network: 172.18.96.0
      netmask: 255.255.224.0

Run the install like normal.  Though if your only connection to the
internet is through eth0, it might drop out (some sort of NM freakout with
the presence of wlan0?).  I ended up redoing the install from scratch with
a wired usb ethernet dongle providing the internet connection.

Once the install completes successfully, do:
systemctl enable hostapd.service

Throw this at the bottom of /etc/rc.d/rc.local:
ifconfig wlan0 172.18.96.1
systemctl restart dhcpd.service
systemctl restart named.service

Reboot.  A client should be able to connect to XSCE via the wifi dongle.

I do a problem with eth0 coming up on boot with this, have to walk over to
the XO 1.75 and manually connect to my wifi in the console.  And this
command is disturbingly inconsistent, I have to try it several times before
eth0 will connect:
nmcli dev wifi connect mywifi

This probably won't support many clients (I've tested with three) and I'm
not sure how stable it is.  And I'm not happy with eth0 not coming up on
boot and then the unreliability of trying to manually connect.  Though if
you're doing a simple demo, using a wifi dongle as an AP might come in
handy if there's no access to a power outlet to plug in an actual AP, since
everything is powered by the XO's battery.

If you only need to serve local content (IIAB, for example), then
technically you don't need eth0 to be up.  Though I am curious what's going
on with eth0, I'm guessing it might be Network Manager related?

Anna Schoolfield
Birmingham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/server-devel/attachments/20131027/bec131b3/attachment-0001.html>


More information about the Server-devel mailing list