This could be considered a continuation of this earlier SO question.
Ideally, I\'d like to jail a process into only using a certain interface, no matter what. It will be
After a hard-fought weekend, I'm pleased to present a solution that addresses most of what I've previously discussed with almost zero hassle.
There is a sysctl called net.ipv4.conf.all.rp_filter that can be set to 0 to disable source validation:
rp_filter - INTEGER 2 - do source validation by reversed path, as specified in RFC1812 Recommended option for single homed hosts and stub network routers. Could cause troubles for complicated (not loop free) networks running a slow unreliable protocol (sort of RIP), or using static routes. 1 - (DEFAULT) Weaker form of RP filtering: drop all the packets that look as sourced at a directly connected interface, but were input from another interface. 0 - No source validation.
This can also be set on a per interface basis using /proc/sys/net/ipv4/conf/
/rp_filter.
As one poster explained it, it makes IP routing "less deterministic" in the sense that packets coming from one subnet aren't guaranteed to always go out the same interface. In this instance, this is exactly what it is needed. Please do additional research to determine if this is really what you want.
Broadcasts are still problematic for reasons I do not understand, but I am finally satisfied with this issue and I hope it helps others.