Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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 am having problems redirecting incoming traffic to 2 external facing interfaces on my Ubuntu 12.10 server to 2 separate internal hosts. I am able to redirect incoming traffic on my eth0 just fine to the internal host but the incoming traffic to my eth1 interface never goes anywhere.

Any suggestions?

Here are the iptables and interfaces settings I am using.

-A PREROUTING -i eth0 -p tcp -m tcp --dport 8000 -j DNAT --to-destination
-A PREROUTING -i eth1 -p tcp -m tcp --dport 3389 -j DNAT --to-destination
-A POSTROUTING -o eth0 -j SNAT --to-source
-A POSTROUTING -o eth1 -j SNAT --to-source

# eth0
auto eth0
allow-hotplug eth0
iface eth0 inet static
      pre-up iptables-restore < /etc/iptables.rules

# eth1
auto eth1
allow-hotplug eth1
iface eth1 inet static

# eth2
auto eth2
allow-hotplug eth2
iface eth2 inet static
share|improve this question

It sounds like its a routing problem.

The returning traffic uses the default outgoing interface among the two interfaces you have on your external machine.

And its apparently not the same interface as the traffic used for the incoming traffic. You can verify if this is the case by running tcpdump -v -i ethX on your machine for each of the interfaces. Where X is the interface number

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.