Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

/etc/iptables.rules
-A PREROUTING -i eth0 -p tcp -m tcp --dport 8000 -j DNAT --to-destination 10.101.0.20:3389
-A PREROUTING -i eth1 -p tcp -m tcp --dport 3389 -j DNAT --to-destination 10.101.0.79:3389
-A POSTROUTING -o eth0 -j SNAT --to-source 63.22.130.186
-A POSTROUTING -o eth1 -j SNAT --to-source 63.22.130.187


/etc/network/interfaces
# eth0
auto eth0
allow-hotplug eth0
iface eth0 inet static
      address 63.22.130.186
      netmask 255.255.255.248
      gateway 63.22.130.185
      dns-nameservers 8.8.8.8
      pre-up iptables-restore < /etc/iptables.rules

# eth1
auto eth1
allow-hotplug eth1
iface eth1 inet static
      address 63.22.130.187
      netmask 255.255.255.248
      dns-nameservers 8.8.8.8

# eth2
auto eth2
allow-hotplug eth2
iface eth2 inet static
      address 10.101.0.1
      netmask 255.255.0.0
      dns-nameservers 8.8.8.8
share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.