Solved Wifi mess

Hi,
just want to report some wifi mess up in this system.
I'm using networkmgr integrated with a very handsome xfce desktop to manage wireless networks and actually have 2 network entries in wpa_supplicant.conf.
It happens that when switching networks the system get 2 IP's for the same interface and this results in no network a headache with a strong wifi signal.
It's a bug, it's clearly a bug.
When switching networks the interface MUST cleanup the previous network settings.
The only way to fix this issue is by forcefully delete one of the addresses:
# ifconfig wlan0 delete 192.168.123.45

In the forum I keep on getting responses like I should use Linux drivers, buy one wifi dongle or that I've a networking problem at home, etc.
If that's the case I should never be able to post this message right now.
The network is working just fine until the system reboots or switch to another network if I move the laptop to other place.
So it's not the WIFI drivers problem!!!
It's services like dhcp or whatever aren't doing their job properly.
 
Hi,
just want to report some wifi mess up in this system.
I'm using networkmgr integrated with a very handsome xfce desktop to manage wireless networks and actually have 2 network entries in wpa_supplicant.conf.
It happens that when switching networks the system get 2 IP's for the same interface and this results in no network a headache with a strong wifi signal.
It's a bug, it's clearly a bug.
When switching networks the interface MUST cleanup the previous network settings.
The only way to fix this issue is by forcefully delete one of the addresses:
# ifconfig wlan0 delete 192.168.123.45

In the forum I keep on getting responses like I should use Linux drivers, buy one wifi dongle or that I've a networking problem at home, etc.
If that's the case I should never be able to post this message right now.
The network is working just fine until the system reboots or switch to another network if I move the laptop to other place.
So it's not the WIFI drivers problem!!!
It's services like dhcp or whatever aren't doing their job properly.
If you post your configs files we can try to replicate the issue.
 
If you post your configs files we can try to replicate the issue.
It's quite easy to replicate.
Just connect to a wifi network then later connect to other one.
It will happen that sometimes it will get 2 IP addresses to the same and only wlan interface and whatever mess the routing table and/or DNS gets into.
Switching wifi networks is one the most usefull operations we do with a wireless device we keep moving to one place to another, home, office, coffee shop.
 
It's quite easy to replicate.
Just connect to a wifi network then later connect to other one.
It will happen that sometimes it will get 2 IP addresses to the same and only wlan interface and whatever mess the routing table and/or DNS gets into.
Switching wifi networks is one the most usefull operations we do with a wireless device we keep moving to one place to another, home, office, coffee shop.
I use a trunk network with ethernet + 4 different wifi networks that change automatically when I move around in the house and I never had this problem.

For us to understand your setup and try to replicate it we need to know what is in /etc/sysctl.conf, /etc/rc.conf and /etc/wpa_supplicant.conf.

PS.: just hide your ssid, bssid and psk entries in the /etc/wpa_supplicant.conf and it is safe to share.
 
Laptop model: Dell Latitude E6410
Wifi: Intel Centrino Ultimate-N 6300 AGN
Code:
# $FreeBSD$
#
#  This file is read when going to multi-user and its contents piped thru
#  ``sysctl'' to adjust kernel values.  ``man 5 sysctl.conf'' for details.
#

# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
#security.bsd.see_other_uids=0
security.bsd.unprivileged_read_msgbuf=0
security.bsd.unprivileged_proc_debug=0
kern.randompid=1
kern.elf32.aslr.enable=1
kern.elf32.aslr.pie_enable=1
kern.elf32.aslr.honor_sbrk=0
kern.elf64.aslr.enable=1
kern.elf64.aslr.pie_enable=1
kern.elf64.aslr.honor_sbrk=0
Code:
clear_tmp_enable="YES"
syslogd_flags="-ss"
sendmail_enable="NONE"
hostname="beethoven"
keymap="pt.acc.kbd"
wlans_iwn0="wlan0"
ifconfig_wlan0="country PT regdomain ETSI WPA DHCP"
sshd_enable="YES"
moused_enable="YES"
ntpdate_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
rc_startmsgs="NO"
lightdm_enable="YES"
webcamd_enable="YES"
cupsd_enable="YES"
kld_list="i915kms fusefs"
vboxnet_enable="YES"
devfs_system_ruleset="system"
ifconfig_vboxnet0="DHCP"
dbus_enable="YES"
hcsecd_enable="YES"
ifconfig_em0="DHCP"
Code:
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1

network={
 ssid="M*-5G_EXT"
 key_mgmt=WPA-PSK
 proto=RSN
 psk="***"
}

network={
 ssid="M*-7F"
 key_mgmt=WPA-PSK
 proto=RSN
 psk="***"
}

network={
 ssid="G*F7"
 key_mgmt=WPA-PSK
 proto=RSN
 psk="***"
}
 
Last edited by a moderator:
By the way the bsdconfig tool wifi setup does not work.
It detects the SSID but it's impossible to select one in the list.
 
I'm connected at this moment, the interface shows it got the IP 192.168.1.92 and it's connected to the extender according to the mac address information of # ifconfig wlan0. Then I did a # tcpdump -n -vv -i wlan0 host 192.168.1.92 and in other terminal window # ping 192.168.1.1.

I can see ICMP packets going out but no response, 100% packet loss

Then in another host I did # ping 192.168.1.92 I can see ICMP packets reaching in the system but the host receives no answer, 100% packet loss.
Code:
PING 192.168.1.92 (192.168.1.92) 56(84) bytes of data.
^C
--- 192.168.1.92 ping statistics ---
13 packets transmitted, 0 received, 100% packet loss, time 12153ms
So packets are reaching in but aren't able to go out.
 
I used wifimgr with no problems. Can wpa_supplicant and networkmgr be doing the same job at the same time?

