Page 1 of 1

2 IP addresses when wifi is configured

Posted: Fri Sep 01, 2017 7:01 pm
by cscuilla
I'm using Stretch lite. I connect to my wifi by editing /etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

network={
        ssid="MySSID"
        psk="MySSIDpassword"
}
Now, when using dhcp, If I boot the pi with an ethernet cable plugged in, I get two different IP addresses. I can connect via putty using either address. Both ips show under ifconfig

If I set a static IP from /etc/dhcpcd.conf, then I reboot the pi, I only get the one IP address. (the static one I set.) If I unplug the ethernet cable, the IP address instantly transfers to the wlan and the connection is not lost. The IP shows for the ethernet port on ifconfig if it's plugged in, and if it's not plugged in, the IP shows for the wireless adapter.

Is their a way for dhcp to act this same way? So that the IP is given to ethernet but if that is unplugged, the same IP is transferred to wireless?

Re: 2 IP addresses when wifi is configured

Posted: Fri Sep 01, 2017 8:10 pm
by DougieLawson
You need to change it to include

Code: Select all

country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
ahead of your network={...} block. Set the right ISO two character country code.