Puppy as a wifi access point

Configuration wizards, scanners, remote desktop, etc.
Message
Author
tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

Puppy as a wifi access point

#1 Post by tempestuous »

UPDATE Sep 21 2014
The solution I provided here involves using a Puppy computer as a wifi bridge
A more comprehensive approach; wifi access point PLUS full router solution, is now provided by rcrsn51 here -
http://www.murga-linux.com/puppy/viewtopic.php?t=95768

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 -
http://www.smokey01.com/tempestuous/hostapd-2.0.pet
http://www.smokey01.com/tempestuous/bri ... ls-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: Select all

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 -

Code: Select all

ifconfig
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
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: Select all

rm -f /var/run/dhcpcd-eth0.*
Now change your wifi driver from its default "Station/Managed" mode to "AP/Master" mode -

Code: Select all

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 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: Select all

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: Select all

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!
Last edited by tempestuous on Sun 21 Sep 2014, 11:22, edited 1 time in total.
tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#2 Post by tempestuous »

UPDATE Sep 21 2014
Wifi access point PLUS full router solution is now provided by rcrsn51 here -
http://www.murga-linux.com/puppy/viewtopic.php?t=95768


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.
Last edited by tempestuous on Sun 21 Sep 2014, 11:24, edited 1 time in total.
Atle
Posts: 596
Joined: Wed 19 Nov 2008, 12:38
Location: Oslo, Norway
Contact:

#3 Post by Atle »

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...
*******************************
Johnny Pest
Posts: 5
Joined: Fri 20 Jan 2012, 02:14
Location: Philippines
Contact:

It works

#4 Post by Johnny Pest »

Hi,

This works with Slacko 5.5 installed on an EEEPC 900.

Got to make it work with the firewall by adding br0 as an allowed network interface.

Thanks! Very convenient for travellers
User avatar
mahaju
Posts: 487
Joined: Mon 11 Oct 2010, 07:11
Location: between the keyboard and the chair

#5 Post by mahaju »

In my computer (Compaq 620 with Puppy Slacko 5.6 on a USB)

Code: Select all

iwconfig wlan0 mode Master
gives me the following error:

Code: Select all

Error for wireless request "Set Mode" (8B06) :
Set failed on device wlan0; Invalid argument	
Also,

Code: Select all

modprobe bridge 
Says

Code: Select all

FATAL: Modulr bridge not found
I have already installed both the dot pets mentioned at the beginning of the post
Also, please see here for my attempts at trying to make this work in Lucid Puppy 5.1.1 (which did not work, by the way, which is the reason I tried this on Slacko 5.6)
http://www.murga-linux.com/puppy/viewtopic.php?t=88751
User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#6 Post by SFR »

Mahaju, which Slacko-5.6 version?
If it's PAE - it has some missing network modules, so try NON-PAE.

Also, take a look at this thread:
http://www.murga-linux.com/puppy/viewtopic.php?t=87584
I'm using this method with Slacko-5.6-4g now and it works perfectly.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
User avatar
mahaju
Posts: 487
Joined: Mon 11 Oct 2010, 07:11
Location: between the keyboard and the chair

#7 Post by mahaju »

It was slacko-5.6-PAE I downloaded from here:
http://distro.ibiblio.org/puppylinux/puppy-5.6/
Do I need to download the non PAE version again?
By the way, I could not get it to work on Windows 7 Home Professional installed in this laptop's harddrive either
Is there any way I check whether my hardware supports this feature or not?


I think I'd better follow the instructions on the link you provided because I don't want to download Slacko 5.6 non PAE just to find out it doesn't work
I don't mind the puppy version as long as I can get the feature
By the way, I will need to do this again later in another notebook computer (Not laptop). It's less than a year old so I am guessing the hardware itself will support this feature
What I want to know is, ff I make sure that I can get this feature to work on my laptop, can I also be fairly certain that it will work on the other notebook?
User avatar
Q5sys
Posts: 1105
Joined: Thu 11 Dec 2008, 19:49
Contact:

#8 Post by Q5sys »

awesome work!
User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#9 Post by SFR »

mahaju wrote:I think I'd better follow the instructions on the link you provided because I don't want to download Slacko 5.6 non PAE just to find out it doesn't work
Unfortunately, in this case Slacko-5.6-PAE (not Slacko-5.5-PAE) also lacks at least one of needed modules, it's ipt_MASQUERADE.ko.
Sorry, but I don't think you'll get it to work on the PAE version, unless you compile the missing modules yourself (I tried, I failed, I switched to NON-PAE).
BTW, Mick already knows about this issue and hopefully next release will be fixed.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
User avatar
mahaju
Posts: 487
Joined: Mon 11 Oct 2010, 07:11
Location: between the keyboard and the chair

#10 Post by mahaju »

I've got the NON PAE version runinng (in fact I'm using it right now :) )
Anyway, like I said, I don't mind the puppy version as long as I can get it to share the laptop's ethernet connection through Wifi
I will post my updates here soon
thank you for your help
User avatar
mahaju
Posts: 487
Joined: Mon 11 Oct 2010, 07:11
Location: between the keyboard and the chair

#11 Post by mahaju »

by the way, how exactly do I run shareinternet?
Typing share and pressing tab on the keyboard doesn't seem to show anything
User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#12 Post by SFR »

mahaju wrote:by the way, how exactly do I run shareinternet?
Typing share and pressing tab on the keyboard doesn't seem to show anything
Oh, it's in /root/my-roxapps. Just click shareInternet rox-app.
Or, from command line:

Code: Select all

/root/my-roxapps/shareInternet/AppRun
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
User avatar
mahaju
Posts: 487
Joined: Mon 11 Oct 2010, 07:11
Location: between the keyboard and the chair

#13 Post by mahaju »

I followed the instructions at the first post of you thread ( http://www.murga-linux.com/puppy/viewtopic.php?t=87584 )
After giving the command

Code: Select all

ifconfig wlan0 up 10.0.0.1 netmask 255.255.255.0 
I get the error

Code: Select all

ifconfig: SIOCSIFFLAGS: Operation not possible due to RF-kill
What should I do now?
User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#14 Post by SFR »

To see what interface is blocked:

Code: Select all

rfkill list
To unblock all:

Code: Select all

rfkill unblock all
Also, check if it's not blocked by some physical switch.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
User avatar
mahaju
Posts: 487
Joined: Mon 11 Oct 2010, 07:11
Location: between the keyboard and the chair

#15 Post by mahaju »

WOW it's working
Thanks a lot :) ^___^
the good thing is I can use the Internet both on the computer and the tablet now
Thank you soooo much
Just want to make sure about one thing though
To change the name of the network that the tablet sees in the Wifi list, I have to change

Code: Select all

ssid=NetLink

and to change the password, I have to change

Code: Select all

wpa_passphrase=SomePassword 
Is this all that I need to do? (I just want to make sure, as I have no idea what is happenning behind the scenes, or how do I trouble shoot it if something goes wrong
I am actually confused about this part of the original post
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>
Do I need to worry about this if I use wpa_passphrase=SomePassword in the conf file?
User avatar
mahaju
Posts: 487
Joined: Mon 11 Oct 2010, 07:11
Location: between the keyboard and the chair

#16 Post by mahaju »

I just realised I forgot about something more important
How do i stop internet sharing through wifi?
Clicking on shareinter through the file manager again seems to remove the green circle from it's icon, but the laptop wifi is still sharing it's internet
User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#17 Post by SFR »

mahaju wrote:WOW it's working
Thanks a lot :) ^___^
the good thing is I can use the Internet both on the computer and the tablet now
Thank you soooo much
Just want to make sure about one thing though
To change the name of the network that the tablet sees in the Wifi list, I have to change

Code: Select all

ssid=NetLink

and to change the password, I have to change

Code: Select all

wpa_passphrase=SomePassword 
Is this all that I need to do? (I just want to make sure, as I have no idea what is happenning behind the scenes, or how do I trouble shoot it if something goes wrong
I am actually confused about this part of the original post
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>
Do I need to worry about this if I use wpa_passphrase=SomePassword in the conf file?
Well, I hope that's all what's needed.
But actually, at this point you know as much as I do if it comes for setting the whole thing up.

BTW, this article was helpful when I was fiddling with hostapd.conf:
http://nims11.wordpress.com/2012/04/27/ ... ess-point/

Glad could help! :)
I just realised I forgot about something more important
How do i stop internet sharing through wifi?
Clicking on shareinter through the file manager again seems to remove the green circle from it's icon, but the laptop wifi is still sharing it's internet
Hmm, that's odd... Try this, I'm using it to completely disable sharing and access point:

Code: Select all

#!/bin/bash

# To determine kernel wireless driver, use this:
# lspci -k | grep -A3 -i 'wireless'

DRIVER=rtl8192se

/root/my-roxapps/shareInternet/AppRun
killall hostapd

rmmod $DRIVER
sleep 1
modprobe $DRIVER
Just replace DRIVER= with yours.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#18 Post by tempestuous »

mahaju wrote:Do I need to worry about this if I use wpa_passphrase=SomePassword in the conf file?
No, the passphrase will generally work fine.
It's just an added degree of reliability if you can pre-convert the passphrase into its equivalent hex value - since hostapd must eventually do this conversion, anyway.

To be clear, the configuration line for the passphrase is -
"wpa_passphrase="

and the configuration line for the equivalent hex value is-
"wpa_psk="

You should comment out whichever line is not being used.
bill
Posts: 490
Joined: Wed 28 May 2008, 15:32

Puppy as a wifi access point

#19 Post by bill »

Trying this in Slacko 531but according to the Package Manager I am missing these.
libssl.so.1 and libcrypto.so.1

are these required or is the PPM telling me a tale? cheers
Snacktime

TP-Link TL-WN722N

#20 Post by Snacktime »

For the TP-Link TL-WN722N:

I got it working in AP mode. My installed package list looks like:

iw-0.9.9 (from forum)
libnl3-3.2.11 (from package manager)
hostapd-2.0
bridge-utils-1.5

There's an updated version of iw in the package manager but I haven't tried it yet since the old version works. The WN722N throws the same (8B06) error code that mahaju ran into. It doesn't switch modes with iwconfig. I think the nl80211 driver it uses is looking for iw and iw's dependent libnl so that hostapd can switch the mode automatically when it runs. Turn hostapd on in a second terminal before you run the wlan0 bridge command. That will let it go through. Then killall hostapd to turn it off and run the last commands to finalize the bridge. Afterwards start hostapd again and you'll be able to connect.
Post Reply