Re: Ad-Hoc network creation took too long, failing activation

2014-10-10 Thread Dan Williams
On Thu, 2014-10-09 at 00:24 +0200, poma wrote:
 On 08.10.2014 20:31, Dan Williams wrote:
  On Wed, 2014-10-08 at 00:10 +0200, poma wrote:
  Starting Network Manager...
  info NetworkManager (version 0.9.10.0-5.git20140704.fc21) is starting...
  info WEXT support is enabled
  info WiFi hardware radio set enabled
  info Loaded device plugin: 
  /usr/lib/NetworkManager/libnm-device-plugin-wifi.so
  info WiFi enabled by radio killswitch; enabled by state file
  info Networking is enabled by state file
  Started Network Manager.
  info (ra0): driver does not support SSID scans (scan_capa 0x00).
  info (ra0): using WEXT for WiFi device control
  info (ra0): new 802.11 WiFi device (driver: 'usb' ifindex: 5)
  info (ra0): exported as /org/freedesktop/NetworkManager/Devices/4
  info (ra0): device state change: unmanaged - unavailable (reason 
  'managed') [10 20 2]
  info (ra0): preparing device
  warn (ra0): error 100 getting card mode
  error [1412709645.317223] [platform/wifi/wifi-utils-wext.c:160] 
  wifi_wext_set_mode(): (ra0): error setting mode 2
  
  Ugh, looks like you're using WEXT, which is historically quite
  problematic because different drivers expected different sequences of
  WEXT requests.  Any driver that uses WEXT and is not upstream is
  automatically suspect, unfortunately...
  
  info wpa_supplicant started
  info (ra0) supports 1 scan SSIDs
  info (ra0): supplicant interface state: starting - ready
  info (ra0): device state change: unavailable - disconnected (reason 
  'supplicant-available') [20 30 42]
  info (ra0): supplicant interface state: ready - disconnected
  info (ra0) supports 1 scan SSIDs
  info startup complete
  info (ra0): supplicant interface state: disconnected - inactive
  ...
  info (ra0): disconnecting for new activation request.
  info (ra0): device state change: activated - deactivating (reason 
  'none') [100 110 0]
  info NetworkManager state is now DISCONNECTING
  info (ra0): device state change: deactivating - disconnected (reason 
  'none') [110 30 0]
  info (ra0): deactivating device (reason 'none') [0]
  info (ra0): canceled DHCP transaction, DHCP client pid 1144
  info NetworkManager state is now DISCONNECTED
  info Activation (ra0) starting connection 'bla'
  info Activation (ra0) Stage 1 of 5 (Device Prepare) scheduled...
  warn Connection disconnected (reason -3)
  info (ra0): supplicant interface state: completed - disconnected
  info Activation (ra0) Stage 1 of 5 (Device Prepare) started...
  info (ra0): device state change: disconnected - prepare (reason 'none') 
  [30 40 0]
  info NetworkManager state is now CONNECTING
  info Activation (ra0) Stage 2 of 5 (Device Configure) scheduled...
  info Activation (ra0) Stage 1 of 5 (Device Prepare) complete.
  info Activation (ra0) Stage 2 of 5 (Device Configure) starting...
  info (ra0): device state change: prepare - config (reason 'none') [40 
  50 0]
  info Activation (ra0/wireless): connection 'bla' has security, and 
  secrets exist.  No new secrets needed.
  info Config: added 'ssid' value 'bla'
  info Config: added 'mode' value '1'
  info Config: added 'frequency' value '2412'
  info Config: added 'key_mgmt' value 'NONE'
  info Config: added 'auth_alg' value 'OPEN'
  info Config: added 'wep_key0' value 'omitted'
  info Config: added 'wep_tx_keyidx' value '0'
  info Activation (ra0) Stage 2 of 5 (Device Configure) complete.
  info Config: set interface ap_scan to 2
  info (ra0): supplicant interface state: disconnected - associating
  warn Activation (ra0/wireless): Ad-Hoc network creation took too long, 
  failing activation.
  
  The driver did not emit the SIOCGIWAP event, indicating that it had
  successfully completed Ad-Hoc AP setup.  This is a driver bug.
  
  info (ra0): device state change: config - failed (reason 
  'supplicant-timeout') [50 120 11]
  info NetworkManager state is now DISCONNECTED
  warn Activation (ra0) failed for connection 'bla'
  warn Connection disconnected (reason -3)
  info (ra0): supplicant interface state: associating - disconnected
  info (ra0): device state change: failed - disconnected (reason 'none') 
  [120 30 0]
  info (ra0): deactivating device (reason 'none') [0]
  warn (ra0): error 100 getting card mode
  error [1412717534.522258] [platform/wifi/wifi-utils-wext.c:160] 
  wifi_wext_set_mode(): (ra0): error setting mode 2
 
 
  IBSS works via Wicd although not reliable.
  BTW AP/WPA2, is it possible at all?
  
  NM supports AP mode if wpa_supplicant supports it on the device, but
  given the information you've provided here, the driver looks very
  fragile and I wouldn't expect it to work.  WPA2 may be possible, but
  again the driver is quite suspect.
  
  The driver is just bad, I'm afraid...
  
  Dan
  
 
 Thanks, 
 whether the same(Ad-Hoc/IBSS  WEXT == unsupported) applies to this module 
 also

