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 Sat 19 Apr 2014, 17:54
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Improved Network Wizard (and rc.network)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 40 [596 Posts]   Goto page: 1, 2, 3, ..., 38, 39, 40 Next
Author Message
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: Fri 18 Jul 2008, 14:36    Post subject:  Improved Network Wizard (and rc.network)
Subject description: New Configuration Infrastructure
 

I've overhauled the way the network-wizard saves configurations, in
conjunction with re-writing rc.network, to make it more flexible and
be able to support both different HW (when running off USB drive) and
different locations (for laptops).

The only thing left is to test it...

(Note that you might want to use a special pup_save for it, or at least
backup the files that are overwritten: /etc/rc.d/rc.network,
/usr/sbin/net-setup.sh, /usr/sbin/wag-profiles.sh and
/usr/sbin/ndiswrappergui.sh )


Here's how it now works (you don't need to know this to use the wizard...):

Interface configuration
Interfaces have configuration files named after the HW address of the
network adapter, as seen in the output of ifconfig (eg. 00:10:60:BD:4A:D7).

This way we are not dependent on the interface name, which would most
likely be the same (eth0, wlan0) on different machines. (if the HWaddres
isn't unique enough, I can easily add the module name or something...)

- When every interface is configured, a config file is created:
/etc/network/interfaces/$HWADDRESS.conf
This file might be empty, or include some info, such as the details of
a static ip address (in case it was configured that way).

- In case of a wireless interface, another config file will be created:
/etc/wireless/interfaces/$HWADDRESS.conf
This file might include information like whether to use wlanctl-ng
instead of iwconfig/wpa_supplicant (in case of devices using the prism2
drivers), or which wpa_supplicant driver to use.

Both of these files are used as markers, to let us know that the interface
has actually been "configured" by the user -- so we don't try and use an
interface that the user doesn't want us to.


Network configuration
Unlike previously, the different "profiles" you save when configuring
wireless networks are not saved in the same file.
Now a directory (/etc/wireless/profiles) is used, with each profile having
its own config file, named after the MAC address and the type of encryption
used. For example:
/etc/wireless/profiles/00:1B:9E:6F:61:F6.WPA.conf

In case of WPA/WPA2, an appropriate wpa_supplicant.conf file is created
in /etc/wireless/wpa_profiles. Example:
/etc/wireless/wpa_profiles/00:1B:9E:6F:61:F6.WPA.conf

This way, at bootup, a wireless scan is performed and each detected network
is checked, to see if there is a profile matching it (and its encryption
mode!)

Note: this should mean that you can have profiles for your home router
in different modes, without them interfering with each other.

Now, if none of the detected networks matches an existing profile (or if
some do, but fail to connect), then an attempt will be made to connect
to each of the detected open networks, so theoretically you should be able
to just go somewhere and boot and it will connect you to something...


I have also added the option of giving priority to certain networks (i.e.
your home network) over the rest, but that isn't incorporated into the
guy yet...
What you need to do is add to the wireless config file (the one for the
interface, in /etc/wireless/interfaces!) a line such as:
Code:
PRIORITY_LIST='00:1B:9E:6F:61:F6 00:0E:2E:7B:E5:D8'

Connecting to the addresses in the list will be attempted before all
others (assuming they were detected by the scan, of course...).


That's about it, at the moment.

There are some things I'm still not completely sure about, including some
other modifications I made to the wizard, which people might help me with:
- Tempestuous mentioned once that running "iwlist $INTERFACE ap" will
return a list of access-points with their signal quality (and listed by
decreasing signal strength).
Is the order the networks are listed "normally" (iwlist $INTERFACE scan)
the same (i.e. listed by decreasing signal strength)?

- I took some code from Wicd, which is used to "clean up" every time before
an interface is configured: dhcpcd killed, wpa_supplicant killed, routing
table flushed etc.
This kills all instances of dhcpcd every time. Is this safe to
do? Could a user run more than one instance of dhcpcd at once, connecting
via more than one interface?

- Do people ever use static ip addresses with wireless??

UPDATE July 21st: fix some bugs and updated the attachment.
UPDATE July 22nd: updated the attachment.
UPDATE july 23rd: a few fixes (see post on page 3)
UPDATE july 25th: modify wireless profiles dialog and add "connect" argument (see post on page 3)
UPDATE july 28th: a bunch of fixes and added a loop for bootup sleep (see page 4)

Last edited by Dougal on Sun 12 Apr 2009, 05:24; edited 33 times in total
Back to top
View user's profile Send private message 
Arvi Pingus

Joined: 18 Jul 2008
Posts: 9
Location: Behind the dutch dunes

PostPosted: Fri 18 Jul 2008, 15:05    Post subject: Re: Improved Network Wizard (and rc.network)
Subject description: New Configuration Infrastructure
 

Dougal wrote:
I've overhauled the way the network-wizard saves configurations, in
conjunction with re-writing rc.network, to make it more flexible and
be able to support both different HW (when running off USB drive) and
different locations (for laptops).

The only thing left is to test it...
How can one participate in testing?
(I am not a fan of tar.gz binary stuff. Like to install with the help of a packetmanager.)
Dougal wrote:
Do people ever use static ip addresses with wireless??
Me, myself and I, including all members of my family on our home LAN.
_________________
Know where you are talking about instead of talking about what you know.
Back to top
View user's profile Send private message 
kirk

Joined: 11 Nov 2005
Posts: 1365
Location: florida

PostPosted: Fri 18 Jul 2008, 18:04    Post subject:  

Sounds great.

Works fine with my wide-open network. I'll try it next week on a wpa network.
Back to top
View user's profile Send private message 
tempestuous

Joined: 10 Jun 2005
Posts: 5139
Location: Australia

PostPosted: Sat 19 Jul 2008, 08:45    Post subject:  

Dougal, while you're overhauling the Network Wizard, what about this small enhancement -
http://www.murga-linux.com/puppy/viewtopic.php?p=208545#208545
I think that the "Supplic" "Driver" "Hidden" labels are too technical. They refer to the underlying tecnology of wpa_supplicant, and are not useful to the user.

I believe those 3 options should instead be labelled:
"SSID broadcast" "Driver" "SSID Hidden"

... or since "Hidden" is the default setting, a more logical order would be:
"SSID Hidden" "SSID broadcast" "Driver"
Back to top
View user's profile Send private message 
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: Sun 20 Jul 2008, 04:55    Post subject: Re: Improved Network Wizard (and rc.network)
Subject description: New Configuration Infrastructure
 

Arvi Pingus wrote:
How can one participate in testing?
(I am not a fan of tar.gz binary stuff. Like to install with the help of a packetmanager.)

I didn't make into a dotpet intentionally, so people won't just download it and click to install, then, if they can't connect anymore, complain to me... since it doesn't back up the old files.
You can always just turn the tarball into a .pet by running in a terminal
"tgz2pet" on it.

Quote:
Dougal wrote:
Do people ever use static ip addresses with wireless??
Me, myself and I, including all members of my family on our home LAN.

Ok. It isn't supported at the moment, but shouldn't be hard to add.

The main problem I have with static ip is that it ties up the interface (well, at least with ethernet, I guess with wireless I can save it as part of the wireless network config).
What I mean is that if you configure your laptop ethernet to one network, then, trying to connect with it somewhere else, it will just try that static ip address, not trying dhcp.
Is there a way to find out if to use the static ip address? (like the address of the service provider?)
Could I test, via ping or something, if the static connection worked and if not -- try auto dhcp?

_________________
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Back to top
View user's profile Send private message 
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: Sun 20 Jul 2008, 05:04    Post subject:  

tempestuous wrote:
Dougal, while you're overhauling the Network Wizard, what about this small enhancement -
http://www.murga-linux.com/puppy/viewtopic.php?p=208545#208545
I think that the "Supplic" "Driver" "Hidden" labels are too technical. They refer to the underlying tecnology of wpa_supplicant, and are not useful to the user.

I believe those 3 options should instead be labelled:
"SSID broadcast" "Driver" "SSID Hidden"

... or since "Hidden" is the default setting, a more logical order would be:
"SSID Hidden" "SSID broadcast" "Driver"

Sure.
I would have liked to do a proper overhaul of the wizard UI, using tooltips to cut down on the text and simplify things, but it seems like gtkdialog only supports tooltips when using glade, which I've never done (I'm also not sure it will be worth the effort -- at least not if we need to generate the glade files on-the-go, rather than just having a static one.
(I actually took the .glade file from wicd and run gtkdialog with it and it brought up a gui! the only question if we can use variables to fill in the parts that need filling in).

_________________
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Back to top
View user's profile Send private message 
paulh177


Joined: 22 Aug 2006
Posts: 875
Location: ST862228

PostPosted: Sun 20 Jul 2008, 05:30    Post subject:  

I was having problems with network setup persisting between reboots on my laptop, running Puppy4.1alpha4 (Lin'n'Win on WinXP SP3 VFAT).

Installed your update and that seems to have resolved.

paul
Back to top
View user's profile Send private message 
hanishkvc

Joined: 20 Jul 2008
Posts: 1

PostPosted: Sun 20 Jul 2008, 13:21    Post subject: Working with Static IP configuration dynamically
Subject description: Intelligently deciding whether a static IP configuration should be applied or DHCP used
 

Hi Dougal,

I noticed above that you have asked if there is a way to identify a static IP configuration uniquely with respect to its network so that when booting you can decide whether to apply that particular static ip configuration or force going for DHCP.

The solution
------------------
What I feel is if one captures/stores the MAC ID associated with the GATEWAY IP address of a static configuration. Then when booting or starting networking on a machine with Static IP configuration, it can be varified as to whether the system is still running on the SAME network or not by using ARP and based on that one can decide whether to apply that particular Static configuration on that run or switch to DHCP for that run.

Hope that helps.

Keep Wink
HanishKVC
Back to top
View user's profile Send private message 
prit1


Joined: 03 Jan 2008
Posts: 540
Location: Los Angeles

PostPosted: Sun 20 Jul 2008, 13:51    Post subject:  

@Dougal:

I downloaded and installed the files provided. Tried running net-setup.sh and get the following error when saving the profile:

/usr/sbin/wag-profiles.sh: line 706: /etc/wireless/profiles/00: No such file or directory

_________________
Macpup - The beauty of linux | Pritlog - Simple blog app
Back to top
View user's profile Send private message 
Keef


Joined: 20 Dec 2007
Posts: 562
Location: Staffordshire

PostPosted: Sun 20 Jul 2008, 14:32    Post subject:  

I'm using this with Fat Free 3.01 (frugal install) on a Dell 610 laptop with a NetgearWG111T.
I've found that it won't save a profile - if I try to save, the program closes.
The program seems to detect the wlan0 on alternate boots - but when it does detect it, it will connect to a network far quicker than previously. It has done it first time once I've entered the parameters. This could take several attempts before, so there is a definite improvement.
Back to top
View user's profile Send private message 
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: Mon 21 Jul 2008, 04:24    Post subject: Re: Working with Static IP configuration dynamically
Subject description: Intelligently deciding whether a static IP configuration should be applied or DHCP used
 

hanishkvc wrote:
What I feel is if one captures/stores the MAC ID associated with the GATEWAY IP address of a static configuration. Then when booting or starting networking on a machine with Static IP configuration, it can be varified as to whether the system is still running on the SAME network or not by using ARP and based on that one can decide whether to apply that particular Static configuration on that run or switch to DHCP for that run.

Haa, but how do I do that... I really don't know much about networking.
A little code snippet is all I need.

_________________
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Back to top
View user's profile Send private message 
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: Mon 21 Jul 2008, 04:26    Post subject:  

prit1 wrote:
I downloaded and installed the files provided. Tried running net-setup.sh and get the following error when saving the profile:

/usr/sbin/wag-profiles.sh: line 706: /etc/wireless/profiles/00: No such file or directory

Ok, I'll look into it.

_________________
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Back to top
View user's profile Send private message 
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: Mon 21 Jul 2008, 04:28    Post subject:  

Keef wrote:
I'm using this with Fat Free 3.01 (frugal install) on a Dell 610 laptop with a NetgearWG111T.
I've found that it won't save a profile - if I try to save, the program closes.

Could you try tunning it from a terminal and see what kind of error message it give when closing? Just run "net-setup.sh -d".

_________________
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Back to top
View user's profile Send private message 
nic2109

Joined: 01 Jan 2007
Posts: 406
Location: Hayslope, near Middlemarch, Midlands, England

PostPosted: Mon 21 Jul 2008, 11:27    Post subject:  

Quote:
- Do people ever use static ip addresses with wireless??

Yes, I do.

This is because my household has 4 wireless laptops, one or two of which which run The Devil's Own Operating System. If 'Doze hibernates it (obviously) discards the lease on its I/P address but when it is woken up later it will try to re-lease the same address. If in the meantime one of the other devices has been auto-allocated the same address (because it was available) then there's a conflict straight away.

I can solve this in my Router by allocating a fixed I/P address to the MAC Address of each device and then use "Automatic" DHCP to get an address.

I imagine this scenario is not unique so I can see the need to retain the static address option for simialr situations but where changing router settings isn't possible.
Quote:
Could a user run more than one instance of dhcpcd at once, connecting via more than one interface?

Yes, I do.

But I'd rather not! If you ever connect both wirelessly and wired, then you'll get both interfaces activated at bootup from then on. It's always struck me as a minor flaw that it does the second connection even if the first was successful.

It doesn't seem to "matter" until you want to switch mode; say you started wired but wish to move to working wirelessly. I haven't found how to cancel/disable/de-activate the first one you used and switch to the other without re-booting.

It's a small thing, but would add to the general friendliness of the experience.

_________________
Nick
Back to top
View user's profile Send private message 
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: Mon 21 Jul 2008, 14:11    Post subject:  

I've updated the attachment in the parent post.
It should fix the bugs reported and enable support for static ip with wireless networks (the ip info is included in the network profile).

_________________
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 40 [596 Posts]   Goto page: 1, 2, 3, ..., 38, 39, 40 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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.1045s ][ Queries: 13 (0.0107s) ][ GZIP on ]