1

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?

2
  • How is MAC address filtering implemented? What type of AP is it? Does wifi connect but fails to send traffic? That could mean that the MAC filtering is happening after association and DHCP lease, but just refuses to pass/accept IP traffic thereafter based on your layer-2 address.
    – stevieb
    Commented Aug 24, 2018 at 15:39
  • I got IT dept to check DHCP logs and you seem to have figured it out--the AP is allowing certain traffic through such as DHCP but blocking other traffic using MAC filtering. The DHCP server is assigning an IP address to both of my interfaces. Compose this info as an answer and I'll mark it as correct.
    – BartmanEH
    Commented Aug 24, 2018 at 16:37

1 Answer 1

1

If your wireless network interface is receiving DHCP information (ie. IP address etc), it is most likely that the APs MAC restriction happens after you receive the DHCP lease handoff.

So, your interface associates with the wifi, receives its IP information via DHCP, and the MAC-based filtering occurs after that, when actually trying to transmit/receive data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.