I had a different, much longer question but I finally stumbled onto a fix to my problem. Now I just need to know how to make it persist between reboots. My Raspberry Pi is connected by WiFi to our main router that goes to the internet. I have a second router that it’s connected to by Ethernet. The second router is NOT connected to the internet. It has a hard drive attached to it that I want the Pi to have access to.
Both devices are configured for DHCP.
This is my default routing table when I boot up:
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default NNNN 0.0.0.0 UG 202 0 0 eth0 default 192.168.1.254 0.0.0.0 UG 303 0 0 wlan0 10.95.153.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0
As you might expect (I didn’t, because networking isn’t my thing), that didn’t work too well. Some traffic was trying to get out to the internet by way of eth0 and was hitting a brick wall.
I tried a bunch of stuff until I finally stumbled on the notion of just deleting that first route (default NNNN 0.0.0.0). And sure enough, everything started working perfectly. Only problem is, I reboot and I get the same default routing table.
How do I get the routing table I want at bootup?