On a Raspberry Pi 3 B+, I configured Raspbian Stretch Lite default OS image to connect to WiFi with a wpa_supplicant.conf file in the boot partitiion that looks like this:
country=CA
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="<ssid>"
scan_ssid=1
psk="<password>"
key_mgmt=WPA-PSK
}
The and variables are properly set for the WiFi network. I powered up the Pi3B+ and found out that it couldn't connect to the WiFi because the WiFi AP is using MAC Address filtering. So I connected it via Ethernet and, after much work with IT to figure out what IP address it got with DHCP, I was able to successfully ssh into it.
ifconfig shows a DHCP address for eth0 as expected but it also shows a DHCP address for wlan0 which is from the DHCP pool for Ethernet and not from the DHCP pool for WiFi. I can ssh connect with either IP address over Ethernet. If I disconnect the Ethernet cable, I cannot ssh to either IP address (because it is not really connected to WiFi). Here's the ifconfig output:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.11.131 netmask 255.255.254.0 broadcast 172.16.11.255
inet6 fe80::88c:4142:a1a7:f48a prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:d9:c9:a6 txqueuelen 1000 (Ethernet)
RX packets 131775 bytes 117065784 (111.6 MiB)
RX errors 0 dropped 45 overruns 0 frame 0
TX packets 43060 bytes 3305475 (3.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1 bytes 108 (108.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1 bytes 108 (108.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.11.130 netmask 255.255.254.0 broadcast 172.16.11.255
inet6 fe80::7b09:8c7c:f552:f27e prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:8c:9c:f3 txqueuelen 1000 (Ethernet)
RX packets 13851 bytes 1873372 (1.7 MiB)
RX errors 0 dropped 11 overruns 0 frame 0
TX packets 126 bytes 17329 (16.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
What would cause Raspian Stretch Lite to get an IP address for both eth0 and wlan0 when the WiFi is clearly not connected?