On 13 December 2017 at 10:56, Mark Rogers mark@more-solutions.co.uk wrote:
However, Googling that suggests that "sudo ifconfig eth0 down" is a better alternative and that does seem to work better (subject to a bit more testing!)
OK...
Focussing on wlan0 as that's what I'm most interested in.
I did have wireless configuration in wpa_supplicant.conf (and therefore had an IP address on wlan0) which I have removed.
$ sudo wpa_cli reconfigure $ ifconfig [...] wlan0: [...] inet 192.168.1.32 netmask 255.255.255.0 broadcast 192.168.1.255 [...]
$iwconfig wlan0 IEEE 802.11 ESSID:off/any Mode:Managed Access Point: Not-Associated Retry short limit:7 RTS thr:off Fragment thr:off Power Management:on $sudo ifconfig wlan0 down && sudo ifconfig wlan0 up $ifconfig [...] wlan0: [...] inet 192.168.1.32 netmask 255.255.255.0 broadcast 192.168.1.255 [...]
In other words the Pi insists on retaining that IP even though the wifi connection is down. (I can't ping .32 from outside the Pi, and assuming eth0 is down I can't ping anything from the Pi either.)
Frustratingly, if eth0 and wlan0 are both up (with wlan0 in this non-connected-but-has-ip state) then I cannot use eth0 - it looks like wlan0 is taking precedence for routing even though it's not working.