Linux policy based routing

Linux policy routing allows you to use different routing rules based on various criteria. In this example, I mark all packets coming in on a specific network interface and route outbound packets that are part of the same connection accordingly.