Jan 132010
 

If you know how to do it, most things are simple. Figuring out how to make my Asrock ION 330HT-BD (running Ubuntu Karmic) a wireless access point took me a couple of hours. For my own reference and maybe to save you some time I wrote down all steps.

How-to

  • Check wireless adapter type
    • lspci -v | grep Network

      • Should be AR9285
  • Enable IP forwarding
    • sudo gedit /etc/sysctl.conf
      • Uncomment
        • net.ipv4.ip_forward = 1
    • Live change
      • sudo echo 1 > /proc/sys/net/ipv4/ip_forward
    • Check
      • cat /proc/sys/net/ipv4/ip_forward
  • Give wireless adapter a static address
    • sudo gedit /etc/network/interfaces
      • Add code below
    • Live change
      • sudo /etc/init.d/networking restart
    • Check
      • ifconfig wlan0
auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet static
    address 192.168.0.1
    netmask 255.255.255.0
    broadcast 192.168.0.255
  • Download latest Linux wireless drivers (currently version 2.6)
    • Extract archive
    • Build/install
      • cd compat-wireless-*
      • ./scripts/driver-select ath9k
      • make
      • sudo make unload
      • sudo make install
      • Redo when new kernel
    • Live change
      • sudo modprobe ath9k
    • Check
      • grep ath9k /var/log/syslog
  • Install hostapd
    • sudo apt-get install hostapd
    • sudo gedit /etc/default/hostapd
      • Uncomment
        • RUN_DAEMON=”yes”
        • DAEMON_CONF=”/etc/hostapd/hostapd.conf”
    • sudo gedit /etc/hostapd/hostapd.conf
      • Add
        • driver=nl80211
      • Change
        • ssid=<name>
        • hw_mode=g
        • auth_algs=1
        • wpa=2
        • wpa_passphrase=<password>
        • wpa_pairwise=TKIP
    • Live change
      • sudo /etc/init.d/hostapd restart
    • Check
      • grep hostapd /var/log/syslog
  • Install dnsmasq
    • sudo apt-get install dnsmasq
    • sudo gedit /etc/default/dnsmasq
      • Uncomment
        • DNSMASQ_OPTS=”–conf-file=/etc/dnsmasq.conf”
      • Comment
        • #CONFIG_DIR=/etc/dnsmasq.d
    • sudo gedit /etc/dnsmasq.conf
      • Add
        • interface=wlan0
        • dhcp-range=192.168.0.2,192.168.0.127,12h
    • Live change
      • sudo /etc/init.d/dnsmasq restart
    • Check
      • grep dnsmasq /var/log/syslog
  • Routing
    • Give the Asrock a static IP 192.168.1.x
      • Preferable by your local DHCP server (based on MAC address)
    • Add a static route 192.168.0.0/255.255.255.0 > 192.168.1.x
      • In your modem/router
  • Now you should be able to connect

Links

 Posted by at 8:37  Tagged with:

  9 Responses to “Asrock ION 330HT as Wireless Access Point”

  1. I am having a Broadcom 4312 driver in my dell inspiron 1545 will your setup will work in my PC, Kindly give your suggestion.

    • To start with, you should do the first step of the how-to to discover your exact adapter type. After that you’ll have to check if your adapter is supported by the Linux wireless drivers and if so, select the correct driver (see build/install).

  2. I have a slightly different setup:

    A separate firewall/DHCP server.
    A Zotac IONITX-P-E (just like John above).

    I would like to use the Zotac (also) as a transparent access point (no masquerading).
    Is it possible?
    What should I change?

    • You could try to relay DCHP requests, but I’ve no idea about how to do the routing without a separate sub-net.

    • In fact, I have a similar setup. DSL router + firewall + DHCP server and an internal (wired) 192.168.1.x network. My first approach was to create one big internal network (wired and wireless in the same network, sharing the same DHCP server, behind the same firewall).

      I didn’t get this to work and went for 2 separate networks. Perhaps it will work with DHCP relay, my old AP, a Linksys WAP54G does basically the same. I think it’s better to create an extra network, eg. 192.168.0.x for wireless. You can easily achieve this with dnsmasq.

      I’m not sure how this situation should work on one big network: a wired device, let’s say 192.168.1.2 wants to connect to a wireless device, let’s say 192.168.1.4. How does it “know” it has to send it’s request to 192.168.1.3, the wired interface of the AP?

  3. Hi Marcel,

    Thanks, this gave me a nice jump start. I have a Zotac IONITX-P-E, with the same wireless card.
    To enable 802.11n, in hostapd.conf you should also set:
    ieee80211n=1
    wmm_enabled=1
    ht_capab=[HT40-][HT40+][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]

    For other cards, use ‘iw list’ to check your cards HT capabilities (ht_capab).

  4. THanks Marcel,

    This has got my Asrock running nicely on Ubuntu 9.10 Kernel 2.6.31-20.
    The only thing I had to do differently was that I had to use iptables rather the route to configure my wireless lan to the internet ie.
    iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
    This nicely redirects all traffic from the wireless network through to the wired network.

  5. Hi Marcel,

    Nice blog! I have done basically the same thing and found this posting very informative. I’m using a Dell Mini 9 running Ubuntu 9.10. It is acting as a NAT router/firewall (UFW with NAT rules), DHCP server (dhcp3-server) and AP (hostapd with Atheros AR928x based card). My question is related to the performance of your AP. While my AP configuration seems to work for the most part, my clients drop their connection regularly. Based on syslog this seems to be due to some kind of deauthentication/authentication issue. The only way to get the clients to reconnect is to manually restart hostapd.

    I’m curious to know if you have seen this behavior on your AP as well. If you have, how have you resolved the issue?

    Thanks!

    • Actually I haven’t used the access point very much, because it appeared to be unstable when I use NFS (the PC/Ubuntu stops responding completely; this doesn’t happen when I use the wired connection) and the wireless range was limited (the Asrock has no external antenna).

      I didn’t see your deauthentication/authentication problem. Maybe it has to do with encryption. I used WPA2 only.