I'm currently dealing with a VPN which connection endpoint lies within the subnet which prefix shall be tunneled via that specific VPN.
Essentially the problem thus boils down to match against a (larger) set of destination addresses (/16 mask), except for a wholly contained (small) subset of specific destinations that shall not routed that way (and instead go via the default route).
If the problem was about filtering, in Linux using this could be implemented using a ipset
set up like
ipset create MyVPN hash:net
ipset add MyVPN $MYVPNNET/$MYVPNMASK
ipset add MyVPN $MYVPNENDPOINT nomatch
However such ipsets can only be used inside netfilter.
Now my question is, how I could set up something equivalent using Linux Advanced IP Routing, i.e. the ip route
family of commands?