[arch-dev-public] [networking] autowifi
With my new laptop and working wireless, I am now able to announce the "autowifi" scripts I wrote a few weeks ago. Requirements: - wpa_supplicant - wifi driver that is supported by wpa_supplicant - dhclient Features: - Automatically select the best network (done by wpa_supplicant) and configure it according to configuration files (done by autowifi) - wifi configuration via wpa_supplicant.conf - dhcp,static or "custom" network configuration via /etc/autowifi/networks/ - default configuration for unknown networks (if a network is not configured, the default behaviour is using dhcp) - same configuration for networks whose essid matches a regex - once configured, it works completely without user interaction, but it _can_ be controlled by wpa_gui (or any other wpa_supplicant client), so that you can access networks without changing wpa_supplicant.conf. I am still unsure whether and how this can be integrated into James' netcfg, that's a question that I'd rather let him answer. That said, autowifi is VERY simple. It doesn't reinvent the wheel by using wpa_supplicant for selecting networks - parsing iwlist outputs doesn't work very well, does it? As all wifi drivers will be moved to mac80211 in the near future, wpa_supplicant-support will not be a restriction anymore. I tested it on iwl3945 and rt2x00-git. The latter has problems scanning and shows very few networks, therefore didn't work very well. I couldn't test it with iwl3945 in an environment with many wireless networks yet, but I trust it works better. HOWTO: - Install the package from http://www.archlinux.org/~thomas/autowifi-svn/ or from svn at http://projects.archlinux.org/svn/autowifi/ - Create /etc/wpa_supplicant.conf and configure all your networks (you can configure anything here, open, WEP, WPA-PSK, WPA-EAP and so on). - Read /etc/autowifi/regex and map ESSIDs to profile names if necessary. - Read /etc/autowifi/networks/example and configure /etc/autowifi/networks/default and /etc/autowifi/networks/profilename if necessary. If you only use dhcp on all networks, no configuration is necessary here. - Adjust the interface and config file name in /etc/conf.d/autowifi properly. - /etc/rc.d/autowifi start (can of course be done via rc.conf) Possible bugs: In my first test, dhcp wouldn't work when I changed networks, maybe I need to delete the dhclient lease file. Any feedback is welcome Thomas
On Fri, Jun 01, 2007 at 12:12:24PM +0200, Thomas Bächler wrote:
With my new laptop and working wireless, I am now able to announce the "autowifi" scripts I wrote a few weeks ago.
Requirements: - wpa_supplicant - wifi driver that is supported by wpa_supplicant - dhclient
Features: - Automatically select the best network (done by wpa_supplicant) and configure it according to configuration files (done by autowifi) - wifi configuration via wpa_supplicant.conf - dhcp,static or "custom" network configuration via /etc/autowifi/networks/ - default configuration for unknown networks (if a network is not configured, the default behaviour is using dhcp) - same configuration for networks whose essid matches a regex - once configured, it works completely without user interaction, but it _can_ be controlled by wpa_gui (or any other wpa_supplicant client), so that you can access networks without changing wpa_supplicant.conf.
I am still unsure whether and how this can be integrated into James' netcfg, that's a question that I'd rather let him answer.
That said, autowifi is VERY simple. It doesn't reinvent the wheel by using wpa_supplicant for selecting networks - parsing iwlist outputs doesn't work very well, does it? As all wifi drivers will be moved to mac80211 in the near future, wpa_supplicant-support will not be a restriction anymore.
I tested it on iwl3945 and rt2x00-git. The latter has problems scanning and shows very few networks, therefore didn't work very well. I couldn't test it with iwl3945 in an environment with many wireless networks yet, but I trust it works better.
HOWTO: - Install the package from http://www.archlinux.org/~thomas/autowifi-svn/ or from svn at http://projects.archlinux.org/svn/autowifi/ - Create /etc/wpa_supplicant.conf and configure all your networks (you can configure anything here, open, WEP, WPA-PSK, WPA-EAP and so on). - Read /etc/autowifi/regex and map ESSIDs to profile names if necessary. - Read /etc/autowifi/networks/example and configure /etc/autowifi/networks/default and /etc/autowifi/networks/profilename if necessary. If you only use dhcp on all networks, no configuration is necessary here. - Adjust the interface and config file name in /etc/conf.d/autowifi properly. - /etc/rc.d/autowifi start (can of course be done via rc.conf)
Possible bugs: In my first test, dhcp wouldn't work when I changed networks, maybe I need to delete the dhclient lease file.
Any feedback is welcome Thomas
could tie in very nicely to mine if it used the same network profile configuration, otherwise it's a bit icky, having wireless networks defined in multiple locations. Part of the point of my scripts was to eliminate that.
James Rayner schrieb:
could tie in very nicely to mine if it used the same network profile configuration, otherwise it's a bit icky, having wireless networks defined in multiple locations. Part of the point of my scripts was to eliminate that.
The profiles for autowifi have different requirements than the ones netcfg uses: - autowifi profiles don't have an interface name - it is not possible to run a pre_up and pre_down script with autowifi, wpa_supplicant only notifies us after the event. - autowifi profiles are not bound to an interface, but to an essid. I don't like putting all autowifi networks in one big netcfg profile either, as it will kill some simplicity. However, autowifi could be a more flexible replacement for your wpa_config mode, but then there would still be external files for the networks.
On Fri, Jun 01, 2007 at 07:44:29PM +0200, Thomas Bächler wrote:
James Rayner schrieb:
could tie in very nicely to mine if it used the same network profile configuration, otherwise it's a bit icky, having wireless networks defined in multiple locations. Part of the point of my scripts was to eliminate that.
The profiles for autowifi have different requirements than the ones netcfg uses:
- autowifi profiles don't have an interface name - it is not possible to run a pre_up and pre_down script with autowifi, wpa_supplicant only notifies us after the event. - autowifi profiles are not bound to an interface, but to an essid.
the only required option in a network profile is connection, telling netcfg what type of connection it is.
I don't like putting all autowifi networks in one big netcfg profile either, as it will kill some simplicity.
yeah, that'd suck.
However, autowifi could be a more flexible replacement for your wpa_config mode, but then there would still be external files for the networks.
Looking at how autowifi works, to put the wireless networks in external files would be.. horrible at best. Some ideas of making it co-operate with netcfg... a) definitely record state. create the standard netcfg state files so netcfg knows the interface is in use, and autowifi is using it. Don't hurry and implement this now, i'm moving state to netcfg/functions, so any script can set state. b) Through the above, make it possible for netcfg --stop-iface work, which shouldnt be hard, and possibly even netcfg --stop autowifi. c) Possibly, just implement autowifi as a netcfg connection type, thus moving /etc/conf.d/autowifi to a profile, and the regexp's to the same file. So to enable autowifi, one would just add 'autowifi' to the network daemons line and modify the example /etc/network.d/autowifi with the above. You could also keep the /etc/rc.d/ -- it could just call start_profile autowifi from netcfg/functions d) For the various networks, you could just implement these as autowifi-ethernet type networks, or with a bit of work, I could modify ethernet and they would be standard ethernet profiles. Just ideas, not sure how well they'd work. Don't rush and implement anything till i get the state work done, which should be this week. If you've got any qualms with the above, remember, the new netcfg is still pretty flexible, I want input, im happy to make changes. James
James Rayner schrieb:
Some ideas of making it co-operate with netcfg... a) definitely record state. create the standard netcfg state files so netcfg knows the interface is in use, and autowifi is using it. Don't hurry and implement this now, i'm moving state to netcfg/functions, so any script can set state.
Good idea.
b) Through the above, make it possible for netcfg --stop-iface work, which shouldnt be hard, and possibly even netcfg --stop autowifi.
If we do c), then this should work automatically, right?
c) Possibly, just implement autowifi as a netcfg connection type, thus moving /etc/conf.d/autowifi to a profile, and the regexp's to the same file. So to enable autowifi, one would just add 'autowifi' to the network daemons line and modify the example /etc/network.d/autowifi with the above. You could also keep the /etc/rc.d/ -- it could just call start_profile autowifi from netcfg/functions
That is what I thought, but it still leaves the problem of the networks/ssids. They have to be configured somewhere.
d) For the various networks, you could just implement these as autowifi-ethernet type networks, or with a bit of work, I could modify ethernet and they would be standard ethernet profiles.
I don't really like that, but I'll have a look.
Just ideas, not sure how well they'd work. Don't rush and implement anything till i get the state work done, which should be this week.
My stuff is still proof-of-concept. I will test the usability over the next few weeks anyway and then over time see what can be improved. I won't rush integration into netcfg now, so take your time.
On Sat, Jun 02, 2007 at 12:06:07PM +0200, Thomas Bächler wrote:
James Rayner schrieb:
Some ideas of making it co-operate with netcfg... a) definitely record state. create the standard netcfg state files so netcfg knows the interface is in use, and autowifi is using it. Don't hurry and implement this now, i'm moving state to netcfg/functions, so any script can set state.
Good idea.
b) Through the above, make it possible for netcfg --stop-iface work, which shouldnt be hard, and possibly even netcfg --stop autowifi.
If we do c), then this should work automatically, right?
c) Possibly, just implement autowifi as a netcfg connection type, thus moving /etc/conf.d/autowifi to a profile, and the regexp's to the same file. So to enable autowifi, one would just add 'autowifi' to the network daemons line and modify the example /etc/network.d/autowifi with the above. You could also keep the /etc/rc.d/ -- it could just call start_profile autowifi from netcfg/functions
That is what I thought, but it still leaves the problem of the networks/ssids. They have to be configured somewhere.
wireless settings would stay in the wpa_supplicant.conf regexes and such in network.d/autowifi network ip configuration... network.d/ profiles?
d) For the various networks, you could just implement these as autowifi-ethernet type networks, or with a bit of work, I could modify ethernet and they would be standard ethernet profiles.
I don't really like that, but I'll have a look.
yeah... I'm not sure, maybe a bit of trial and error might be worth a go, evaluate some ideas and see what happens.
Just ideas, not sure how well they'd work. Don't rush and implement anything till i get the state work done, which should be this week.
My stuff is still proof-of-concept. I will test the usability over the next few weeks anyway and then over time see what can be improved. I won't rush integration into netcfg now, so take your time.
Ok, cool. I've got exams for the next week or so, but after I plan to get netcfg up to scratch and tidy the rough edges. James
On 6/1/07, James Rayner <iphitus@gmail.com> wrote:
On Fri, Jun 01, 2007 at 12:12:24PM +0200, Thomas Bächler wrote:
With my new laptop and working wireless, I am now able to announce the "autowifi" scripts I wrote a few weeks ago.
Requirements: - wpa_supplicant - wifi driver that is supported by wpa_supplicant - dhclient
Features: - Automatically select the best network (done by wpa_supplicant) and configure it according to configuration files (done by autowifi) - wifi configuration via wpa_supplicant.conf - dhcp,static or "custom" network configuration via /etc/autowifi/networks/ - default configuration for unknown networks (if a network is not configured, the default behaviour is using dhcp) - same configuration for networks whose essid matches a regex - once configured, it works completely without user interaction, but it _can_ be controlled by wpa_gui (or any other wpa_supplicant client), so that you can access networks without changing wpa_supplicant.conf.
I am still unsure whether and how this can be integrated into James' netcfg, that's a question that I'd rather let him answer.
That said, autowifi is VERY simple. It doesn't reinvent the wheel by using wpa_supplicant for selecting networks - parsing iwlist outputs doesn't work very well, does it? As all wifi drivers will be moved to mac80211 in the near future, wpa_supplicant-support will not be a restriction anymore.
I tested it on iwl3945 and rt2x00-git. The latter has problems scanning and shows very few networks, therefore didn't work very well. I couldn't test it with iwl3945 in an environment with many wireless networks yet, but I trust it works better.
HOWTO: - Install the package from http://www.archlinux.org/~thomas/autowifi-svn/ or from svn at http://projects.archlinux.org/svn/autowifi/ - Create /etc/wpa_supplicant.conf and configure all your networks (you can configure anything here, open, WEP, WPA-PSK, WPA-EAP and so on). - Read /etc/autowifi/regex and map ESSIDs to profile names if necessary. - Read /etc/autowifi/networks/example and configure /etc/autowifi/networks/default and /etc/autowifi/networks/profilename if necessary. If you only use dhcp on all networks, no configuration is necessary here. - Adjust the interface and config file name in /etc/conf.d/autowifi properly. - /etc/rc.d/autowifi start (can of course be done via rc.conf)
Possible bugs: In my first test, dhcp wouldn't work when I changed networks, maybe I need to delete the dhclient lease file.
Any feedback is welcome Thomas
could tie in very nicely to mine if it used the same network profile configuration, otherwise it's a bit icky, having wireless networks defined in multiple locations. Part of the point of my scripts was to eliminate that.
I agree that a unified configuration would be a good thing. I'd try autowifi but, I only use my home network anymore... I guess I'd be a decent testcase though, as there's like 12 networks in my building and mine should usually be the strongest.
participants (3)
-
Aaron Griffin
-
James Rayner
-
Thomas Bächler