site  contact  subhomenews

Simple Network Setup

March 08, 2010 — BarryK
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.


Simple - I like!

Maybe a dotpet?
Username: Kevin Bowers
"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? --Kevin

Username: 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. e.g. network={ ssid="example" proto=WPA key_mgmt=WPA-PSK pairwise=TKIP group=TKIP psk="not so secure passphrase" wpa_ptk_rekey=600 } 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.

Username: 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.

WPA working
Username: BarryK
"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?: [i]# wpa_cli terminate[/i] ...also do this at system shutdown? I see in the wpa_supplicant.conf docs that it can be simplified right down: [i]# home network; allow all valid ciphers network={ ssid="home" scan_ssid=1 key_mgmt=WPA-PSK psk="very secret passphrase"[/i] ...even that 'scan_ssid=1' doesn't seem to be required.

Username: 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.

Thanks, Barry
Username: PaulBx1
"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.

Tags: woof