Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid eth0 ip addr and wlan0 ip addr on same subnet #8

Open
rudiratlos opened this issue Jul 21, 2018 · 0 comments
Open

avoid eth0 ip addr and wlan0 ip addr on same subnet #8

rudiratlos opened this issue Jul 21, 2018 · 0 comments

Comments

@rudiratlos
Copy link

/lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant:

if [ -z "$wpa_supplicant_conf" ]; then
for x in
/etc/wpa_supplicant/wpa_supplicant-"$interface".conf
/etc/wpa_supplicant/wpa_supplicant.conf
/etc/wpa_supplicant-"$interface".conf
/etc/wpa_supplicant.conf
; do
if [ -s "$x" ]; then
wpa_supplicant_conf="$x"
break
fi
done
fi
: ${wpa_supplicant_conf:=/etc/wpa_supplicant.conf}

if [ "$ifwireless" = "1" ] &&
type wpa_supplicant >/dev/null 2>&1 &&
type wpa_cli >/dev/null 2>&1
then
if [ "$reason" = "IPV4LL" ]; then
date >> /var/log/wpa_supplicant.log
wpa_supplicant -B -iwlan0 -f/var/log/wpa_supplicant.log -c/etc/wpa_supplicant/wpa_supplicant.conf
fi
if [ "$reason" = "BOUND" ] && [ "$interface" = "wlan0" ]; then
date >>/var/log/wpa_supplicant.log
wlan0_ip=ip addr show dev wlan0 | awk '/inet / { print $2 }'
wlan0_subn=ip addr show dev wlan0 | awk '/inet / { print $4 }'
eth0_subn=ip addr show dev eth0 | awk '/inet / { print $4 }'
echo BOUND interface:$interface if_up:$if_up $wlan0_ip >>/var/log/wpa_supplicant.log

if [ "$eth0_subn" = "$wlan0_subn" ]; then
  echo "eth0 wlan0 on same subnet $wlan0_subn, flush ip from wlan0" >>/var/log/wpa_supplicant.log
  ip addr flush dev wlan0 >>/var/log/wpa_supplicant.log 2>&1
fi

fi
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant