How to purge all network related config? Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Akrai
Posts: 21
Joined: Fri Jun 19, 2020 9:43 am

Re: How to purge all network related config?

Post by Akrai »

okay thanks!

edit: im gonna leave here mi current settings.

/etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

# Grant all members of group "netdev" permissions to configure WiFi, e.g. via wpa_cli or wpa_gui
ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
# Allow wpa_cli/wpa_gui to overwrite this config file
update_config=1
network={
        ssid="Wifi_5G"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="my wifi password"
}

network={
        ssid="Wifi24G"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="my wifi password"
}



/etc/network/interfaces

Code: Select all

# Location: /etc/network/interfaces
# Please modify network settings via: dietpi-config
# Or create your own drop-ins in: /etc/network/interfaces.d/

# Drop-in configs
source interfaces.d/*

# Local
auto lo
iface lo inet loopback

# Ethernet
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 1.1.1.1 1.0.0.1

# WiFi
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
address 192.168.1.12
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 1.1.1.1 1.0.0.1
wireless-power off



/etc/ifplugd/action.d/ifupdown

Code: Select all

  GNU nano 3.2                                                                             /etc/ifplugd/action.d/ifupdown                                                                                         

#!/bin/sh
set -e

case "$2" in
up)
        /sbin/ifup $1
        if [ "$1" == eth0 ]; then /sbin/ifdown wlan0 ; fi
        ;;
down)
        /sbin/ifdown $1
        if [ "$1" == eth0 ]; then /sbin/ifup wlan0 ; fi
        ;;
esac

User avatar
Joulinar
Posts: 2299
Joined: Sat Nov 16, 2019 12:49 am

Re: How to purge all network related config?

Post by Joulinar »

Hi,

below my settings.

/etc/network/interfaces
  • basically the standard settings if you configure eth0 as well as wlan0 using dietpi-config
  • both interfaces are set to STATIC
  • on eth0, I manually set a # in front of allow-hotplug eth0 to have the feature disabled
  • quite important setting, otherwise wlan0 will not start correctly during reboot if Ethernet cable is unpluged
  • it will block eth0 to start up automatically during reboot. But not a problem as we will give this task to ifplugd to manage eth0
  • Attention: the following will lead to have wlan0 active only until we finished configuration on ifplugd

    Code: Select all

    # Location: /etc/network/interfaces
    # Please modify network settings via: dietpi-config
    # Or create your own drop-ins in: /etc/network/interfaces.d/
    
    # Drop-in configs
    source interfaces.d/*
    
    # Local
    auto lo
    iface lo inet loopback
    
    # Ethernet
    #allow-hotplug eth0
    iface eth0 inet static
    address 192.168.0.12
    netmask 255.255.255.0
    gateway 192.168.0.1
    #dns-nameservers 9.9.9.9 149.112.112.112
    
    # WiFi
    allow-hotplug wlan0
    iface wlan0 inet static
    address 192.168.0.70
    netmask 255.255.255.0
    gateway 192.168.0.1
    #dns-nameservers 9.9.9.9
    wireless-power off
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
/etc/ifplugd/ifplugd.action
  • completely different than the default script
  • basically it will deactivate one interface before activating another

    Code: Select all

    #!/bin/sh
    set -e
    if [ -z "$1" ] || [ -z "$2" ] ; then
           echo "Wrong arguments" > /dev/stderr
           exit 1
    fi
    if [ "$1" != "eth0" ]; then
           echo "Wrong interface!" > /dev/stderr
           exit 1
    fi
    if [ "$2" = "up" ] ; then
           echo "bring down WiFi"
           /sbin/ifdown wlan0 --force
           /sbin/ifup eth0 --force
           exit 0
    elif [ "$2" = "down" ] ; then
           echo "bring up WiFi"
           /sbin/ifdown eth0 --force
           /sbin/ifup wlan0 --force
           exit 0
    fi
    exit 1
/etc/default/ifplugd
  • nothing special on this
  • eth0 will be managed
  • switching from eth0 to wlan0 will be delayed by 5 sec
  • switching from wlan0 to eth0 will be done as soon as a cable was plugged in, without any delay

    Code: Select all

    INTERFACES="eth0"
    HOTPLUG_INTERFACES="auto"
    ARGS="-q -f -u0 -d5 -w -I"
    SUSPEND_ACTION="stop"
once done ifplugd service would need to be activated
  • Attention: this will immediately force a switch from wlan0 to eth0 if a cable is plugged in

    Code: Select all

    systemctl enable ifplugd.service
    systemctl start ifplugd.service
You can check how it's working by doing the following

Code: Select all

journalctl -u ifplugd.service
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Akrai
Posts: 21
Joined: Fri Jun 19, 2020 9:43 am

Re: How to purge all network related config?

Post by Akrai »

hmmm there must be some problem, if i start with the eth unplugged, and then plug it, unplug it and finally plug it, this is the log:

Code: Select all

jun 21 10:17:54 DietPi systemd[1]: Starting LSB: Brings up/down network automatically...
jun 21 10:17:54 DietPi ifplugd(eth0)[438]: ifplugd 0.28 initializing.
jun 21 10:17:55 DietPi ifplugd(eth0)[438]: Using interface eth0/DC:A6:32:A9:4B:8D with driver <bcmgenet> (version: v2.0)
jun 21 10:17:55 DietPi ifplugd(eth0)[438]: Using detection mode: SIOCETHTOOL
jun 21 10:17:55 DietPi ifplugd(eth0)[438]: Initialization complete, link beat not detected.
jun 21 10:17:55 DietPi ifplugd[421]: Network Interface Plugging Daemon...start eth0...done.
jun 21 10:17:55 DietPi systemd[1]: Started LSB: Brings up/down network automatically.
jun 21 10:20:26 DietPi ifplugd(eth0)[438]: Link beat detected.
jun 21 10:20:26 DietPi ifplugd(eth0)[438]: Executing '/etc/ifplugd/ifplugd.action eth0 up'.
jun 21 10:20:26 DietPi ifplugd(eth0)[438]: client: bring down WiFi
jun 21 10:20:26 DietPi ifplugd(eth0)[438]: client: RTNETLINK answers: No such process
jun 21 10:20:26 DietPi ifplugd(eth0)[438]: client: RTNETLINK answers: Cannot assign requested address
jun 21 10:20:26 DietPi ifplugd(eth0)[438]: Program executed successfully.
jun 21 10:21:34 DietPi ifplugd(eth0)[438]: Link beat lost.
jun 21 10:21:39 DietPi ifplugd(eth0)[438]: Executing '/etc/ifplugd/ifplugd.action eth0 down'.
jun 21 10:21:39 DietPi ifplugd(eth0)[438]: client: bring up WiFi
jun 21 10:21:39 DietPi ifplugd(eth0)[438]: client: wpa_supplicant: wpa-roam can only be used with the "manual" inet METHOD
jun 21 10:21:39 DietPi ifplugd(eth0)[438]: client: run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
jun 21 10:21:39 DietPi ifplugd(eth0)[438]: client: ifup: failed to bring up wlan0
jun 21 10:21:39 DietPi ifplugd(eth0)[438]: Program execution failed, return value is 1.
jun 21 10:22:33 DietPi ifplugd(eth0)[438]: Link beat detected.
jun 21 10:22:33 DietPi ifplugd(eth0)[438]: Executing '/etc/ifplugd/ifplugd.action eth0 up'.
jun 21 10:22:33 DietPi ifplugd(eth0)[438]: client: bring down WiFi
jun 21 10:22:33 DietPi ifplugd(eth0)[438]: client: RTNETLINK answers: No such process
jun 21 10:22:33 DietPi ifplugd(eth0)[438]: client: RTNETLINK answers: Cannot assign requested address
jun 21 10:22:33 DietPi ifplugd(eth0)[438]: Program executed successfully.
okay so i change wpa-roam in my /etc/network/interfaces to wpa-conf as you have it, and looks working, but it doesnt connect to the ssids, i dont understand why:

Code: Select all

-- Logs begin at Thu 2019-02-14 11:11:58 CET, end at Sun 2020-06-21 10:42:53 CEST. --
jun 21 10:25:03 DietPi systemd[1]: Starting LSB: Brings up/down network automatically...
jun 21 10:25:04 DietPi ifplugd(eth0)[438]: ifplugd 0.28 initializing.
jun 21 10:25:04 DietPi ifplugd(eth0)[438]: Using interface eth0/DC:A6:32:A9:4B:8D with driver <bcmgenet> (version: v2.0)
jun 21 10:25:04 DietPi ifplugd(eth0)[438]: Using detection mode: SIOCETHTOOL
jun 21 10:25:04 DietPi ifplugd(eth0)[438]: Initialization complete, link beat not detected.
jun 21 10:25:04 DietPi ifplugd[417]: Network Interface Plugging Daemon...start eth0...done.
jun 21 10:25:04 DietPi systemd[1]: Started LSB: Brings up/down network automatically.
jun 21 10:25:09 DietPi ifplugd(eth0)[438]: Link beat detected.
jun 21 10:25:09 DietPi ifplugd(eth0)[438]: Executing '/etc/ifplugd/ifplugd.action eth0 up'.
jun 21 10:25:09 DietPi ifplugd(eth0)[438]: client: bring down WiFi
jun 21 10:25:09 DietPi ifplugd(eth0)[438]: client: ifdown: waiting for lock on /run/network/ifstate.wlan0
jun 21 10:25:17 DietPi ifplugd(eth0)[438]: Program executed successfully.
jun 21 10:26:42 DietPi ifplugd(eth0)[438]: Link beat lost.
jun 21 10:26:47 DietPi ifplugd(eth0)[438]: Executing '/etc/ifplugd/ifplugd.action eth0 down'.
jun 21 10:26:47 DietPi ifplugd(eth0)[438]: client: bring up WiFi
jun 21 10:26:47 DietPi wpa_supplicant[884]: Successfully initialized wpa_supplicant
jun 21 10:26:50 DietPi wpa_supplicant[887]: wlan0: Trying to associate with SSID 'CasitaAP'
jun 21 10:26:52 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 10:26:55 DietPi wpa_supplicant[887]: wlan0: Trying to associate with SSID 'CasitaAP'
jun 21 10:26:58 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 10:26:59 DietPi ifplugd(eth0)[438]: Program executed successfully.
jun 21 10:27:01 DietPi wpa_supplicant[887]: wlan0: Trying to associate with SSID 'Casita'
jun 21 10:27:04 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 10:27:06 DietPi wpa_supplicant[887]: wlan0: Trying to associate with SSID 'Casita'
jun 21 10:27:09 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 10:27:12 DietPi wpa_supplicant[887]: wlan0: Trying to associate with SSID 'CasitaAP'
jun 21 10:27:15 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 10:27:18 DietPi wpa_supplicant[887]: wlan0: Trying to associate with SSID 'CasitaAP'
jun 21 10:27:21 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 10:27:21 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="CasitaAP" auth_failures=1 duration=10 reason=CONN_FAILED
jun 21 10:27:29 DietPi wpa_supplicant[887]: wlan0: Trying to associate with SSID 'Casita'
jun 21 10:27:32 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 10:27:35 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="CasitaAP"
jun 21 10:27:35 DietPi wpa_supplicant[887]: wlan0: Trying to associate with SSID 'Casita'
jun 21 10:27:38 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 10:27:38 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=1 ssid="Casita" auth_failures=1 duration=10 reason=CONN_FAILED
jun 21 10:27:45 DietPi wpa_supplicant[887]: wlan0: Trying to associate with SSID 'CasitaAP'
jun 21 10:27:48 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 10:27:48 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="CasitaAP" auth_failures=2 duration=20 reason=CONN_FAILED
jun 21 10:28:01 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-SSID-REENABLED id=1 ssid="Casita"
jun 21 10:28:01 DietPi wpa_supplicant[887]: wlan0: Failed to initiate sched scan
jun 21 10:28:08 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="CasitaAP"
jun 21 10:28:08 DietPi wpa_supplicant[887]: wlan0: Trying to associate with SSID 'CasitaAP'
jun 21 10:28:11 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 10:28:11 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="CasitaAP" auth_failures=3 duration=30 reason=CONN_FAILED
jun 21 10:28:24 DietPi wpa_supplicant[887]: wlan0: Trying to associate with SSID 'Casita'
jun 21 10:28:26 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 10:28:26 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=1 ssid="Casita" auth_failures=2 duration=20 reason=CONN_FAILED
jun 21 10:28:41 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="CasitaAP"
jun 21 10:28:41 DietPi wpa_supplicant[887]: wlan0: Trying to associate with SSID 'CasitaAP'
jun 21 10:28:44 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 10:28:44 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="CasitaAP" auth_failures=4 duration=60 reason=CONN_FAILED
jun 21 10:28:56 DietPi wpa_supplicant[887]: wlan0: CTRL-EVENT-SSID-REENABLED id=1 ssid="Casita"
jun 21 10:28:56 DietPi wpa_supplicant[887]: wlan0: Failed to initiate sched scan
i have country=ES in my wpa_supplicant, maybe is because the static ip, but setting it to another one for sure not used by anyone still doesnt work
by the way, i forgot to enable the ifupd daemon as you did, and edit the default file, thats for sure the main reason it didnt work for me before, so for now everything is fixed except the wlan connection :?

edit: okay, so i must use wpa-conf instead of roam if i have preset ssids: https://raspberrypi.stackexchange.com/q ... twork-inte

edit: i have just changed the wlan0 to dhcp and it still doesnt connect, im just trying to connect to 2 2.4ghz ssids and the first one the password is 12345678, to discard weird character input, and so the psk is psk="12345678"

right now i have:
/etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

# Grant all members of group "netdev" permissions to configure WiFi, e.g. via wpa_cli or wpa_gui
ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
# Allow wpa_cli/wpa_gui to overwrite this config file
update_config=1
country=ES
network={
        ssid="CasitaAP"
        psk="12345678"
}

network={
        ssid="Casita"
        psk="12345678"
}

/etc/network/interface

Code: Select all

# Location: /etc/network/interfaces
# Please modify network settings via: dietpi-config
# Or create your own drop-ins in: /etc/network/interfaces.d/

# Drop-in configs
source interfaces.d/*

# Local
auto lo
iface lo inet loopback

# Ethernet
#allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 1.1.1.1 1.0.0.1

# WiFi
allow-hotplug wlan0
iface wlan0 inet dhcp
#address 192.168.1.15
#netmask 255.255.255.0
#gateway 192.168.1.1
#dns-nameservers 1.1.1.1 1.0.0.1
wireless-power off
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf



journalctl -u ifplugd.service

Code: Select all

jun 21 11:09:59 DietPi systemd[1]: Starting LSB: Brings up/down network automatically...
jun 21 11:09:59 DietPi ifplugd(eth0)[439]: ifplugd 0.28 initializing.
jun 21 11:09:59 DietPi ifplugd(eth0)[439]: Using interface eth0/DC:A6:32:A9:4B:8D with driver <bcmgenet> (version: v2.0)
jun 21 11:09:59 DietPi ifplugd(eth0)[439]: Using detection mode: SIOCETHTOOL
jun 21 11:09:59 DietPi ifplugd(eth0)[439]: Initialization complete, link beat not detected.
jun 21 11:09:59 DietPi ifplugd[423]: Network Interface Plugging Daemon...start eth0...done.
jun 21 11:09:59 DietPi systemd[1]: Started LSB: Brings up/down network automatically.
jun 21 11:10:04 DietPi ifplugd(eth0)[439]: Link beat detected.
jun 21 11:10:04 DietPi ifplugd(eth0)[439]: Executing '/etc/ifplugd/ifplugd.action eth0 up'.
jun 21 11:10:04 DietPi ifplugd(eth0)[439]: client: bring down WiFi
jun 21 11:10:04 DietPi ifplugd(eth0)[439]: client: ifdown: waiting for lock on /run/network/ifstate.wlan0
jun 21 11:10:13 DietPi dhclient[556]: Killed old client process
jun 21 11:10:13 DietPi ifplugd(eth0)[439]: client: Killed old client process
jun 21 11:10:14 DietPi dhclient[556]: Internet Systems Consortium DHCP Client 4.4.1
jun 21 11:10:14 DietPi ifplugd(eth0)[439]: client: Internet Systems Consortium DHCP Client 4.4.1
jun 21 11:10:14 DietPi dhclient[556]: Copyright 2004-2018 Internet Systems Consortium.
jun 21 11:10:14 DietPi ifplugd(eth0)[439]: client: Copyright 2004-2018 Internet Systems Consortium.
jun 21 11:10:14 DietPi dhclient[556]: All rights reserved.
jun 21 11:10:14 DietPi ifplugd(eth0)[439]: client: All rights reserved.
jun 21 11:10:14 DietPi dhclient[556]: For info, please visit https://www.isc.org/software/dhcp/
jun 21 11:10:14 DietPi ifplugd(eth0)[439]: client: For info, please visit https://www.isc.org/software/dhcp/
jun 21 11:10:14 DietPi dhclient[556]: 
jun 21 11:10:14 DietPi dhclient[556]: Listening on LPF/wlan0/dc:a6:32:a9:4b:8e
jun 21 11:10:14 DietPi ifplugd(eth0)[439]: client: Listening on LPF/wlan0/dc:a6:32:a9:4b:8e
jun 21 11:10:14 DietPi dhclient[556]: Sending on   LPF/wlan0/dc:a6:32:a9:4b:8e
jun 21 11:10:14 DietPi ifplugd(eth0)[439]: client: Sending on   LPF/wlan0/dc:a6:32:a9:4b:8e
jun 21 11:10:14 DietPi dhclient[556]: Sending on   Socket/fallback
jun 21 11:10:14 DietPi ifplugd(eth0)[439]: client: Sending on   Socket/fallback
jun 21 11:10:14 DietPi dhclient[556]: DHCPRELEASE of 192.168.1.130 on wlan0 to 192.168.1.1 port 67
jun 21 11:10:14 DietPi ifplugd(eth0)[439]: client: DHCPRELEASE of 192.168.1.130 on wlan0 to 192.168.1.1 port 67
jun 21 11:10:14 DietPi dhclient[556]: send_packet: Network is unreachable
jun 21 11:10:14 DietPi ifplugd(eth0)[439]: client: send_packet: Network is unreachable
jun 21 11:10:14 DietPi dhclient[556]: send_packet: please consult README file regarding broadcast address.
jun 21 11:10:14 DietPi ifplugd(eth0)[439]: client: send_packet: please consult README file regarding broadcast address.
jun 21 11:10:14 DietPi dhclient[556]: dhclient.c:2878: Failed to send 300 byte long packet over fallback interface.
jun 21 11:10:14 DietPi ifplugd(eth0)[439]: client: dhclient.c:2878: Failed to send 300 byte long packet over fallback interface.
jun 21 11:10:15 DietPi ifplugd(eth0)[439]: Program executed successfully.
jun 21 11:12:13 DietPi ifplugd(eth0)[439]: Link beat lost.
jun 21 11:12:18 DietPi ifplugd(eth0)[439]: Executing '/etc/ifplugd/ifplugd.action eth0 down'.
jun 21 11:12:18 DietPi ifplugd(eth0)[439]: client: bring up WiFi
jun 21 11:12:18 DietPi wpa_supplicant[918]: Successfully initialized wpa_supplicant
jun 21 11:12:19 DietPi dhclient[926]: Internet Systems Consortium DHCP Client 4.4.1
jun 21 11:12:19 DietPi dhclient[926]: Copyright 2004-2018 Internet Systems Consortium.
jun 21 11:12:19 DietPi dhclient[926]: All rights reserved.
jun 21 11:12:19 DietPi dhclient[926]: For info, please visit https://www.isc.org/software/dhcp/
jun 21 11:12:19 DietPi dhclient[926]: 
jun 21 11:12:19 DietPi ifplugd(eth0)[439]: client: Internet Systems Consortium DHCP Client 4.4.1
jun 21 11:12:19 DietPi ifplugd(eth0)[439]: client: Copyright 2004-2018 Internet Systems Consortium.
jun 21 11:12:19 DietPi ifplugd(eth0)[439]: client: All rights reserved.
jun 21 11:12:19 DietPi ifplugd(eth0)[439]: client: For info, please visit https://www.isc.org/software/dhcp/
jun 21 11:12:19 DietPi dhclient[926]: Listening on LPF/wlan0/dc:a6:32:a9:4b:8e
jun 21 11:12:19 DietPi dhclient[926]: Sending on   LPF/wlan0/dc:a6:32:a9:4b:8e
jun 21 11:12:19 DietPi dhclient[926]: Sending on   Socket/fallback
jun 21 11:12:19 DietPi dhclient[926]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
jun 21 11:12:19 DietPi ifplugd(eth0)[439]: client: Listening on LPF/wlan0/dc:a6:32:a9:4b:8e
jun 21 11:12:19 DietPi ifplugd(eth0)[439]: client: Sending on   LPF/wlan0/dc:a6:32:a9:4b:8e
jun 21 11:12:19 DietPi ifplugd(eth0)[439]: client: Sending on   Socket/fallback
jun 21 11:12:19 DietPi ifplugd(eth0)[439]: client: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
jun 21 11:12:21 DietPi wpa_supplicant[921]: wlan0: Trying to associate with SSID 'CasitaAP'
jun 21 11:12:22 DietPi dhclient[926]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
jun 21 11:12:22 DietPi ifplugd(eth0)[439]: client: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
jun 21 11:12:24 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 11:12:26 DietPi dhclient[926]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
jun 21 11:12:26 DietPi ifplugd(eth0)[439]: client: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
jun 21 11:12:27 DietPi wpa_supplicant[921]: wlan0: Trying to associate with SSID 'CasitaAP'
jun 21 11:12:30 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 11:12:30 DietPi dhclient[926]: No DHCPOFFERS received.
jun 21 11:12:30 DietPi dhclient[926]: Trying recorded lease 192.168.1.107
jun 21 11:12:30 DietPi ifplugd(eth0)[439]: client: No DHCPOFFERS received.
jun 21 11:12:30 DietPi ifplugd(eth0)[439]: client: Trying recorded lease 192.168.1.107
jun 21 11:12:33 DietPi wpa_supplicant[921]: wlan0: Trying to associate with SSID 'Casita'
jun 21 11:12:33 DietPi ifplugd(eth0)[439]: client: PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
jun 21 11:12:33 DietPi ifplugd(eth0)[439]: client: --- 192.168.1.1 ping statistics ---
jun 21 11:12:33 DietPi ifplugd(eth0)[439]: client: 1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
jun 21 11:12:33 DietPi dhclient[926]: No working leases in persistent database - sleeping.
jun 21 11:12:33 DietPi ifplugd(eth0)[439]: client: No working leases in persistent database - sleeping.
jun 21 11:12:33 DietPi ifplugd(eth0)[439]: Program executed successfully.
jun 21 11:12:35 DietPi dhclient[926]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
jun 21 11:12:35 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 11:12:38 DietPi wpa_supplicant[921]: wlan0: Trying to associate with SSID 'Casita'
jun 21 11:12:41 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 11:12:42 DietPi dhclient[926]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
jun 21 11:12:44 DietPi wpa_supplicant[921]: wlan0: Trying to associate with SSID 'CasitaAP'
jun 21 11:12:46 DietPi dhclient[926]: No DHCPOFFERS received.
jun 21 11:12:46 DietPi dhclient[926]: Trying recorded lease 192.168.1.107
jun 21 11:12:47 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 11:12:49 DietPi dhclient[926]: No working leases in persistent database - sleeping.
jun 21 11:12:50 DietPi wpa_supplicant[921]: wlan0: Trying to associate with SSID 'CasitaAP'
jun 21 11:12:52 DietPi dhclient[926]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
jun 21 11:12:53 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 11:12:53 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="CasitaAP" auth_failures=1 duration=10 reason=CONN_FAILED
jun 21 11:12:57 DietPi dhclient[926]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
jun 21 11:13:01 DietPi wpa_supplicant[921]: wlan0: Trying to associate with SSID 'Casita'
jun 21 11:13:02 DietPi dhclient[926]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 1
jun 21 11:13:03 DietPi dhclient[926]: No DHCPOFFERS received.
jun 21 11:13:03 DietPi dhclient[926]: Trying recorded lease 192.168.1.107
jun 21 11:13:03 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 11:13:07 DietPi dhclient[926]: No working leases in persistent database - sleeping.
jun 21 11:13:07 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="CasitaAP"
jun 21 11:13:07 DietPi wpa_supplicant[921]: wlan0: Trying to associate with SSID 'Casita'
jun 21 11:13:10 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 11:13:10 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=1 ssid="Casita" auth_failures=1 duration=10 reason=CONN_FAILED
jun 21 11:13:10 DietPi dhclient[926]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
jun 21 11:13:17 DietPi wpa_supplicant[921]: wlan0: Trying to associate with SSID 'CasitaAP'
jun 21 11:13:18 DietPi dhclient[926]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
jun 21 11:13:20 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
jun 21 11:13:20 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="CasitaAP" auth_failures=2 duration=23 reason=CONN_FAILED
jun 21 11:13:21 DietPi dhclient[926]: No DHCPOFFERS received.
jun 21 11:13:21 DietPi dhclient[926]: Trying recorded lease 192.168.1.107
jun 21 11:13:24 DietPi dhclient[926]: No working leases in persistent database - sleeping.
jun 21 11:13:29 DietPi dhclient[926]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
jun 21 11:13:33 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-SSID-REENABLED id=1 ssid="Casita"
jun 21 11:13:33 DietPi wpa_supplicant[921]: wlan0: Failed to initiate sched scan
jun 21 11:13:37 DietPi dhclient[926]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
jun 21 11:13:40 DietPi dhclient[926]: No DHCPOFFERS received.
jun 21 11:13:40 DietPi dhclient[926]: Trying recorded lease 192.168.1.107
jun 21 11:13:40 DietPi ifplugd(eth0)[439]: Link beat detected.
jun 21 11:13:40 DietPi ifplugd(eth0)[439]: Executing '/etc/ifplugd/ifplugd.action eth0 up'.
jun 21 11:13:40 DietPi ifplugd(eth0)[439]: client: bring down WiFi
jun 21 11:13:40 DietPi dhclient[1125]: Killed old client process
jun 21 11:13:40 DietPi ifplugd(eth0)[439]: client: Killed old client process
jun 21 11:13:40 DietPi wpa_supplicant[921]: wlan0: Failed to initiate sched scan
jun 21 11:13:41 DietPi dhclient[1125]: Internet Systems Consortium DHCP Client 4.4.1
jun 21 11:13:41 DietPi dhclient[1125]: Copyright 2004-2018 Internet Systems Consortium.
jun 21 11:13:41 DietPi dhclient[1125]: All rights reserved.
jun 21 11:13:41 DietPi dhclient[1125]: For info, please visit https://www.isc.org/software/dhcp/
jun 21 11:13:41 DietPi dhclient[1125]: 
jun 21 11:13:41 DietPi ifplugd(eth0)[439]: client: Internet Systems Consortium DHCP Client 4.4.1
jun 21 11:13:41 DietPi ifplugd(eth0)[439]: client: Copyright 2004-2018 Internet Systems Consortium.
jun 21 11:13:41 DietPi ifplugd(eth0)[439]: client: All rights reserved.
jun 21 11:13:41 DietPi ifplugd(eth0)[439]: client: For info, please visit https://www.isc.org/software/dhcp/
jun 21 11:13:41 DietPi dhclient[1125]: Listening on LPF/wlan0/dc:a6:32:a9:4b:8e
jun 21 11:13:41 DietPi dhclient[1125]: Sending on   LPF/wlan0/dc:a6:32:a9:4b:8e
jun 21 11:13:41 DietPi dhclient[1125]: Sending on   Socket/fallback
jun 21 11:13:41 DietPi ifplugd(eth0)[439]: client: Listening on LPF/wlan0/dc:a6:32:a9:4b:8e
jun 21 11:13:41 DietPi ifplugd(eth0)[439]: client: Sending on   LPF/wlan0/dc:a6:32:a9:4b:8e
jun 21 11:13:41 DietPi ifplugd(eth0)[439]: client: Sending on   Socket/fallback
jun 21 11:13:41 DietPi dhclient[1125]: DHCPRELEASE of 192.168.1.130 on wlan0 to 192.168.1.1 port 67
jun 21 11:13:41 DietPi ifplugd(eth0)[439]: client: DHCPRELEASE of 192.168.1.130 on wlan0 to 192.168.1.1 port 67
jun 21 11:13:42 DietPi wpa_supplicant[921]: nl80211: Failed to open /proc/sys/net/ipv4/conf/p2p-dev-wlan0/drop_unicast_in_l2_multicast: No such file or directory
jun 21 11:13:42 DietPi wpa_supplicant[921]: nl80211: Failed to set IPv4 unicast in multicast filter
jun 21 11:13:42 DietPi wpa_supplicant[921]: nl80211: Failed to open /proc/sys/net/ipv4/conf/p2p-dev-wlan0/drop_unicast_in_l2_multicast: No such file or directory
jun 21 11:13:42 DietPi wpa_supplicant[921]: nl80211: Failed to set IPv4 unicast in multicast filter
jun 21 11:13:42 DietPi wpa_supplicant[921]: nl80211: deinit ifname=p2p-dev-wlan0 disabled_11b_rates=0
jun 21 11:13:42 DietPi wpa_supplicant[921]: p2p-dev-wlan0: CTRL-EVENT-TERMINATING
jun 21 11:13:42 DietPi wpa_supplicant[921]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
jun 21 11:13:42 DietPi wpa_supplicant[921]: wlan0: CTRL-EVENT-TERMINATING
jun 21 11:13:42 DietPi ifplugd(eth0)[439]: Program executed successfully.
User avatar
Joulinar
Posts: 2299
Joined: Sat Nov 16, 2019 12:49 am

Re: How to purge all network related config?

Post by Joulinar »

Hi,

looks like you constantly getting this issue

Code: Select all

wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
Something similar was described in this post
https://www.raspberrypi.org/forums/view ... p?t=198104

can you try using this one single AP (WiFi Network) as well as changing the WiFi Channel on your AP?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Akrai
Posts: 21
Joined: Fri Jun 19, 2020 9:43 am

Re: How to purge all network related config?

Post by Akrai »

its so weird, it didnt connect to any channel from 1 to 5, then 6 connected, and so with channel 6 i reconfigured static ip and still working so its like that post said, something only channel related, i just changed again to channel 1 and still error, so i dont know... im using country=ES in the wpa_supplicant.conf :?

edit: just reinstalled the eeprom firmware just in case, nothing

edit: okay so it all has to do with setting the correct reg domain, i dont know what is going on but i have seen that after a while it randomly appeared at the journalctl -u ifplugd.service two lines:
ctrl-event-regdom-change init=core type=world
CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=ES
and so i saw that and tried luck and yeah, it connected in the channel 1, and then i tested a reboot and again bad regdomain

so it seems something is overriding my wpa supplicant's set country...

in /etc/defaults/crda i have REGDOMAIN=ES

cat /sys/module/cfg80211/parameters/ieee80211_regdom
00

crda:
COUNTRY enviroment variable not set

export COUNTRY=ES; crda
Failed to set regulatory domain: -7

iw reg get:
global
country ES: DFS-ETSI
[...]
User avatar
Joulinar
Posts: 2299
Joined: Sat Nov 16, 2019 12:49 am

Re: How to purge all network related config?

Post by Joulinar »

can you have a look to dietpi-config and check on network settings which country code is set?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Akrai
Posts: 21
Joined: Fri Jun 19, 2020 9:43 am

Re: How to purge all network related config?

Post by Akrai »

Joulinar wrote: Sun Jun 21, 2020 7:40 pm can you have a look to dietpi-config and check on network settings which country code is set?
it was in ES, but i have started using dietpi-config again and:
i deleted the old ssids that were set in there, and set the 2.4ghz one that i was using changing the channels from 1 to 6, and it worked, it connected in channel 1. But i tried using the same, only 1 ssid, but the 5ghz one, and it doesnt connect, what could be happening? its the last issue to be fixed

using dietpi-config, it doesnt write country=es in the wpa_supplicant.config, but i tested writing it and it still doesnt connect

edit: what does the auto reconnect option do exactly?
User avatar
Joulinar
Posts: 2299
Joined: Sat Nov 16, 2019 12:49 am

Re: How to purge all network related config?

Post by Joulinar »

auto reconnect option will try to connect you back to WiFi once the WiFi connection get lost (disconnect from WiFi).
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Akrai
Posts: 21
Joined: Fri Jun 19, 2020 9:43 am

Re: How to purge all network related config?

Post by Akrai »

Joulinar wrote: Sun Jun 21, 2020 8:46 pm auto reconnect option will try to connect you back to WiFi once the WiFi connection get lost (disconnect from WiFi).
okay but that is the default behaviour of wpa_supplicant right? enabling that option would be the same as the default behaviour?
i have it disabled right now and it tries to connect (failing) continuously
User avatar
MichaIng
Site Admin
Posts: 2333
Joined: Sat Nov 18, 2017 6:21 pm

Re: How to purge all network related config?

Post by MichaIng »

Nope, wpasupplicant has not internal auto-reconnection feature (that I am aware of). The one in dietpi-config starts dietpi-wifi-monitor.service which does that by checking connection state every 10 seconds. However just to be clear it is very simple and does not know about ifplugd or other intentions, hence is not compatible with the ifplugd-based auto-switch on Ethernet connection. It will try to reconnect WiFi until you either stop the service (or dietpi-config option) or physically unplug the adapter ;).
Post Reply