Puppy as a wifi access point - OLD !!
Posted: Tue 24 May 2011, 10:12
Important Update Feb 2013:
This package updated for Slacko 5.4 here -
http://www.murga-linux.com/puppy/viewtopic.php?t=84269
All wifi drivers are now supported, not just the ath_pci and hostap drivers.
A Linux computer can be used as wifi access point ("hotspot") using the hostapd application, now attached.
Unfortunately at the time of writing Puppy is at version 5.2.x with a 2.6.33 kernel, and only these three wifi drivers are currently supported:
hostap_pci - for Prism2/3 based PCI wifi devices
hostap_cs - for Prism2/3 based PCMCIA wifi devices
ath_pci (MADWiFi) - for Atheros AR521x PCI/miniPCI/PCMCIA wifi devices
The ath_pci driver is not provided in Puppy 5.2.x, since it conflicts with the standard ath5k driver, but I have provided this driver (2 different versions) below.
INSTRUCTIONS:
i) Install the hostapd dotpet and bridge-utils dotpets from the bottom of this post.
ii) Also install one of the madwifi dotpets if you have an Atheros AR512x wifi device (PCI or PCMCIA), and reboot.
I will assume the use of a MADWiFI-compatible wifi device under Puppy 5.1/5.2.x
If you're using a hostap-compatible wifi device, alternative commands are shown in red.
First have a think about:
- what you want your Access Point to be known as - this is the SSID.
- whether you want WPA or WPA2 encryption, or no encryption.
- if encryption, what passphrase. Then you should convert your chosen ASCII passphrase into its true 64 digit hex value, using this command -
All of these parameters then need to be entered into the configuration file; /etc/hostapd.conf
I have pre-configured this file for the SSID of "Puppy_Hotspot", using WPA2 encryption, with the PSK passphrase "woof1234".
so there's no need to change anything - you can just use my settings if you wish.
But it's worth opening /etc/hostapd.conf in Geany just to see what I'm talking about. You will see that I have commented out the PSK password (woof1234) and used the full passphrase hex value, calculated as explained earlier.
Note the relevant value for WPA2 encryption: "wpa_pairwise=CCMP"
If you want to use the older WPA encryption, you will need: "wpa_pairwise=TKIP"
And if you want no encryption, you will need: "wpa=0"
For the hostap_pci/hostap_cs drivers, change "interface=ath0" to "interface=wlan0", and change "driver=madwifi" to "driver=hostap", and change "hw_mode=g" to "hw_mode=b".
Now connect your Puppy computer's ethernet interface to some form of modem/router. This will be the internet connection that you are about to share via your wifi interface.
If you have previously set up your ethernet interface with Puppy's Network Wizard, these settings must be killed. First bring down the ethernet interface -
Now you must kill the dhcpcd daemon - THIS IS VERY IMPORTANT.
Go to Menu > System > System Status and Config > Pprocess process manager
and somewhere in the list of processes you should see "dhcpcd -d -l eth0"
Select it, and press "End process"
Now you need to remove the stale dhcpcd run file with this command -
Now change your wifi driver from its default "Station/Managed" mode to "AP/Master" mode -
Or for the hostap_pci/hostap_cs drivers, do this instead
ifconfig wlan0 down
iwconfig wlan0 mode Master
Next you need to bridge your ethernet interface to your wifi interface, with these commands:
Or for the hostap_pci/hostap_cs drivers, change "ath0" to "wlan0".
Note that your Puppy computer is now seen on the LAN by its bridged interface: br0.
Now in theory it's optional to give the Puppy computer an IP address for its bridged interface,
but in practice I found this is essential. So do this -
I found that this may take 15 seconds or so! dhcpcd seems to struggle with a "br0" interface.
Various code will run by, and eventually you should see "...forking to background".
Now you're finally ready to run the hostapd daemon
The last two lines you see will be
"ath0: Setup of interface done.
l2_packet_receive - recvfrom: Network is down"
Don't worry, this means success.
Any wifi client (running on any operating system) should now be able to connect to your Puppy access point.
THE GOOD NEWS IS THAT I HAVE CREATED A SCRIPT WITH ALL THESE COMMANDS!
The script is installed at /usr/bin and it's called "Wifi-AP-launch.sh"
Obviously you can run this script from an rxvt terminal, but better still, I have created a desktop launch-script called "Wifi-AP-launch". With ROX, go to /usr/bin and drag the icon for "Wifi-AP-launch" (not Wifi-AP-launch.sh") onto the desktop. This is ready to go, but it has a generic icon. To give it a nice icon, right-click it, select File 'Wifi-AP-launch' > Set Icon...
and this will present a window. Use ROX to drag /usr/local/lib/X11/pixmaps/Wifi-AP-48.png into the window.
Done!
UPDATE: just because your Puppy computer is now a wifi Access Point, don't assume it's acting as a router ... it's not. See my later post about router/server/network considerations -
http://www.murga-linux.com/puppy/viewto ... 738#551738
This package updated for Slacko 5.4 here -
http://www.murga-linux.com/puppy/viewtopic.php?t=84269
All wifi drivers are now supported, not just the ath_pci and hostap drivers.
A Linux computer can be used as wifi access point ("hotspot") using the hostapd application, now attached.
Unfortunately at the time of writing Puppy is at version 5.2.x with a 2.6.33 kernel, and only these three wifi drivers are currently supported:
hostap_pci - for Prism2/3 based PCI wifi devices
hostap_cs - for Prism2/3 based PCMCIA wifi devices
ath_pci (MADWiFi) - for Atheros AR521x PCI/miniPCI/PCMCIA wifi devices
The ath_pci driver is not provided in Puppy 5.2.x, since it conflicts with the standard ath5k driver, but I have provided this driver (2 different versions) below.
INSTRUCTIONS:
i) Install the hostapd dotpet and bridge-utils dotpets from the bottom of this post.
ii) Also install one of the madwifi dotpets if you have an Atheros AR512x wifi device (PCI or PCMCIA), and reboot.
I will assume the use of a MADWiFI-compatible wifi device under Puppy 5.1/5.2.x
If you're using a hostap-compatible wifi device, alternative commands are shown in red.
First have a think about:
- what you want your Access Point to be known as - this is the SSID.
- whether you want WPA or WPA2 encryption, or no encryption.
- if encryption, what passphrase. Then you should convert your chosen ASCII passphrase into its true 64 digit hex value, using this command -
Code: Select all
wpa_passphrase <ssid> <passphrase>
I have pre-configured this file for the SSID of "Puppy_Hotspot", using WPA2 encryption, with the PSK passphrase "woof1234".
so there's no need to change anything - you can just use my settings if you wish.
But it's worth opening /etc/hostapd.conf in Geany just to see what I'm talking about. You will see that I have commented out the PSK password (woof1234) and used the full passphrase hex value, calculated as explained earlier.
Note the relevant value for WPA2 encryption: "wpa_pairwise=CCMP"
If you want to use the older WPA encryption, you will need: "wpa_pairwise=TKIP"
And if you want no encryption, you will need: "wpa=0"
For the hostap_pci/hostap_cs drivers, change "interface=ath0" to "interface=wlan0", and change "driver=madwifi" to "driver=hostap", and change "hw_mode=g" to "hw_mode=b".
Now connect your Puppy computer's ethernet interface to some form of modem/router. This will be the internet connection that you are about to share via your wifi interface.
If you have previously set up your ethernet interface with Puppy's Network Wizard, these settings must be killed. First bring down the ethernet interface -
Code: Select all
ifconfig eth0 down
Go to Menu > System > System Status and Config > Pprocess process manager
and somewhere in the list of processes you should see "dhcpcd -d -l eth0"
Select it, and press "End process"
Now you need to remove the stale dhcpcd run file with this command -
Code: Select all
rm -f /var/run/dhcpcd-eth0.*
Code: Select all
ifconfig ath0 down
wlanconfig ath0 destroy
wlanconfig ath0 create wlandev wifi0 wlanmode ap
ifconfig wlan0 down
iwconfig wlan0 mode Master
Next you need to bridge your ethernet interface to your wifi interface, with these commands:
Code: Select all
ifconfig eth0 0.0.0.0 up
ifconfig ath0 0.0.0.0 up
modprobe bridge
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 ath0
Note that your Puppy computer is now seen on the LAN by its bridged interface: br0.
Now in theory it's optional to give the Puppy computer an IP address for its bridged interface,
but in practice I found this is essential. So do this -
Code: Select all
rm -f /var/run/dhcpcd-br0.*
dhcpcd -t 30 -h puppypc -d br0
Various code will run by, and eventually you should see "...forking to background".
Now you're finally ready to run the hostapd daemon
Code: Select all
hostapd /etc/hostapd.conf -dd
"ath0: Setup of interface done.
l2_packet_receive - recvfrom: Network is down"
Don't worry, this means success.
Any wifi client (running on any operating system) should now be able to connect to your Puppy access point.
THE GOOD NEWS IS THAT I HAVE CREATED A SCRIPT WITH ALL THESE COMMANDS!
The script is installed at /usr/bin and it's called "Wifi-AP-launch.sh"
Obviously you can run this script from an rxvt terminal, but better still, I have created a desktop launch-script called "Wifi-AP-launch". With ROX, go to /usr/bin and drag the icon for "Wifi-AP-launch" (not Wifi-AP-launch.sh") onto the desktop. This is ready to go, but it has a generic icon. To give it a nice icon, right-click it, select File 'Wifi-AP-launch' > Set Icon...
and this will present a window. Use ROX to drag /usr/local/lib/X11/pixmaps/Wifi-AP-48.png into the window.
Done!
UPDATE: just because your Puppy computer is now a wifi Access Point, don't assume it's acting as a router ... it's not. See my later post about router/server/network considerations -
http://www.murga-linux.com/puppy/viewto ... 738#551738