I'm trying to configure a host in a way that the traffic is routed either via eth0 or vlan123@eth0, depending on the source address used. Both interfaces have access to the whole network and both have some ip assigned.

For example: eth0 has and vlan123 has The default gateway is set via eth0. How can I make sure that if:

  • packet comes in to (will arrive untagged), the response will be sent to eth0
  • packet comes in to (will arrive 802.1q tagged), the response will be sent to vlan123

Is it possible without additional routing protocols? (for example forcing via iptables)


Look for information on "policy routing". The particular use case you're looking at is covered in the Advanced Routing and Traffic Control HOWTO, as well as elsewhere.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.