Could you do the following to get supplicant debug logs in this case?
They can be enabled by dbus, but it's sometimes easier to just:

1) mv /usr/sbin/wpa_supplicant /

VPN + dnsmasq = split dns?

2014-10-10 Thread Olav Morken
Hi,

I am trying to set up Network Manager to connect to an OpenVPN server, 
and have trouble understanding how it applies the DNS settings it 
receives from the server.

Basically, as far as I can tell, it automatically assumes that I want 
to use split dns, and limits the DNS servers it receives from the 
OpenVPN servers to the domains it assumes belongs to this 
configuration. However, it also ignores the existing DNS servers it 
has configured.

That leaves us with a dnsmasq configured with two nameservers it will 
query for two specific subdomains, and no nameservers it will use for 
other domains. The result is that dnsmasq is only willing to respond 
to DNS queries for those subdomains, and respond with REFUSED for 
every other domain.

I assume that this is not the way it is supposed to work, since that 
would mean that everyone connecting to a VPN would be unable to access 
most of the Internet. I therefore assume that there is something wrong 
with my configuration.

I am however unable to tell what makes it choose this behavior. I 
tried to look at the code, and found the location where it adds the 
domains[1], but I was unable to find a way to override this behavior.

Does anyone have any suggestions for what may trigger this behavior, 
and what I can do to avoid it?

(Configuration details and logs from network manager included below.)

Best regards,
Olav Morken


[1] 
http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/dns-manager/nm-dns-dnsmasq.c?id=60cce4004284242f0891160e21979a3027da6e0e#n234


Configuration:

 Both the client and server have IPv6 enabled.

 The VPN configuration on the client side doesn't contain anything too 
 exiting. It uses a TCP connection to port 443, a TUN device, and 
 username+password authentication. Both the IPv4 and the IPv6 settings 
 are set to Automatic(VPN)

 The OpenVPN server is configured with a TUN device and topology 
 subnet. It pushes the following (slightly anonymized) options to the 
 client:

  push dhcp-option DNS 198.51.100.57
  push dhcp-option DNS 198.51.100.168
  push dhcp-option DOMAIN example.org
  push redirect-gateway def1 bypass-dhcp
  push route-ipv6 2000::/3


Software versions:
 XUbuntu 14.04
 network-manager 0.9.8.8-0ubuntu7
 network-manager-openvpn 0.9.8.2-1ubuntu4
 openvpn 2.3.2-7ubuntu3