It's possible?
ifconfig_wlan0="country PT regdomain ETSI WPA DHCP"
Or:
Code:
ifconfig_wlan0="WPA DHCP"
create_args_wlan0="country PT regdomain ETSI"
 
I used wifimgr with no problems. Can wpa_supplicant and networkmgr be doing the same job at the same time?

It's possible?

Or:
Code:
ifconfig_wlan0="WPA DHCP"
create_args_wlan0="country PT regdomain ETSI"
Sometimes I have that feeling too, that there are 2 processes doing the same thing.
Because when the system starts up and there's no wifi connection in networkmgr and it shows few networks in the list.
It shows only a more complete list after I force with a
# ifconfig wlan0 scan
So I think it may be possible that having 2 processes doing the same and overriding each one data.
Who can confirm this?
 
If you have the following in your /etc/rc.conf:

Code:
ifconfig_wlan0="country PT regdomain ETSI WPA DHCP"

Then it will start wpa_supplicant using the official "FreeBSD way". This will likely conflict with 3rd party GUI software.
So you need to remove this line and then use the other tool.

My advice is to use the standard and supported software from FreeBSD before you try anything different. At least to start with. Then you can slowly work out what piece of GUI software is likely broken.
 
If you have the following in your /etc/rc.conf:

Code:
ifconfig_wlan0="country PT regdomain ETSI WPA DHCP"

Then it will start wpa_supplicant using the official "FreeBSD way". This will likely conflict with 3rd party GUI software.
So you need to remove this line and then use the other tool.

My advice is to use the standard and supported software from FreeBSD before you try anything different. At least to start with. Then you can slowly work out what piece of GUI software is likely broken.
I can't remove that line or no 5Ghz networks will be detected.
Those options have to be there.
But adjusted into this that makes more sense:
ifconfig_wlan0="WPA DHCP"
create_args_wlan0="country PT regdomain ETSI"
 
I can't remove that line or no 5Ghz networks will be detected.
Those options have to be there.
But adjusted into this that makes more sense:
The problematic part is only the WPA statement. This is what triggers FreeBSD's wpa_supplicant to kick in in parallel to your 3rd party management solution. Then without connection via wpa first, the dhclient isn't going to yield anything useful.

So I would recommend:

ifconfig_wlan0="WPA DHCP"
create_args_wlan0="country PT regdomain ETSI"

(and then let the other tool configure wpa and dhcp.)
 
The problematic part is only the WPA statement. This is what triggers FreeBSD's wpa_supplicant to kick in in parallel to your 3rd party management solution. Then without connection via wpa first, the dhclient isn't going to yield anything useful.

So I would recommend:

ifconfig_wlan0="WPA DHCP"
create_args_wlan0="country PT regdomain ETSI"

(and then let the other tool configure wpa and dhcp.)
well, this one i never did before.
I will try that surely.
Thank you.
 
The problematic part is only the WPA statement. This is what triggers FreeBSD's wpa_supplicant to kick in in parallel to your 3rd party management solution. Then without connection via wpa first, the dhclient isn't going to yield anything useful.

So I would recommend:

ifconfig_wlan0="WPA DHCP"
create_args_wlan0="country PT regdomain ETSI"

(and then let the other tool configure wpa and dhcp.)
Just to leave an update that this doesn't work.
Removing that line the wlan interface isn't configured so the wifimgr tool will not open.
The xfce plugin shows the interface is disabled and have to manually enable it. Then after enabled it does not auto connect to the network.
I had to put that line back in the rc.conf.
 
Did you keep wlans_iwn0="wlan0"?

Just to clarify. It says to remove the ifconfig_wlan0="" content for networkmgr. wifimgr worked fine with the FreeBSD configuration; their job is to do what you would do manually from the terminal. networkmgr tries to do something else, apparently.
 
Yep, as CuatroTorres said, you still need to create the wlan0 interface (bound to iwn0).

So like this.

Code:
wlans_iwn0="wlan0"
create_args_wlan0="country PT regdomain ETSI"
#### No ifconfig_wlan0="WPA DHCP"

I get that some of the lines look similar. The create_args_wlan0 is effectively only used by the codepath enabled by wlans_iwn0 so this is still needed to create the interface. The only thing that isn't is to use the interface (you use a different tool).

I might also suggest to test this on a non 5Ghz network first (and removing the create args), to make sure that is working.
 
Yep, as CuatroTorres said, you still need to create the wlan0 interface (bound to iwn0).

So like this.

Code:
wlans_iwn0="wlan0"
create_args_wlan0="country PT regdomain ETSI"
#### No ifconfig_wlan0="WPA DHCP"

I get that some of the lines look similar. The create_args_wlan0 is effectively only used by the codepath enabled by wlans_iwn0 so this is still needed to create the interface. The only thing that isn't is to use the interface (you use a different tool).

I might also suggest to test this on a non 5Ghz network first (and removing the create args), to make sure that is working.
Thank you but I will not remove that line as I want wifi network at system boot and not by manual selection at every session.
 
Just to leave an update that this doesn't work.
Removing that line the wlan interface isn't configured so the wifimgr tool will not open.
The xfce plugin shows the interface is disabled and have to manually enable it. Then after enabled it does not auto connect to the network.
I had to put that line back in the rc.conf.
That‘s right. net-mgmt/wifimgr is just a nice GUI for editing the wpa_supplicant.conf file. When it saves the modifed configuration, it restarts the network service - have a look at the man pages.

net-mgmt/networkmgr is doing pretty the same, but it has some additional features, like auto switching to wired LAN when link comes up. In the source code I found commands for killing and restarting wpa_supplicant.

So I would say both tools depend on wpa_supplicant.
 
Back
Top