two default routes on pi zero W

84 views
Skip to first unread message

dave r

unread,
Aug 2, 2018, 7:21:58 AM8/2/18
to ClusterHAT
Hi Chris, wondering if you might be able to help...

cluster hat:  v2.3
controller:  RPi B 3+
clients: all four are Pi Zero W v1.1
software: 2018-06-27-controller (not the NAT version)

I use a wpa_supplicant.conf on the Pi Zero W.

When I boot a Pi Zero W, it ends up with two default routes:

pi@p1:~ $ route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

default         172.19.181.254  0.0.0.0         UG    202    0        0 usb0

default         10.0.1.1        0.0.0.0         UG    303    0        0 wlan0

10.0.1.0        0.0.0.0         255.255.255.0   U     303    0        0 wlan0

172.19.181.0    0.0.0.0         255.255.255.0   U     202    0        0 usb0


If I delete the default route via 172.19.181.254/usb0, then I can reach the internet ok.
But after reboot this route re-appears and I'm no longer able to reach internet.

I think my question is...
How do I stop the default route from being re-instated during reboots?

Thanks again.
Dave.

Chris Burton

unread,
Aug 2, 2018, 12:23:44 PM8/2/18
to ClusterHAT
Hi, 
I think my question is...
How do I stop the default route from being re-instated during reboots?

Probably a better thing to do is to keep the two default routes but give the default route on wlan0 a higher priority (lower metric).

To do that put this in your /etc/dhcpcd.conf file and restart the Pi Zero(s) it should then prefer to send traffic out over wlan0 and fallback to usb0 if wlan0 isn't up.

interface wlan0
metric
100

Chris.

dave r

unread,
Aug 3, 2018, 3:23:15 AM8/3/18
to ClusterHAT
That worked.  Thank you Chris.
Reply all
Reply to author
Forward
0 new messages