Log from connection:
 NetworkManager[924]: info IPv4 configuration:
 NetworkManager[924]: info   Internal Gateway: 192.0.2.1
 NetworkManager[924]: info   Internal Address: 192.0.2.2
 NetworkManager[924]: info   Internal Prefix: 25
 NetworkManager[924]: info   Internal Point-to-Point Address: 0.0.0.0
 NetworkManager[924]: info   Maximum Segment Size (MSS): 0
 NetworkManager[924]: info   Forbid Default Route: no
 NetworkManager[924]: info   Internal DNS: 198.51.100.57
 NetworkManager[924]: info   Internal DNS: 198.51.100.168
 NetworkManager[924]: info   DNS Domain: 'example.org'
 NetworkManager[924]: info IPv6 configuration:
 NetworkManager[924]: info   Internal Address: 2001:db81:4561::1000
 NetworkManager[924]: info   Internal Prefix: 64
 NetworkManager[924]: info   Internal Point-to-Point Address: 
2001:db81:4561::1
 NetworkManager[924]: info   Maximum Segment Size (MSS): 0
 NetworkManager[924]: info   Static Route: 2000::/3   Next Hop: 2000::
 NetworkManager[924]: info   Forbid Default Route: no
 NetworkManager[924]: info   DNS Domain: 'example.org'
 NetworkManager[924]: info VPN connection 'example-openvpn-config' (IP Config 
Get) complete.
 NetworkManager[924]: info Policy set 'example-openvpn-config' (tun0) as 
default for IPv4 routing and DNS.
 NetworkManager[924]: info Policy set 'example-openvpn-config' (tun0) as 
default for IPv6 routing and DNS.
 NetworkManager[924]: info Writing DNS information to /sbin/resolvconf
 dnsmasq[1464]: setting upstream servers from DBus
 dnsmasq[1464]: using nameserver 198.51.100.168#53 for domain 0.192.in-addr.arpa
 dnsmasq[1464]: using nameserver 198.51.100.168#53 for domain example.org
 dnsmasq[1464]: using nameserver 198.51.100.57#53 for domain 0.192.in-addr.arpa
 dnsmasq[1464]: using nameserver 198.51.100.57#53 for domain example.org
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Ad-Hoc network creation took too long, failing activation

2014-10-10 Thread poma

- /etc/sysconfig/wpa_supplicant:

# Use the flag -i before each of your interfaces, like so:
#  INTERFACES=-ieth1 -iwlan0
INTERFACES=

# Use the flag -D before each driver, like so:
#  DRIVERS=-Dwext
DRIVERS=

# Other arguments
#   -u   Enable the D-Bus interface (required for use with NetworkManager)
#   -f   Log to /var/log/wpa_supplicant.log
#   -P   Write pid file to /var/run/wpa_supplicant.pid 
#required to return proper codes by init scripts (e.g. double start 
action)
#-B to daemonize that has to be used together with -P is already in 
wpa_supplicant.init.d
OTHER_ARGS=-ddtu -f /var/log/wpa_supplicant.log -P /var/run/wpa_supplicant.pid


- /var/log/wpa_supplicant.log:

