2005/05/19

ARTICAL - Using Linux as a Wireless Access Point

The SMC2602W is a PCI card with a PCMCIA wireless card (based on the Prism2 chip) mounted on it. However, it doesn't use a PCMCIA interface, so any information or tutorials you have that tell you to load the pcmcia-cs drivers are wrong if you are using this card. After putting the card in you PC, you'll see something like the following from lspci -vv:
  00:0a.0 Network controller: Unknown device 1638:1100 (rev 02)
      Subsystem: Unknown device 1638:1100
      Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- -->
      <-- VGASnoop- ParErr- Stepping- SERR- FastB2B-
       Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- -->
       <-- DEVSEL=medium >TAbort- SERR- 

If your intent is to use the card as an access point to your wired network, then all you have to do is

  1. compile the hostap_plx.o module. For me, this took a small modification to the Makefile (to tell it where to find the kernel source, something you may not need to change) and then make plx.
  2. After that, insmod hostap_plx.o loads the module and you have an interface to play set up for NAT and whatnot.
  3. Now, set up your dhcp daemon. On debian, you've got to set /etc/init.d/dhcp to point to the right interface. Also, modify your /etc/dhcp.conf to serve up IPs on your wireless network (say, 10.x.x.x).
  4. After starting dhcpd, make sure that your laptop (Windows, Mac, or whatever) gets an IP address when you are in range.
  5. You still won't be able to get out to your wired network from your laptop, though, so you need to set up NAT. The simple way to do this is iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE (where eth0 is your interface to your wired network.
  6. That's It! You probably want to look at the Linux IP masquerading HOWTO for information on securing your network.

No comments: