Scenario
- wlan0 is configured to connect to an internet-connected router and getgets an IP via DHCP
- eth0 is set to a static IP (via /etc/dhcpcd.conf, different net than wlan0) and connected to a net with no router, gateway or DHCP server.
Goal
I want to talk to devices connected to eth0 while maintaining internet connectivity through wlan0.
Problem
As soon as a cable is connected, the internet connection goes away. The default route is always set to the non-existent gateway of eth0. Manually setting the default route to the gateway of wlan0 works, but I don't want to hardcode this, as wlan0 is connected to different networks with different IPs.