Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 31 Jul 2014, 18:18
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Network
Puppy as a wifi access point
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [22 Posts]   Goto page: 1, 2 Next
Author Message
tempestuous

Joined: 10 Jun 2005
Posts: 5218
Location: Australia

PostPosted: 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 -
Code:
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:
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:
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
View user's profile Send private message 
tempestuous

Joined: 10 Jun 2005
Posts: 5218
Location: Australia

PostPosted: 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
View user's profile Send private message 
Atle

Joined: 19 Nov 2008
Posts: 283
Location: Oslo, Norway

PostPosted: 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
View user's profile Send private message Visit poster's website MSN Messenger 
Johnny Pest

Joined: 19 Jan 2012
Posts: 5
Location: Philippines

PostPosted: Thu 30 May 2013, 09:10    Post subject: It works
Subject description: It works
 

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
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger 
mahaju


Joined: 11 Oct 2010
Posts: 493
Location: between the keyboard and the chair

PostPosted: Sat 14 Sep 2013, 06:55    Post subject:  

In my computer (Compaq 620 with Puppy Slacko 5.6 on a USB)
Code:
iwconfig wlan0 mode Master

gives me the following error:
Code:
Error for wireless request "Set Mode" (8B06) :
Set failed on device wlan0; Invalid argument   

Also,
Code:
modprobe bridge

Says
Code:
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
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1045

PostPosted: Sat 14 Sep 2013, 15:33    Post subject:  

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!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
mahaju


Joined: 11 Oct 2010
Posts: 493
Location: between the keyboard and the chair

PostPosted: Sat 14 Sep 2013, 23:35    Post subject:  

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?
Back to top
View user's profile Send private message 
Q5sys


Joined: 11 Dec 2008
Posts: 1047

PostPosted: Sun 15 Sep 2013, 00:15    Post subject:  

awesome work!
_________________



My PC is for sale
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1045

PostPosted: Sun 15 Sep 2013, 04:44    Post subject:  

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!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
mahaju


Joined: 11 Oct 2010
Posts: 493
Location: between the keyboard and the chair

PostPosted: Sun 15 Sep 2013, 06:44    Post subject:  

I've got the NON PAE version runinng (in fact I'm using it right now Smile )
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
Back to top
View user's profile Send private message 
mahaju


Joined: 11 Oct 2010
Posts: 493
Location: between the keyboard and the chair

PostPosted: Sun 15 Sep 2013, 06:59    Post subject:  

by the way, how exactly do I run shareinternet?
Typing share and pressing tab on the keyboard doesn't seem to show anything
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1045

PostPosted: Sun 15 Sep 2013, 07:04    Post subject:  

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:
/root/my-roxapps/shareInternet/AppRun

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
mahaju


Joined: 11 Oct 2010
Posts: 493
Location: between the keyboard and the chair

PostPosted: Sun 15 Sep 2013, 07:04    Post subject:  

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:
ifconfig wlan0 up 10.0.0.1 netmask 255.255.255.0

I get the error
Code:
ifconfig: SIOCSIFFLAGS: Operation not possible due to RF-kill

What should I do now?
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1045

PostPosted: Sun 15 Sep 2013, 07:06    Post subject:  

To see what interface is blocked:
Code:
rfkill list

To unblock all:
Code:
rfkill unblock all

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

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
mahaju


Joined: 11 Oct 2010
Posts: 493
Location: between the keyboard and the chair

PostPosted: Sun 15 Sep 2013, 07:22    Post subject:  

WOW it's working
Thanks a lot Smile ^___^
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:
ssid=NetLink

and to change the password, I have to change
Code:
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

Quote:
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?
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [22 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Network
Jump to:  

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
[ Time: 0.1107s ][ Queries: 12 (0.0068s) ][ GZIP on ]