1

I am trying to connect my Raspberry Pi (Model B, Revision 2.0) to my router using a USB dongle. using raspi-config, it seems to work on the pi's side, ifconfig yields:

    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 10.100.102.188  netmask 255.255.255.0  broadcast 10.100.102.255
            inet6 fe80::c33b:ae6:8b40:dc28  prefixlen 64  scopeid 0x20<link>
            ether b8:27:eb:c2:e8:a4  txqueuelen 1000  (Ethernet)
            RX packets 158  bytes 19362 (18.9 KiB)
            RX errors 0  dropped 1  overruns 0  frame 0
            TX packets 133  bytes 20949 (20.4 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 10.100.102.221  netmask 255.255.255.0  broadcast 10.100.102.255
            inet6 fe80::a0e7:13f2:ba6e:cf2b  prefixlen 64  scopeid 0x20<link>
            ether 00:36:76:55:54:a2  txqueuelen 1000  (Ethernet)
            RX packets 214  bytes 39050 (38.1 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 45  bytes 5948 (5.8 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

but looking at my router, it seems that both IP address are related to the ethernet port:

    Hostname IP address                       MAC address        Type             Port
    pi-1     10.100.102.221 10.100.102.188    b8:27:eb:c2:e8:a4  Ethernet         3
    pi-1                                      00:36:76:55:54:a2  Wireless-2.4GHz 

this is really weird since both interfaces are on "green" status, but the wifi IP is assigned to the ethernet somehow.

if I disconnect the LAN cable, both address are gone and the pi becomes unreachable.

** I tested the USB on another Pi (Pi 2) and it works fine

update 1

it's rasibian

uname -a 
Linux pi-1 4.14.34+ #1110 Mon Apr 16 14:51:42 BST 2018 armv6l GNU/Linux

cat /etc/network/interfaces (haven't changed that)

    # interfaces(5) file used by ifup(8) and ifdown(8)

    # Please note that this file is written to be used with dhcpcd
    # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

    # Include files from /etc/network/interfaces.d:
    source-directory /etc/network/interfaces.d

lsb_release

    No LSB modules are available.
    Distributor ID: Raspbian
    Description:    Raspbian GNU/Linux 9.4 (stretch)
    Release:        9.4
    Codename:       stretch

update 2

this is getting even stranger, taking a closer look at my router connected devices, I see the pi is getting the IP on wifi, then the same IP address moves to the ethernet - confusing

0

I cannot answer for sure without actual investigation, but here's my guess:

  1. When the router, or some other host on the LAN, tries to reach 10.100.102.221 it sends out an ARP query for that address, asking for translation to the MAC address. (The query itself is broadcast, since of course the MAC address isn't known yet.)

  2. Your router's Ethernet and Wi-Fi are bridged into a single subnet, and one broadcast domain. So the same broadcast query reaches the Raspberry on all interfaces belonging to the network (both eth0 and wlan0).

  3. On Linux (and many other operating systems), IPv4 addresses are thought to belong to the host rather than the interface, so the Raspberry responds to all queries received – even if it's not the interface which holds the address.

  4. The router receives both ARP replies: one over Ethernet, claiming 10.100.102.221 is at b8:27:eb:c2:e8:a4, and one over Wi-Fi, claiming 10.100.102.221 is at 00:36:76:55:54:a2. Since Ethernet usually has lower latency than Wi-Fi, the first reply arrives faster and that's what the router stores in its ARP cache.

  5. The router's table seems to be built based on the contents of its ARP cache and bridge host cache, and since ARP replies for both IP addresses arrived faster via Ethernet, they're shown under the Ethernet port.

On Linux the behavior in point #3 could be changed via sysctl:

sysctl net.ipv4.conf.all.arp_ignore=1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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