I have a small usb-over-ethernet network of RPiZs connected to a single RPi4. I am accessing the zeros through an ethernet connection on the RPi4, so they need to send packets going to my laptop through the RPi4.
I created a hook at
/lib/dhcpcd/dhcpcd-hooks/40-route which is run by
It looks like this
# /lib/dhcpcd/dhcpcd-hooks/40-route ip route replace 10.0/16 dev usb0 ip route replace 169.254/16 dev usb0 via 10.0.11.1 metric 101
If I run
sudo sh /lib/dhcpcd/dhcpcd-run-hooks, it makes the appropriate changes to my ip table.
However, I have to run it manually after every start up. Is there a way to get the hooks to run automatically? Or am I going about this completely wrong.
I feel this is on-topic for RPi SE because there is no other distribution that uses
dhcpcd as its default network manager.