I have a pretty simple standard routing table on my linux box:
default via 192.168.1.1 dev eth0 proto static
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.162 metric 1
Now I need to route a specific subnet to another gateway. No problem yet, just add
10.0.0.0/8 via 192.168.1.2 dev eth0
However, there's a subset of that which should NOT go there. This works:
10.0.2.0/24 via 192.168.1.1 dev eth0
But I'd rather not have to repeat the default gateway in there; I'd like to be able to just say, "for 10.0.2.0/24, do what you'd do if there was no 10.0.0.0/8 route defined"
Any way of doing this? (Other than replacing the 10.0.0.0/8 with a bunch of more specific routes to carefully avoid the 10.0.2/24 one)