Re: System settings with keyfile
- From: Robert Piasek <robert piasek co uk>
- To: networkmanager-list gnome org
- Subject: Re: System settings with keyfile
- Date: Sun, 27 Jul 2008 23:02:09 +0100
On Sunday 27 July 2008 22:40:25 Dan Williams wrote:
> On Sun, 2008-07-27 at 22:32 +0100, Robert Piasek wrote:
> > Hi Dan,
> >
> > The example you've sent me was great. I had to adjust it to WPA, but
> > after I got ssid part correctly it wasn't a problem. During my testing I
> > observed some strange timeouts.
>
> When the supplicant doesn't connect, there are usually driver or config
> issues. Can you add "-dddt" to the end of the Exec= line in
> your
> /usr/share/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.service
> file, then "killall -TERM wpa_supplicant" and reproduce the association
> failures? Then grab the output of /var/log/wpa_supplicant.log and mail
> that to me.
When everything is as it should be, log looks like:
Jul 27 22:53:52 [kernel] [29721.772205] wlan0: deauthenticate(reason=3)
Jul 27 22:53:52 [kernel] [29721.787568] mac80211-phy0: failed to remove key
(0, 00:1c:10:e9:50:b8) from hardware (-22)
Jul 27 22:53:54 [kernel] [29724.165914] ACPI: PCI interrupt for device
0000:03:00.0 disabled
Jul 27 22:53:54 [kernel] [29724.370012] PM: Writing back config space on
device 0000:03:00.0 at offset 1 (was 100102, writing 100106)
Jul 27 22:53:54 [kernel] [29724.572766] Registered led device: iwl-phy0:radio
Jul 27 22:53:54 [kernel] [29724.572817] Registered led device: iwl-phy0:assoc
Jul 27 22:53:54 [kernel] [29724.572859] Registered led device: iwl-phy0:RX
Jul 27 22:53:54 [kernel] [29724.572903] Registered led device: iwl-phy0:TX
Jul 27 22:53:54 [kernel] [29724.592741] ADDRCONF(NETDEV_UP): wlan0: link is
not ready
Jul 27 22:53:56 [kernel] [29726.281451] wlan0: Initial auth_alg=0
Jul 27 22:53:56 [kernel] [29726.281451] wlan0: authenticate with AP
00:1c:10:e9:50:b8
Jul 27 22:53:56 [kernel] [29726.284160] wlan0: RX authentication from
00:1c:10:e9:50:b8 (alg=0 transaction=2 status=0)
Jul 27 22:53:56 [kernel] [29726.284170] wlan0: authenticated
Jul 27 22:53:56 [kernel] [29726.284176] wlan0: associate with AP
00:1c:10:e9:50:b8
Jul 27 22:53:56 [kernel] [29726.287316] wlan0: RX AssocResp from
00:1c:10:e9:50:b8 (capab=0x411 status=0 aid=2)
Jul 27 22:53:56 [kernel] [29726.287325] wlan0: associated
Jul 27 22:53:56 [kernel] [29726.287353] wlan0: switched to short barker
preamble (BSSID=00:1c:10:e9:50:b8)
Jul 27 22:53:56 [kernel] [29726.309101] ADDRCONF(NETDEV_CHANGE): wlan0: link
becomes ready
All takes 4 sec and NM is happy.
When something is wrong, it looks like:
Jul 27 22:54:07 [kernel] [29737.306456] wlan0: deauthenticate(reason=3)
Jul 27 22:54:07 [kernel] [29737.327661] mac80211-phy0: failed to remove key
(0, 00:1c:10:e9:50:b8) from hardware (-22)
Jul 27 22:54:09 [kernel] [29739.915016] ACPI: PCI interrupt for device
0000:03:00.0 disabled
Jul 27 22:54:09 [kernel] [29739.915016] ACPI: PCI Interrupt 0000:03:00.0[A] ->
GSI 17 (level, low) -> IRQ 17
Jul 27 22:54:09 [kernel] [29739.915016] PM: Writing back config space on
device 0000:03:00.0 at offset 1 (was 100102, writing 100106)
Jul 27 22:54:09 [kernel] [29740.240980] Registered led device: iwl-phy0:radio
Jul 27 22:54:09 [kernel] [29740.240980] Registered led device: iwl-phy0:assoc
Jul 27 22:54:09 [kernel] [29740.240980] Registered led device: iwl-phy0:RX
Jul 27 22:54:09 [kernel] [29740.240980] Registered led device: iwl-phy0:TX
Jul 27 22:54:09 [kernel] [29740.268428] ADDRCONF(NETDEV_UP): wlan0: link is
not ready
Jul 27 22:54:33 [kernel] [29763.757816] wlan0: Initial auth_alg=0
Jul 27 22:54:33 [kernel] [29763.758142] wlan0: authenticate with AP
00:1c:10:e9:50:b8
Jul 27 22:54:33 [kernel] [29763.761985] wlan0: RX authentication from
00:1c:10:e9:50:b8 (alg=0 transaction=2 status=0)
Jul 27 22:54:33 [kernel] [29763.762450] wlan0: authenticated
Jul 27 22:54:33 [kernel] [29763.762810] wlan0: associate with AP
00:1c:10:e9:50:b8
Jul 27 22:54:33 [kernel] [29763.766833] wlan0: RX AssocResp from
00:1c:10:e9:50:b8 (capab=0x411 status=0 aid=2)
Jul 27 22:54:33 [kernel] [29763.767447] wlan0: associated
Jul 27 22:54:33 [kernel] [29763.767481] wlan0: switched to short barker
preamble (BSSID=00:1c:10:e9:50:b8)
Jul 27 22:54:33 [kernel] [29763.789854] ADDRCONF(NETDEV_CHANGE): wlan0: link
becomes ready
25 sec and NM times out (after 15?).
>
> Supplicant state 2 is "scanning" I think and indicates that the
> supplicant cannot find an compatible AP to associate with. Some causes
> of that are invalid configuration (which probably isn't your problem
> since it does connect later) and odd drivers. What hardware and kernel
> version are you using?
Network controller: Intel Corporation Device 4229 (rev 61) <- Intel 4965
> > NetworkManager: <info> wlan0: Device is fully-supported using driver
> > 'iwl4965'.
> > NetworkManager: <info> wlan0: driver supports SSID scans (scan_capa
kernel - 2.6.26
Rob
>
> Dan
>
> > Here are some logs:
> >
> > 1) I start /usr/sbin/NetworkManager --no-daemon and
> > /etc/NetworkManager/system-setting directory is empty:
> >
> > networkmanager starts:
> > NetworkManager: <info> Found radio killswitch
> > /org/freedesktop/Hal/devices/ipw_wlan_switch
> > NetworkManager: <info> eth0: Device is fully-supported using driver
> > 'r8169'. NetworkManager: <info> Found new Ethernet device 'eth0'.
> > NetworkManager: <info> (eth0): exported as
> > /org/freedesktop/Hal/devices/net_00_1b_fc_4a_4a_20
> > NetworkManager: <info> wlan0: Device is fully-supported using driver
> > 'iwl4965'.
> > NetworkManager: <info> wlan0: driver supports SSID scans (scan_capa
> > 0x01). NetworkManager: <info> Found new wireless (802.11) device
> > 'wlan0'. NetworkManager: <info> (wlan0): exported as
> > /org/freedesktop/Hal/devices/net_00_13_e8_15_64_05
> > NetworkManager: <WARN> killswitch_getpower_reply(): Error getting
> > killswitch power: hal-ipw-killswitch-linux returned 255.
> > NetworkManager: <info> (eth0): device state change: 1 -> 2
> > NetworkManager: <info> (eth0): bringing up device.
> > NetworkManager: <info> (eth0): preparing device.
> > NetworkManager: <info> (eth0): deactivating device.
> > NetworkManager: <info> (wlan0): device state change: 1 -> 2
> > NetworkManager: <info> (wlan0): bringing up device.
> > NetworkManager: <info> (wlan0): preparing device.
> > NetworkManager: <info> (wlan0): deactivating device.
> > NetworkManager: <info> (wlan0): device state change: 2 -> 3
> > NetworkManager: <info> (wlan0): supplicant interface state change: 1 ->
> > 2.
> >
> >
> > now I copy my configuration file to system-settings folder.
> > nm-system-settings picks it up instantly:
> >
> >
> > NetworkManager: <info> Activation (wlan0) starting connection 'Wireless
> > connection X'
> > NetworkManager: <info> (wlan0): device state change: 3 -> 4
> > NetworkManager: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare)
> > scheduled...
> > NetworkManager: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare)
> > started...
> > NetworkManager: <info> Activation (wlan0) Stage 2 of 5 (Device
> > Configure) scheduled...
> > NetworkManager: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare)
> > complete.
> > NetworkManager: <info> Activation (wlan0) Stage 2 of 5 (Device
> > Configure) starting...
> > NetworkManager: <info> (wlan0): device state change: 4 -> 5
> > NetworkManager: <info> Activation (wlan0/wireless): connection 'Wireless
> > connection X' has security, and secrets exist. No new secrets needed.
> > etworkManager: <info> Config: added 'ssid' value 'dagger'
> > NetworkManager: <info> Config: added 'scan_ssid' value '1'
> > NetworkManager: <info> Config: added 'key_mgmt' value 'WPA-PSK'
> > NetworkManager: <info> Config: added 'psk' value '<omitted>'
> > NetworkManager: <info> Config: added 'pairwise' value 'TKIP CCMP'
> > NetworkManager: <info> Config: added 'group' value 'TKIP CCMP'
> > NetworkManager: <info> Activation (wlan0) Stage 2 of 5 (Device
> > Configure) complete.
> > NetworkManager: <info> Config: set interface ap_scan to 1
> > NetworkManager: <info> (wlan0): supplicant connection state change: 1 ->
> > 2 NetworkManager: <info> (wlan0): supplicant connection state change: 2
> > -> 3 NetworkManager: <info> (wlan0): supplicant connection state change:
> > 3 -> 5 NetworkManager: <info> (wlan0): supplicant connection state
> > change: 5 -> 4 NetworkManager: <info> (wlan0): supplicant connection
> > state change: 4 -> 5 NetworkManager: <info> (wlan0): supplicant
> > connection state change: 5 -> 6 NetworkManager: <info> (wlan0):
> > supplicant connection state change: 6 -> 7 NetworkManager: <info>
> > Activation (wlan0/wireless) Stage 2 of 5 (Device Configure) successful.
> > Connected to wireless network 'dagger'.
> > NetworkManager: <info> Activation (wlan0) Stage 3 of 5 (IP Configure
> > Start) scheduled.
> > NetworkManager: <info> Activation (wlan0) Stage 3 of 5 (IP Configure
> > Start) started...
> > NetworkManager: <info> (wlan0): device state change: 5 -> 7
> > NetworkManager: <info> Activation (wlan0) Beginning DHCP transaction.
> > Internet Systems Consortium DHCP Client V3.1.1-Gentoo
> > Copyright 2004-2008 Internet Systems Consortium.
> > All rights reserved.
> > For info, please visit http://www.isc.org/sw/dhcp/
> >
> > wmaster0: unknown hardware address type 801
> > NetworkManager: <info> dhclient started with pid 23885
> > NetworkManager: <info> Activation (wlan0) Stage 3 of 5 (IP Configure
> > Start) complete.
> >
> > everything as expected.
> >
> > 2) I start /usr/sbin/NetworkManager --no-daemon and
> > /etc/NetworkManager/system-setting directory contains my config file
> > we've got 2 cases (they are pretty random):
> >
> > case 1)
> >
> > etworkManager: <info> Found radio killswitch
> > /org/freedesktop/Hal/devices/ipw_wlan_switch
> > NetworkManager: <info> eth0: Device is fully-supported using driver
> > 'r8169'. NetworkManager: <info> Found new Ethernet device 'eth0'.
> > NetworkManager: <info> (eth0): exported as
> > /org/freedesktop/Hal/devices/net_00_1b_fc_4a_4a_20
> > NetworkManager: <info> wlan0: Device is fully-supported using driver
> > 'iwl4965'.
> > NetworkManager: <info> wlan0: driver supports SSID scans (scan_capa
> > 0x01). NetworkManager: <info> Found new wireless (802.11) device
> > 'wlan0'. NetworkManager: <info> (wlan0): exported as
> > /org/freedesktop/Hal/devices/net_00_13_e8_15_64_05
> > NetworkManager: <info> Trying to start the system settings daemon...
> > NetworkManager: <WARN> killswitch_getpower_reply(): Error getting
> > killswitch power: hal-ipw-killswitch-linux returned 255.
> > NetworkManager: <info> (eth0): device state change: 1 -> 2
> > NetworkManager: <info> (eth0): bringing up device.
> > NetworkManager: <info> (eth0): preparing device.
> > NetworkManager: <info> (eth0): deactivating device.
> > NetworkManager: <info> (wlan0): device state change: 1 -> 2
> > NetworkManager: <info> (wlan0): bringing up device.
> > NetworkManager: <info> (wlan0): preparing device.
> > NetworkManager: <info> (wlan0): deactivating device.
> > NetworkManager: <info> (wlan0): device state change: 2 -> 3
> > NetworkManager: <info> (wlan0): supplicant interface state change: 1 ->
> > 2. NetworkManager: <info> Activation (wlan0) starting connection
> > 'Wireless connection X'
> > NetworkManager: <info> (wlan0): device state change: 3 -> 4
> > NetworkManager: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare)
> > scheduled...
> > NetworkManager: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare)
> > started...
> > NetworkManager: <info> Activation (wlan0) Stage 2 of 5 (Device
> > Configure) scheduled...
> > NetworkManager: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare)
> > complete.
> > NetworkManager: <info> Activation (wlan0) Stage 2 of 5 (Device
> > Configure) starting...
> > NetworkManager: <info> (wlan0): device state change: 4 -> 5
> > NetworkManager: <info> Activation (wlan0/wireless): connection 'Wireless
> > connection X' has security, and secrets exist. No new secrets needed.
> > etworkManager: <info> Config: added 'ssid' value 'dagger'
> > NetworkManager: <info> Config: added 'scan_ssid' value '1'
> > NetworkManager: <info> Config: added 'key_mgmt' value 'WPA-PSK'
> > NetworkManager: <info> Config: added 'psk' value '<omitted>'
> > NetworkManager: <info> Config: added 'pairwise' value 'TKIP CCMP'
> > NetworkManager: <info> Config: added 'group' value 'TKIP CCMP'
> > NetworkManager: <info> Activation (wlan0) Stage 2 of 5 (Device
> > Configure) complete.
> > NetworkManager: <info> Config: set interface ap_scan to 1
> > NetworkManager: <info> (wlan0): supplicant connection state change: 2 ->
> > 0 NetworkManager: <info> (wlan0): supplicant connection state change: 0
> > -> 2
> >
> > NetworkManager: <info> wlan0: link timed out. <- TIMEOUT
> > HERE
> >
> > NetworkManager: <info> Activation (wlan0/wireless): association took too
> > long.
> > NetworkManager: <info> (wlan0): device state change: 5 -> 6
> > NetworkManager: <info> Activation (wlan0/wireless): asking for new
> > secrets NetworkManager: <info> (wlan0): supplicant connection state
> > change: 2 -> 0 NetworkManager: <WARN> get_secrets_cb(): Couldn't get
> > connection secrets: nm- settings.c.307 - Missing implementation for
> > ConnectionSettings::get_secrets.. NetworkManager: <info> (wlan0): device
> > state change: 6 -> 9
> > NetworkManager: <info> Activation (wlan0) failed for access point
> > (dagger) NetworkManager: <info> Marking connection 'Wireless connection
> > X' invalid. NetworkManager: <info> Activation (wlan0) failed.
> > NetworkManager: <info> (wlan0): device state change: 9 -> 3
> > NetworkManager: <info> (wlan0): deactivating device.
> >
> > case 2)
> >
> > NetworkManager: <info> Config: set interface ap_scan to 1
> > NetworkManager: <info> (wlan0): supplicant connection state change: 2 ->
> > 0 NetworkManager: <info> (wlan0): supplicant connection state change: 0
> > -> 2
> >
> > NetworkManager: <info> wlan0: link timed out. <- ALSO
> > TIMEOUT
> >
> > NetworkManager: <info> (wlan0): supplicant connection state change: 2 ->
> > 3 NetworkManager: <info> (wlan0): supplicant connection state change: 3
> > -> 5 NetworkManager: <info> (wlan0): supplicant connection state change:
> > 5 -> 4 NetworkManager: <info> (wlan0): supplicant connection state
> > change: 4 -> 5 NetworkManager: <info> (wlan0): supplicant connection
> > state change: 5 -> 6 NetworkManager: <info> (wlan0): supplicant
> > connection state change: 6 -> 7 NetworkManager: <info> Activation
> > (wlan0/wireless) Stage 2 of 5 (Device Configure) successful. Connected
> > to wireless network 'dagger'.
> > NetworkManager: <info> Activation (wlan0) Stage 3 of 5 (IP Configure
> > Start) scheduled.
> > NetworkManager: <info> Activation (wlan0) Stage 3 of 5 (IP Configure
> > Start) started...
> >
> >
> > and it start successfully
> >
> >
> > In both cases it seems we always have supplicant state change:
> >
> > NetworkManager: <info> (wlan0): supplicant connection state change: 2 ->
> > 0 NetworkManager: <info> (wlan0): supplicant connection state change: 0
> > -> 2
> >
> > which doesn't occur if we copy config file later. Maybe NM should wait a
> > bit longer before timing out.
> >
> > Also looking at case 1 NM tries to associate with AP only once and if
> > unsuccessful asks for password again. Maybe it would be worth changing
> > this behavior to try associate at least twice before asking (please note
> > it's not system-settings specific. It also happens with nm-applet if
> > first association wasn't successful - doesn't happen too often, but it's
> > very annoying if you have to retype your password knowing you've got the
> > right one in your keyring - even more annoying when your password is 20+
> > characters long).
> >
> >
> > Cheers,
> > Rob
> >
> > On Sunday 27 July 2008 21:12:13 Robert Piasek wrote:
> > > Hi Dan,
> > >
> > >
> > > Thank you very much for the instructions and your help. I've tried to
> > > do it myself using keyfile plugin specification, but I stacked on SSID.
> > > I couldn't figure out how to specify that. I've spend few hours trying
> > > before I gave up and posted to the mailing list. It would be good to
> > > stick it somewhere. (like
> > > http://live.gnome.org/NetworkManagerConfigurationSpecification or
> > > http://www.gnome.org/projects/NetworkManager/)
> > >
> > >
> > > Cheres,
> > > Rob
> > >
> > > On Sunday 27 July 2008 19:45:58 Dan Williams wrote:
> > > > On Sat, 2008-07-26 at 20:04 +0100, Robert Piasek wrote:
> > > > > Hi,
> > > > >
> > > > > Could anyone be kind enough to send me an example of keyfile plugin
> > > > > file for wireless config?
> > > >
> > > > [802-11-wireless-security]
> > > > key-mgmt=none
> > > > wep-tx-keyidx=0
> > > > auth-alg=open
> > > > wep-key0=33b7af2400ba80f060f144e195
> > > >
> > > > [connection]
> > > > id=Wireless connection 1
> > > > type=802-11-wireless
> > > > autoconnect=true
> > > > timestamp=0
> > > >
> > > > [802-11-wireless]
> > > > ssid=102;111;111;98;97;114;
> > > > mode=infrastructure
> > > > channel=0
> > > > rate=0
> > > > tx-power=0
> > > > mtu=0
> > > > security=802-11-wireless-security
> > > >
> > > > [ipv4]
> > > > method=manual
> > > > addresses1=192.168.1.2;24;192.168.1.1;
> > > > routes1=192.168.1.2;24;192.168.1.1;
> > > > ignore-dhcp-dns=false
> > > >
> > > > How I got this:
> > > >
> > > > 1) stop NetworkManager
> > > > 2) killall -TERM nm-system-settings
> > > > 3) /usr/sbin/nm-system-settings --debug --plugins=keyfile
> > > > 4) /usr/bin/nm-connection-editor
> > > > 5) Make a new wireless connection, fill everything out, then hit OK
> > > > 6) re-open the connection and check the "System connection" checkbox,
> > > > then hit OK again
> > > >
> > > > Steps 5 & 6 may not need to be separate, that's just how I did them
> > > > because I hit OK too fast in step 5 then remembered why I was there
> > > > :)
> > > >
> > > > The routes1 field is also bogus here and shouldn't be filled in, but
> > > > apparently we're screwing something up in the connection editor.
> > > >
> > > > Dan
> > > >
> > > > > On Saturday 19 July 2008 01:52:42 Robert Piasek wrote:
> > > > > > Hi,
> > > > > >
> > > > > > I would like to use system wide configuration for NM, but there
> > > > > > is no native plugin for my distribution. That leaves me with
> > > > > > keyfile plugin. I've tried to use it, but so far without any
> > > > > > luck. First I tried to find a decent example of configuration
> > > > > > file, but I could only find a specification page without any
> > > > > > examples. My tries to create a config file based on on that
> > > > > > specification failed.
> > > > > >
> > > > > > Than I tried to save my current config by selecting system
> > > > > > settings checkbox. But every time I click OK, it always comes up
> > > > > > with the error message "Adding connection failed: Launch helper
> > > > > > exited with unknown return code 1." (not very useful error
> > > > > > message :p).
> > > > >
> > > > > BTW this error message is generated when you try to save your
> > > > > connection as system-settings, and
> > > > > /etc/NetworkManager/nm-system-settings.conf does not exists.
> > > > >
> > > > > > Since system wide
> > > > > > settings are using policykit, so I'm _guessing_ it might be
> > > > > > related. I've added section below to my policykit.conf, but it
> > > > > > didn't change anything.
> > > > > >
> > > > > >
> > > > > > my PolicyKit.conf contains:
> > > > > >
> > > > > > <?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
> > > > > >
> > > > > > <!DOCTYPE pkconfig PUBLIC "-//freedesktop//DTD PolicyKit
> > > > > > Configuration 1.0//EN"
> > > > > > "http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd">
> > > > > >
> > > > > > <!-- See the manual page PolicyKit.conf(5) for file format -->
> > > > > >
> > > > > > <config version="0.1">
> > > > > > <match user="my_username">
> > > > > > <return result="yes"/>
> > > > > > </match>
> > > > > > </config>
> > > > > >
> > > > > >
> > > > > >
> > > > > > Any help appreciated.
> > > > > >
> > > > > >
> > > > > >
> > > > > > Cheers,
> > > > > > Rob
> > > > > >
> > > > > > _______________________________________________
> > > > > > NetworkManager-list mailing list
> > > > > > NetworkManager-list gnome org
> > > > > > http://mail.gnome.org/mailman/listinfo/networkmanager-list
> > > > >
> > > > > _______________________________________________
> > > > > NetworkManager-list mailing list
> > > > > NetworkManager-list gnome org
> > > > > http://mail.gnome.org/mailman/listinfo/networkmanager-list
> > >
> > > _______________________________________________
> > > NetworkManager-list mailing list
> > > NetworkManager-list gnome org
> > > http://mail.gnome.org/mailman/listinfo/networkmanager-list
>
> _______________________________________________
> NetworkManager-list mailing list
> NetworkManager-list gnome org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]