Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)

share|improve this question
up vote 4 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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