I've got a powered USB hub with an ethernet port connected to my Pi, but I'm only interested on the USB ports, as it already has on-board ethernet. However, for some reason, when the Pi boots, the hub's ethernet appears to take over and the on-board ethernet is disabled. Meaning its got no internet, because the cable is plugged in to the Pi, not the hub. Once I disconnect the hub, the lights on the on-board ethernet light up and it connects to the internet. If I then reconnect the hub, its interface shows up but the on-board remains default.
I've tried turning on predictable interface names in raspi-config
and disabling the interface in /etc/rc.local
to no avail. The network settings on the Pi are pretty much stock except for a static IP address for eth0
in /etc/dhcpcd.conf
.
How can I permanently disable the hub's network interface, and why would it seemingly override the on-board one?
ip -details link
(no hub)
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0 minmtu 0 maxmtu 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether dc:a6:32:e7:b9:07 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 1500 addrgenmode none numtxqueues 5 numrxqueues 5 gso_max_size 65536 gso_max_segs 65535
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DORMANT group default qlen 1000
link/ether dc:a6:32:e7:b9:08 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 1500 addrgenmode none numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
ip -details link
(with hub)
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0 minmtu 0 maxmtu 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether dc:a6:32:e7:b9:07 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 1500 addrgenmode none numtxqueues 5 numrxqueues 5 gso_max_size 65536 gso_max_segs 65535
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DORMANT group default qlen 1000
link/ether dc:a6:32:e7:b9:08 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 1500 addrgenmode none numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
4: enx2c16dba05ff7: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
link/ether 2c:16:db:a0:5f:f7 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 9194 addrgenmode none numtxqueues 1 numrxqueues 1 gso_max_size 16354 gso_max_segs 65535
Note that the on-board ethernet worked when these details were taken as the hub was plugged in after boot.
I've also tried adding denyinterfaces enx2c16dba05ff7
to /etc/dhcpcd.conf
as suggested by Ingo, but after rebooting I still have no internet until I unplug the hub.
ip -details link
for the hub interface after this change:
3: enx2c16dba05ff7: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 2c:16:db:a0:5f:f7 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 9194 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 16354 gso_max_segs 65535
/etc/rc.local
has limitations due to Compatibility with SysV. We have seen many problems here on this site using it. Following the recommendation of the developers from systemd you should avoid using it. Static ip addresses should only be used with some knowledge about networking./etc/rc.local
was addip link set $iface down
, where$iface
is the interface of the USB hub. I'm using a static NAT IP address so that it doesn't change with DHCP./etc/rc.local
can fail. Don't use it. Please execute the commandip -details link
, one time with connected, one time with disconnected hub. edit your question and add both outputs to it.