My own WiFi AP: works with pfix-ram, but not with a savefile

Booting, installing, newbie
Post Reply
Message
Author
User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

My own WiFi AP: works with pfix-ram, but not with a savefile

#1 Post by SFR »

Preface: I'm nearly a total ignorant if it comes for networking, so sorry for my 'non-tech', and perhaps confusing, language of describing the stuff.

Ok, here's the background.
I have Slacko-5.5-PAE installed on my, let's name it, Host-Box (Toshiba laptop).
It's connected to the internet via eth0.
I want to share this connection through WiFi with my second laptop (Acer netbook, a.k.a. Client-Box), on which is Slacko-5.5-PAE as well.

Scenario A:
1. Boot my Host-Box using pfix=ram; eth0 connection gets automatically configured.
2. Install ShareIntenet-2.2.4.pet
3. Install hostapd.pet
4. Create my custom /etc/hostapd.conf:

Code: Select all

interface=wlan0
driver=nl80211
ssid=NetLink
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=SomePassword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
(btw, in original there was wpa=3, but it didn't work at all)
5. Launch hostapd using:

Code: Select all

ifconfig wlan0 up 10.0.0.1 netmask 255.255.255.0
hostapd /etc/hostapd.conf
6. Launch ShareInternet

After that I'm perfectly able to connect my Client-Box via WiFi and use internet.

Scenario B:
1-6. (same as 1-6 in Scenario A)
7. Create savefile and reboot
8. Launch hostapd & Shareinternet

Scenario C:
1. Boot my Host-Box with pfix=ram; eth0 connection gets automatically configured
2. Create savefile and reboot
3. (same as 2-6 in Scenario A)

In B & C cases Client-Box can't connect to Host-Box.
Hostapd's output is only:
./set_ap
Configuration file: /etc/hostapd.conf
Using interface wlan0 with hwaddr 70:xx:xx:xx:xx:xx and ssid "NetLink"
and nothing more, whereas in Scenario A, as soon as I launch SNS in Client-Box and select access point + password, additional data starts to flow (authentication) and after a while all's up and running.
It's probably something with authentication indeed, because Wicd (Parted Magic live launched on Client-Box) fails just at 'Authentication' stage...

Any ideas why is that happening and how to fix it?
If some additional info is needed, just let me know.

TIA & Greetings!
Last edited by SFR on Mon 22 Jul 2013, 17:49, edited 2 times in total.
[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
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#2 Post by SFR »

Update.

Trials & errors led me to this:
If I reload my wireless module on Host-Box every time before I launch hostapd, it works at last with a savefile!

Code: Select all

# rmmod rtl8192se
# modprobe rtl8192se
# ./set_ap 
Configuration file: /etc/hostapd.conf
Using interface wlan0 with hwaddr 70:xx:xx:xx:xx:xx and ssid "NetLink"
wlan0: STA 64:xx:xx:xx:xx:xx IEEE 802.11: authenticated
wlan0: STA 64:xx:xx:xx:xx:xx IEEE 802.11: associated (aid 1)
wlan0: AP-STA-CONNECTED 64:xx:xx:xx:xx:xx
wlan0: STA 64:xx:xx:xx:xx:xx RADIUS: starting accounting session 51ED5CD4-00000000
wlan0: STA 64:xx:xx:xx:xx:xx WPA: pairwise key handshake completed (RSN)
...
But it's rather drastic method, which I don't understand (remember: me=network_noob), so:
1. Why I need to reload that module?
2. Is there any simpler/better way (instead of reloading) to get the same result?

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
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#3 Post by Karl Godt »

I am a network zero too, but rc.sysinit tries to figure out which of a half dozen network scripts it would use . If that used one sets some incompatible default settings , I guess you would need to reset them . rmmod the driver is one possibility I think .
Good look while figuring it out .

BTW I think you should rather have posted in the hardware or programming section, since you are not a beginner anymore .

Posting from FF in WinVista since IE7 crashed several times , and happily playing around with the cygwin shell .

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

#4 Post by SFR »

Thanks for the reply, Karl!

I'll take a look what's going on in rc.sysinit.
There must be a way to make it working!
BTW I think you should rather have posted in the hardware or programming section, since you are not a beginner anymore .
In subject of network I'm the eternal beginner (welcome to the club, btw :) ).
But let Flash decide where to put this thread...

Oh, and module reloading turned out to be unreliable - works only sometimes, after few trials. :cry:

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
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#5 Post by SFR »

The monstrosity below is my newest workaround.
We'll see for how long it will be working properly...

Code: Select all

#!/bin/bash

rmmod rtl8192se
sleep 1
modprobe rtl8192se
sleep 1

ifconfig wlan0 up 10.0.0.1 netmask 255.255.255.0
hostapd /etc/hostapd.conf & PID=$!

sleep 5
kill $PID

rmmod rtl8192se
sleep 1
modprobe rtl8192se
sleep 1

ifconfig wlan0 up 10.0.0.1 netmask 255.255.255.0
hostapd /etc/hostapd.conf
+ launch ShareInternet.

Yuk, it's sooo ugly! :roll:

Still, any better solution (and explanation for what am I doing and why am I doing it wrong?) is welcomed. :wink:

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

#6 Post by mahaju »

Hi
I am having problems starting Puppy Slacko with the GUI
(Please see my post here: http://www.murga-linux.com/puppy/viewtopic.php?t=89332 )
I can do puppy pfix = nox, ram and reach the command prompt. What I was trying to know is, if I can some how install the .pet's and replace the hoastapd.conf file entirely from this command prompt and never open the GUI, is it still possible to follow your tutorial and get the Internet sharing to work?
(Also, if you know how to solve my Puppy startup problem, please do help. Some definitive answers would be helpful, as I need to remotely instruct others on how to do this and there's not many different things that I can try)

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

#7 Post by SFR »

Hey Mahaju

Never tried, but I think so.
Here's a script for installing .pets from command line:
http://www.murga-linux.com/puppy/viewto ... 682#526682
Then you can replace the original hostapd.conf with your custom one:

Code: Select all

mv -f /path/to/your/hostapd.conf /etc/hostapd.conf
and launch hostapd + shareinternet (/root/my-roxapps/shareInternet/AppRun).
I suppose that will be all...

As for your main problem - it's a shot in the dark, but since you can move mouse cursor and things beneath do respond, perhaps part of the problem are mouse/touchpad buttons, not working for some reason..? See if you can use keyboard (enter).

HTH
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
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#8 Post by mikeb »

Basic internet sharing would be

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

ppp0 set to whichever interface has the internet so could be eth0, wlan0 etc.

On another thread a user found puppy would not enable 2 network interfaces from a configured set up ...ie after a reboot... wondered if this was related to this problem.... its all a bit of a mystery that would be better if more was understood about it.

mike

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#9 Post by amigo »

The init routines which do the setup for puppy do not really allow for overriding things. Removing the kernel module for the interface shuts it down -which allows you to then set things up manually.

I don't understand why you need to start and kill it before re-starting it. You should be able to simply 'ifconfig down wlan0' and then set it back up the way you need it. If you want it to always do that, then maybe puppy lets you put code in rc.local which will be run at the end of 'normal'(sic) startup. Even if you do need to use rmmod, I don't see anything wrong with that -it's not gonna take forever. Any bit of half-sane setup code you come up with will run much faster than the rc.sysinit routines. The madness of rc.sysinit is the inflexibility -the inability to arbitrarily turn off/on particular bits of startup...

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

#10 Post by SFR »

Hey Mike & Amigo

I was trying lots of random things (IIRC "wlan0 down'n'up" & setting up the firewall manually were among them either) before I've ended up with the above.

Well, I'm afraid that my inborn resistance for absorbing any knowledge regarding networking prevents proper diagnosis of that weird behavior and resolving it in some better manner...

Fortunately, so far my workaround still works, so if it works - better don't touch. :wink:

Thanks &
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
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#11 Post by mikeb »

Well, I'm afraid that my inborn resistance for absorbing any knowledge regarding networking
I have the same problem with business software :D

mike

User avatar
mahaju
Posts: 487
Joined: Mon 11 Oct 2010, 07:11
Location: between the keyboard and the chair

#12 Post by mahaju »

Hi
I was trying to get this to run on a Samsung Sens NC 108 notebook
The GUI problem was fixed but I now have another problem
I followd all your instructions and it works on my Compaq 620 laptop
But in the Sens notebook, after I give the command

Code: Select all

hostapd /etc/hostapd.conf
I get this error:

Code: Select all

configuration file /etc/hostapd.conf
'ine 2: invaid/unknown driver ' nl80211
'ine 4: unknown hw_mode ' g
'ine 11: invalid key_mgmt '
'.ne 12: invalid cipher '
4 errors found in configuration file '/etc/hostapd.conf'
THe hostapd webage at http://wireless.kernel.org/en/users/Doc ... on/hostapd says
If that config errors out with something like:

hostapd $ sudo hostapd ./hostapd-minimal.conf
Configuration file: ./hostapd-minimal.conf
Line 2: invalid/unknown driver 'nl80211'
1 errors found in configuration file './hostapd-minimal.conf'

that means that your distro is not shipping hostapd with nl80211 driver support and you'll need to follow the building instructions that follow. If it works, you can skip down to the configuring hostapd section. If not, continue on.
which is weird, since it's the same dot pet being installed in both the computer. If the nl80211 drivers are installed on my computer by the .pet, why aren't they installed on the notebook?

Again, if I click on the .pet to install hostapd again, and execute the hostapd command in the terminal again, I now get a different error:

Code: Select all

configuration file: /etc/hostapd.conf
nl80211: 'nl80211' Generic Netlink not found
failed to initialize driver 'nl80211' 
Is there any way to fix this?
Thanks

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

#13 Post by SFR »

Hmm, I just checked and hostapd.pet does not come with any drivers actually.
As far as I know/guess the relevant kernel drivers are mac80211 & cfg80211 + /usr/lib/libnl-something stuff. They're OOTB in Slacko.
Perhaps that notebook's WiFi card doesn't support this functionality..?

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
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#14 Post by Ted Dog »

Cool <posted so I can find this later> I'm trying to get my Mele1000 (FatDogARMa3) to do this as well, my wireless router takes more watts to run and can't do nice computer like things.

User avatar
mahaju
Posts: 487
Joined: Mon 11 Oct 2010, 07:11
Location: between the keyboard and the chair

#15 Post by mahaju »

SFR wrote:Hmm, I just checked and hostapd.pet does not come with any drivers actually.
As far as I know/guess the relevant kernel drivers are mac80211 & cfg80211 + /usr/lib/libnl-something stuff. They're OOTB in Slacko.
Perhaps that notebook's WiFi card doesn't support this functionality..?

Greetings!
So is there any way I can find out whether the wifi card supports internet sharing or not?

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

#16 Post by SFR »

Here you go: http://nims11.wordpress.com/2012/04/27/ ... ess-point/
Scroll down to "CHECKING WIFI CARD SUPPORT" section.

HTH
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]

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#17 Post by watchdog »

I have had success to share with a basic tablet the pupdial connection of a netbook, slacko 5.6 installed on it, 3G connection by internet usb dongle. I failed to get working a 3G router with the same usb internet dongle: my provider does not permit this use of my sim-card. Puppy and this thread solved my problem. No need to boot with pfix=ram option. I followed the instructions of the first post. Thanks SFR.

Pelo

Use the wifi connection of computer A with computer B

#18 Post by Pelo »

Use the wifi connection of computer A with computer B. I succeed that by linking by ethernet cable the two computers.
Apparently you don't need any cable.
that is my wish.
SFR was successfull, on test his method.
Business is data base management. Network management sure is harder, in my opinion.
Computer B is an Acer laptop Aspire 1654, even windows xp was not connecting wireless. Puppy will do it ? Nothing to loose trying it... without cable ! I come back..

.# lspci -k | grep -A 3 -i "network"
03:00.0 Network controller: Intel Corporation Centrino Wireless-N 1030 (rev 34)
Subsystem: Intel Corporation Centrino Wireless-N 1030 BGN
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi

Post Reply