Server Fault is a question and answer site for system and network administrators. 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 have one server, with double NICs connected to one switch with the same gateway. Behind the switch we have internet.

|Debian| -> eth0 -> switch -> internet -> eth1 -> same

I don't understand how to load-balancing between eth0 and eth1. The inbound/outbound traffic always use eth1.

This is the config:

# The primary network interface
allow-hotplug eth0
auto eth0
iface eth0 inet static

allow-hotplug eth1
auto eth1
iface eth1 inet static

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface U 0 0 0 eth1 U 0 0 0 eth0 UG 0 0 0 eth1 UG 0 0 0 eth0

Ips aren't real, it's just for the example.

Anybody have an idea on correct routing to use eth0 on and eth1 on ? I have many example for multiple gateway but here it's the same.

Thanks all.


share|improve this question
Are you sure you don't want channel bonding (aka link aggregation, etherchannel) which allows you to combined multiple physical connections into a single link? – Zoredache Jan 11 '11 at 19:08
I tried it, but doesn't work in my environnement. My problem appears to be simple but i can't route it correctly :s – pouney Jan 11 '11 at 19:12
Why did bonding not work in your environment. Perhaps you should ask a question about that. – Zoredache Jan 11 '11 at 19:17
When i try bonding mode 0, i loss 50% of my packets. Mode 3 works fine but i think only one interface works, and mode 4/6 don't work at all (timeout). I don't own the network infrastructure (datacenter), so i prefer to route traffic by interface, it's more reliable. – pouney Jan 11 '11 at 19:21
You should give bonding another try. – SpacemanSpiff Jan 11 '11 at 20:05

The short answer is that you can't really do that. Things aren't designed to work that way.

Yes, Linux is pretty flexible so you could probably find some really obscure methods to achieve some of the behavior your want, but it would be much better to bond the two links.

share|improve this answer

To do what you want you may want to look at some of the documentation on multiple ISP connections. The concepts may be close enough to what you are trying to do. This Shorewall Multi-IPS documentation may give you an idea how to do it.

share|improve this answer
I think that it's easy to route traffic on eth0 when connection is opened on eth0, and eth1 when it's done on eth1. But if not, i'll retry bond 0 but it results as half packets loss. – pouney Jan 11 '11 at 21:04

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.