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 have two network interfaces with respective ips

 eth0 :
 eth2 :

when I make

 route -C
 Kernel IP routing cache
 Source          Destination     Gateway         Flags Metric Ref    Use Iface        0      0        0 eth0

how I can force a telnet conection to over eth2?

share|improve this question
I can trust the good will of the people – JuanPablo Sep 29 '11 at 0:15
^ Most dangerous words i have heard all day... – Silverfire Sep 29 '11 at 0:17
Accepting answers on your previous questions is giving back to the community. It gives a small reward to those that help you and it costs you nothing. It also helps future visitors by showing them what answer solved your problem. If you won't do this, why would anyone want to help you? – MDMarra Sep 29 '11 at 0:19
ok, now understand how work the rate. – JuanPablo Sep 29 '11 at 0:28
@GregD give me a tip – JuanPablo Sep 29 '11 at 0:33
up vote 1 down vote accepted

You would have to add a specific route for the host

route add -host dev eth2

This would push all traffic destined for over eth2. Would that be enough, or would you require only telnet to be routed?

share|improve this answer

What you want is the Linux Advanced Routing and Traffic Control HOWTO. Specifically, the section on Netfilter & iproute - marking packets is a good place to start for this sort of thing.

You'd set up your default route to go over eth0, then in /etc/iproute2/rt_tables add an entry, say at 200, for "viaeth2". Then you need to set up routing in that table:

ip route add dev eth2 src table viaeth2
ip rule add fwmark 1 table viaeth2

Then you can mark packets via iptables that should be routed via that table:

iptables -A PREROUTING -d -t mangle -p tcp --dport 23 \
    -j MARK --set-mark 1

This will do what you specifically asked in the original question. If you want to do more general load-balancing across the two interfaces, you want to do "bonding" via the "bond" driver.

share|improve this answer
Given the lack of tags or any mention of Linux in his question, are you sure your answer applies to his question? – Zoredache Sep 29 '11 at 1:40
Probably the ethX part – jdw Sep 29 '11 at 1:45
Fair enough, JuanPablo please clarify if this is not on Linux. – Sean Reifschneider Sep 29 '11 at 17:41

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.