1412987511.201071: wpa_supplicant v2.0
1412987511.201797: random: Trying to read entropy from /dev/random
1412987511.203564: dbus: Register D-Bus object '/fi/w1/wpa_supplicant1'
1412987511.204830: Providing DBus service 'fi.w1.wpa_supplicant1'.
1412987511.205753: Providing DBus service 'fi.epitest.hostap.WPASupplicant'.
1412987511.205777: Successfully initialized wpa_supplicant
1412987511.205794: random: Got 20/20 bytes from /dev/random
1412987511.205983: dbus: fi.w1.wpa_supplicant1.CreateInterface 
(/fi/w1/wpa_supplicant1)
1412987511.206002: Initializing interface 'wlp0s4f1u3' conf 'N/A' driver 
'nl80211,wext' ctrl_interface 'N/A' bridge 'N/A'
1412987511.206504: Could not open file /sys/class/net/wlp0s4f1u3/phy80211/name: 
No such file or directory
1412987511.206555: nl80211: Set mode ifindex 5 iftype 2 (STATION)
1412987511.206574: nl80211: Failed to set interface 5 to mode 2: -19 (No such 
device)
1412987511.206582: nl80211: Could not configure driver to use managed mode
1412987511.206589: netlink: Operstate: linkmode=0, operstate=6
1412987511.407292: nl80211: Set mode ifindex 5 iftype 2 (STATION)
1412987511.407392: nl80211: Failed to set interface 5 to mode 2: -19 (No such 
device)
1412987511.407421: wlp0s4f1u3: Failed to initialize driver interface - try next 
driver wrapper
1412987511.509975: SIOCGIWRANGE: WE(compiled)=22 WE(source)=16 enc_capa=0xf
1412987511.510019:   capabilities: key_mgmt 0xf enc 0x1f flags 0x0
1412987511.510142: netlink: Operstate: linkmode=1, operstate=5
1412987511.519245: wlp0s4f1u3: Own MAC address: 00:11:22:33:44:55
1412987511.519289: wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 
key_len=0
1412987511.519317: wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 
key_len=0
1412987511.519339: wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 
key_len=0
1412987511.519359: wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 
key_len=0
1412987511.519379: wpa_driver_wext_set_countermeasures
1412987511.519401: wlp0s4f1u3: RSN: flushing PMKID list in the driver
1412987511.519425: wlp0s4f1u3: State: DISCONNECTED - INACTIVE
1412987511.519518: WPS: Set UUID for interface wlp0s4f1u3
1412987511.519597: WPS: UUID based on MAC address - hexdump(len=16): ...
1412987511.572800: EAPOL: SUPP_PAE entering state DISCONNECTED
1412987511.572840: EAPOL: Supplicant port status: Unauthorized
1412987511.572856: EAPOL: KEY_RX entering state NO_KEY_RECEIVE
1412987511.572870: EAPOL: SUPP_BE entering state INITIALIZE
1412987511.572886: EAP: EAP entering state DISABLED
1412987511.572900: EAPOL: Supplicant port status: Unauthorized
1412987511.572915: EAPOL: Supplicant port status: Unauthorized
1412987511.572967: dbus: Register interface object 
'/fi/w1/wpa_supplicant1/Interfaces/1'
1412987511.573341: wlp0s4f1u3: Added interface wlp0s4f1u3
1412987511.573368: wlp0s4f1u3: State: INACTIVE - DISCONNECTED
1412987511.573384: wpa_driver_wext_set_operstate: operstate 0-0 (DORMANT)
1412987511.573401: netlink: Operstate: linkmode=-1, operstate=5
1412987511.573815: dbus: org.freedesktop.DBus.Properties.GetAll 
(/fi/w1/wpa_supplicant1)
1412987511.573987: nl80211: Ignore event for foreign ifindex 5
1412987511.574016: nl80211: Ignore event for foreign ifindex 5
1412987511.574034: nl80211: Ignore event for foreign ifindex 3
1412987511.574051: nl80211: Ignore event for foreign ifindex 5
1412987511.574101: nl80211: Ignore event for foreign ifindex 5
1412987511.574109: RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
1412987511.574116: RTM_NEWLINK, IFLA_IFNAME: Interface 'wlp0s4f1u3' added
1412987511.574133: WEXT: if_removed already cleared - ignore event
1412987511.574141: Ignore event for foreign ifindex 3
1412987511.574148: RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
1412987511.574155: RTM_NEWLINK, IFLA_IFNAME: Interface 'wlp0s4f1u3' added
1412987511.574164: WEXT: if_removed already cleared - ignore event
1412987511.574170: Wireless event: cmd=0x8b06 len=8
1412987511.574178: RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
1412987511.574184: RTM_NEWLINK, IFLA_IFNAME: Interface 'wlp0s4f1u3' added
1412987511.574203: WEXT: if_removed already cleared - ignore event
1412987511.574209: Wireless event: cmd=0x8b1a len=40
1412987511.574975: dbus: org.freedesktop.DBus.Properties.GetAll