Hassbian - how can i tell if im using wifi or ethernet

Hey all,
i setup wifi to begin with, which was working fine however I then decided to go with a hard line instead.
How can i tell “which” of them is being used. Obviously i would like to use the Ethernet but could the rpi4 be connecting over the wifi still?
or would it automatically connect to the Ethernet port first?

not sure if this helps?

pi@raspberrypi:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.86  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::282f:2e74:926c:c0ab  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:03:97:c2  txqueuelen 1000  (Ethernet)
        RX packets 4562  bytes 1592034 (1.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1070  bytes 221556 (216.3 KiB)
        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 3823  bytes 643553 (628.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3823  bytes 643553 (628.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.77  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::768d:2249:fa8a:6302  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:03:97:c3  txqueuelen 1000  (Ethernet)
        RX packets 87339  bytes 62488057 (59.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 43342  bytes 5844798 (5.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Based on your ifconfig, it is still connected to wifi.

Whichever one is actually being used is based on which IP you hit.

If you want to disable wifi entirely, you can add this entry to your /boot/config.txt
dtoverlay=pi3-disable-wifi

1 Like

Based on what you’ve posted, it’s got both connected, but is primarily using the WiFi. There is almost no traffic hitting the wired connection.

Thanks!
this worked a treat

is there a way to specify that eth0 is primary, but still keep wifi for fail over (however not sure if/why this would happen?!)

You should be able to set ‘weights’ on interfaces, but I don’t see it as beneficial for this purpose.