Simple Network Setup

A couple of days ago, I was struggling with Pwireless2, trying to get it to work properly in Quirky.

Then I thought, "perhaps I should write my own network setup tool, then I would understand what is going on". It's crazy, considering all the man-hours that have gone into the Network Wizard, Pwireless and other network setup tools, for me to think about writing yet another from scratch.

Crazy, but I have been writing what I call 'Barry's Simple Network Setup'.

It is extremely simple and works nicely. SNS will connect to a wired or wireless network and remembers at next bootup. I have designed it to handle different network interfaces, as I am often changing USB network devices. It also handles multiple networks, such as if you take your laptop to different places.

However, I don't know anything about WPA, so it only handles un-encrypted or WEP-encrypted wireless networks so far. WPA is of course a big topic on it's own, but I'll look into it tomorrow.

Other limitations so far are needs a DHCP server on the network, and no support for Ndiswrapper.

One outcome of this is that as I am getting up to speed with using iwconfig, dhcpcd, etc, I will take another look at Pireless2 and have a much better chance of debugging it.

Posted on 8 Mar 2010, 20:48


Posted on 8 Mar 2010, 21:12 by Terryphi
Simple - I like!
I like the sound of SNS. When can we try it?

Posted on 8 Mar 2010, 21:57 by Kevin Bowers
Maybe a dotpet?
A dotpet would be manna from heaven for us home users! Does SNS work cross-platform, ie can I access a Windows share or have my Puppy shares available from Windows?

Posted on 8 Mar 2010, 23:52 by Rarsa
Once you get the hang of it, WPA is not too difficult.

Just create a configuration file wpa_supplicant.conf with the WPA parameters.

psk="not so secure passphrase"

To start you just use the wpa_supplicant command specifying the driver, interface and a couple of other parameters:

wpa_supplicant -Bw -Dwext -ieth0 -c/etc/wpa_supplicant.conf

This will run on the background, will wait for the interface to be added, use interface eth0 and configuration file under /etc/

To check the status of the connection you use wpa_cli.

wpa_cli -i eth0 status

The important part is identifying which driver to use. wext is quite common but does not support all devices.

Posted on 9 Mar 2010, 4:35 by Pizzasgood
@Kevin: It's nothing to do with network shares. What he's working on is getting connected to the network in the first place, in particular when using a wireless network. Getting connected and accessing shares are two completely independent things.

Posted on 9 Mar 2010, 6:42 by nic2109
Isn't it conventional for wired interfaces to be assigned eth0, eth1 etc names with wireless being wlan0, wlan1 and so on?

This is certainly what most systems give us, so may be built into something; i.e. more than just convention.

Posted on 9 Mar 2010, 7:52 by drongo
eth versus wlan
Those are certainly conventions but I think I have seen a wireless interface labelled as eth1 before now. (Not on puppy, naturally.) So I'm not sure you can rely on these labels.

Posted on 9 Mar 2010, 9:25 by Pizzasgood
interface designation
It's a function of the driver, so sometimes you get stuff like "ra0" or "rausb0" and probably some other ones.

Posted on 9 Mar 2010, 13:49 by Rarsa
That was an example
Using eth0 as interface is just an example, the command may differ for different computers and interfaces and before someone tells me that the passphrase is too weak, It is an example :) It is fake. :)

Posted on 9 Mar 2010, 17:31 by BarryK
WPA working
That was relatively painless. Running with WPA-PSK (TKIP) right now.

In my setup script, to bring down any already running wpa_supplicant, would it be correct to do this?:

# wpa_cli terminate

...also do this at system shutdown?

I see in the wpa_supplicant.conf docs that it can be simplified right down:

# home network; allow all valid ciphers
psk="very secret passphrase"

...even that 'scan_ssid=1' doesn't seem to be required.

Posted on 9 Mar 2010, 20:37 by nic2109
@Pizzasgood & @Rarsa: it WAS a genuine question (believe it or not), so thanks for your explanations.

Posted on 9 Mar 2010, 20:40 by nic2109
@Pizzasgood & @Rarsa: it WAS a genuine question (believe it or not), so thanks for your explanations.

Posted on 9 Mar 2010, 23:00 by Jemimah
scan_ssid=1 is only needed for networks with a hidden ssid.

wpa_cli terminate is the correct way to stop wpa_supplicant.

Just let me know if you have questions about Pwireless2. I could certainly use help with it. I didn't know a thing about networking when I started, but it turns out not to be so bad.

Posted on 11 Mar 2010, 5:16 by nic2109
Hiding the SSID
Do remember that (counter to every intuition) it's less secure to hide than to reveal your SSID. This is because if the Access Point doesn't broadcast it then the clients will in order to "keep in touch".

Posted on 15 Mar 2010, 8:56 by PaulBx1
Thanks, Barry
I don't think it is crazy to do this. I reported problems with Network Wizard that never got fixed, and it was kinda cranky at times anyway. I like simple.

One thing Network Wizard had trouble with was going back and forth between DHCP and static IP. Seemed to get confused with that, so make sure SNS handles that.

Another good thing is getting away from anything called a "wizard" - reminds me too much of Windows.