[Raspberry2] WLAN continuously connected,ifplugd not working

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
RaspMyzer
Posts: 8
Joined: Sun Feb 12, 2017 10:15 pm

[Raspberry2] WLAN continuously connected,ifplugd not working

Post by RaspMyzer »

Hi all and thanks for DietPi, it's awesome for its lightness and customization, and sorry for my horrible english :D !
Before opening a request, i try to find a workaround to my "problem" although usually wlan problems are of different kinds.
Usually i keep rasp connected to router with ethernet cable without monitor and mouse/keypad, but sometimes i move it under TV, keeping it connect with a WiFi dongle.
I would disconnect wlan when eth is connected, enabling it only when cable is unplugged.
With another distro i was able to do this "switch".
With DietPi-Config , enabling and connecting wifi, every info is set up in /etc/network/interfaces like this

Code: Select all

# Wifi
allow-hotplug wlan0
iface wlan0 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
wireless-essid XXXXXXXXXX
wireless-key YYYYYYYYYY
wireless-mode Managed
wireless-power off
wpa-ssid XXXXXXXXXX
wpa-psk YYYYYYYYYY
#dns-nameservers 8.8.8.8 8.8.4.4

I modified /etc/network/interfaces :

Code: Select all

# Ethernet
#allow-hotplug eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8 8.8.4.4

# Wifi
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
added manually in /etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

network={
ssid="XXXXXXXXXX"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="YYYYYYYYYY"
id_str="casa"
} 
But wlan still connect at the same time of the eth.

Tried ifplugd editing etc/ifplugd/action.d/ifupdown like this, but wifi continues to connect

Code: Select all

#!/bin/sh
set -e
 
case "$2" in
up)
  /sbin/ifup $1
  if [ "$1" == eth0 ]; then /sbin/ifdown wlan0 ; fi # This is a new bit
  ;;
down)
  /sbin/ifdown $1
  if [ "$1" == eth0 ]; then /sbin/ifup wlan0 ; fi # Another new bit
  ;;
esac 
It's really unavoidable the #Please use DietPi-Config to modify network settings. alert in interfaces files? :D
It is not really possible keep enabled wifi without avoid it ever connects ?
The alternative is to disable and enable manually every time: could be a convenient option to get it done automatically?
Thanks to everyone !
Post Reply