Wireless interface goes down right after DHCP configuration (wireless client)
-
I have a pfsense 2.2.4 running on an APU with PCIe WIFI card.
I want to configure the APU as a WIFI client.
I have configured a new interface (OPT3) as infrastructure mode and can see that the pfsense detect my carier and start connection.
However as soon as it get a new IP address I can see the following logs :php-fpm[8592]: /rc.linkup: HOTPLUG: Configuring interface opt3
Nov 27 22:29:17 kernel: ath0_wlan0: link state changed to DOWNafter that the interface state shows : no carrier.
I have check turning it to a static IP. It works perfectly fine and I can now see the following log :
php-fpm[48534]: /rc.linkup: Hotplug event detected for WIFI(opt3) but ignoring since interface is configured with static IP (192.168.2.69 )
However, static IP is not an acceptable solution for my case.
Any idea ?
Ebo
-
The only way I have ever used Wifi in Client mode is to put it as the WAN interface.
Think of it as your incoming data pipe. Just sticking it on OPT3 is going to do what exactly? Unless you set it up in some "dual wan" arrangement it is not going to work.
-
I am assuming you made firewall rules for OPT3 to allow traffic?
-
The fact is that this pfsense will be very mobile and I want to be able to switch the 'WAN' from ETHERNET to WIFI with minimum change (according to the best option I'll have at the time).
That's why my pfsense is configured to use either WAN or WIFI (OPT 3), but not both in the same time.
To change from ethernet to wifi, I just have to configure WIFI with SSID and PSK and set it's gateway as default gateway. That's the main reason I'd like to keep DHCP.However, I have tried setting the WAN interface with the wifi, and I still have the same issue as long as I am configured with DHCP.
-
My problem here is not traffic, but unstable link.
Are you talking about any specific rule that may stabilize the link ? - in this case the answer is no.
-
I setup my FreeBSD laptop with lagg(4) to accpompish the same. It allows me to use ethernet, wifi or cellular depending om where I am. pfSense mainly uses lagg for redundancy but it can be used for much more.
https://www.freebsd.org/doc/handbook/network-aggregation.html
Example 30.3 -
Very interesting. Thanks. That's exactly what I need.
However, if I want to do so, can I configure it through pfsense ?
I have just tried from the Interface>assign menu and the lagg tab, and it looks like I can't access anymore my Wifi setting once I put the wifi interface in the lagg. :-(
-
Well if you cannot pull it off in pfSense then try MultiWAN. It will serve as a failover.
https://doc.pfsense.org/index.php/Multi-WAN
-
I was able to fix my problem, so just a feedback for those who may have the same problem :
It looks like there is a bug in Pfsense.
After configuring an interface with Wifi + DHCP + WPA2 :
When the link is detected UP, pfsense launch the scrip /etc/rc.linkup which use the method interface_configure() to configure the link.
The interface_configure() reconfigure the wpa_supplicant, which bring the link down.
When the link is detected UP again, pfsense launch again the scrip /etc/rc.linkup which which bring the link down again…
And so on indefinitively.
The only workaround I found was to patch /etc/rc.linkup :
case "up":
log_error("DEVD Ethernet attached event for {$iface}");
log_error("HOTPLUG2: Configuring interface {$iface}");
require_once("vpn.inc");
require_once("captiveportal.inc");
// Do not try to readd to bridge otherwise em(4) has problems
+ $realiface = get_real_interface($iface);
+ if (substr($realiface, 0, 4) != "ath0") { //my wireless interface name start with 'ath0'
interface_configure($iface, true, true);
+ }
+ else {
+ mwexec("/ect/rc.newwanip"); //rc.newanip manage reconfiguration of the interface if something is wrong.
+ }
break;
}Once this done, I have tried different use case. Activating, desactivating the interface, changing the network parameters, changing wifi network etc...
Everything works perfectly. -
Hardcoding ath0 in there isn't a good idea, but you could use: is_interface_wireless($realiface)
-
using ath0 as wan had similar problem which the above solved
it had another flaw though on boot as the dhclient quit
because cat /tmp/ath0_wlan0_output ath0_wlan0: no link …........... giving upthe interface_bring_up returns before the ath0_wlan0 link was present
/*fire up dhclient */
if ($wanif) {
// link not up as fast as interfaces_bring_up
log_error("/etc/inc/interfaces.inc sleeping");
sleep(10);
}mwexec("/sbin/dhcclient......