The time now is Tue 21 May 2013, 22:42
All times are UTC - 4 |
| Author |
Message |
tempestuous
Joined: 10 Jun 2005 Posts: 4944 Location: Australia
|
Posted: Fri 08 Feb 2013, 22:49 Post subject:
Puppy as a wifi access point |
|
A Linux computer can be used as wifi access point ("hotspot") using the hostapd application, now attached.
At Feb 2013 I have compiled hostapd under Slacko 5.4. This package might work with other Puppy versions and their modern kernels, but it's likely to fail with older Puppy versions (such as Lucid 5.1/5.2.x) since older kernels don't have "nl80211" wifi support.
INSTRUCTIONS:
Install these two dotpets -
www.smokey01.com/tempestuous/hostapd-2.0.pet
www.smokey01.com/tempestuous/bridge-utils-1.5.pet
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: | | wpa_passphrase <ssid> <passphrase> |
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 "wpa=0"
And if you want no encryption, you will need to comment out the line "wpa=.."
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.
I will assume your ethernet interface is "eth0" and your wifi interface is "wlan0".
If in doubt, run this command to check -
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 -
| Code: | | rm -f /var/run/dhcpcd-eth0.* |
Now change your wifi driver from its default "Station/Managed" mode to "AP/Master" mode -
| Code: | ifconfig wlan0 down
iwconfig wlan0 mode Master |
Next you need to bridge your ethernet interface to your wifi interface, with these commands:
| Code: | ifconfig eth0 0.0.0.0 up
ifconfig wlan0 0.0.0.0 up
modprobe bridge
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 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 -
| Code: | rm -f /var/run/dhcpcd-br0.*
dhcpcd -t 30 -h puppypc -d br0 |
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
| Code: | | hostapd /etc/hostapd.conf -dd |
The last two lines you see will be
"wlan0: 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!
|
|
Back to top
|
|
 |
tempestuous
Joined: 10 Jun 2005 Posts: 4944 Location: Australia
|
Posted: Fri 08 Feb 2013, 22:54 Post subject:
|
|
Router/server/network considerations
Once configured as explained in the first post, your Puppy computer is now a wifi access point, but it's not a router.
You need to be aware that the network configuration is reliant upon the external modem or router that's connected to the ethernet port of the Puppy computer.
The modem/router will, for example, typically assign Puppy's "br0" interface an IP address of 192.168.0.2.
Then when a wifi client connects to Puppy, it's effectively looking through Puppy to the modem/router, which will most likely assign it an IP address of 192.168.0.3.
Now if you want Puppy to act as a server, that's OK, the client can access Puppy at 192.168.0.2, but Puppy is a network peer, not a network server. Puppy is dependent upon the external router for its IP address, and the various services that you run on Puppy will need to be configured for this IP address ... and the IP address can obviously change.
If you want to run server applications on your Puppy wifi access point, it would be optimal if Puppy was configured as a full network server, and the good news is that this is certainly possible. In this scenario, Puppy takes an external IP address from the modem on its ethernet interface as before, but Puppy also has its own LAN, with a different range of IP addresses, starting, for example, from 10.0.0.1.
Now Puppy's internal IP address is fixed, and the wifi clients can always access Puppy at the same address.
The bad news is that I don't know how to set this up.
I know that some of our forum regulars are experts in networking, and they would need to weigh in with the right information.
|
|
Back to top
|
|
 |
Atle
Joined: 19 Nov 2008 Posts: 211 Location: Oslo, Norway
|
Posted: Thu 21 Feb 2013, 01:35 Post subject:
|
|
This is just great... Love to make this work...
I have a Atheros AR5BXB63 listed as AR242x/AR542x that uses ath5k driver.
Did not succeed with the non PAE Slacko that has a slightly older kernel then the PAE version, so the one with a more new kernel is downloaded now.
Found some useful information about Hostapd that might be useful in order to understand Hostapd
My aim is to have a working laptop with hostapd hooked to the webserver and then install Joomla 3.0. A out of the box solution:-) Offered as a download for other happy puppy campers...
******************************
Update I
With the Slacko PAE version and a never kernel it WORKED...
Yet I must still figure out why the hostapd does not give out a IP adress.
That... I think... I will find out soon...
*****************************
*****************************
Update II
I uninstalled the Bridge pet and all of a sudden the signal came good as it was reported as a low signal. I guess i am not going to bridge and does not need that. I google a little around to see if others have made similar, a webserver that you connect to with hostapd, but have not found any good information. But... the good news is that its not supposed to be finished today, but soon it needs to work..
Might also be the android phone i use for testing the connection...
*******************************
|
|
Back to top
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|