[LARTC] Load balancing on multiple NICs with iproute

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All -

I have what I think is a very simple problem but the solution has eluded me.
I have three Token Ring interfaces in one box and I want to load balance
outgoing traffic across the NICs. The system is a RH 6.2 base with 2.2.18
kernel and current RH errata. Based on the Adv-Routing HOWTO I have the
proper stuff configured into the kernel already.

I'm using DNS to do cheap and easy round robin style connections to the box. 

  [scottrus@xxxxx scottrus]$ host ftp3.linux.ibm.com
  ftp3.linux.ibm.com has address 9.37.145.124
  ftp3.linux.ibm.com has address 9.37.145.120
  ftp3.linux.ibm.com has address 9.37.145.127

  ip address show
  1: lo: <LOOPBACK,UP> mtu 3924 qdisc noqueue 
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
  2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
      link/ether 00:60:94:3f:15:63 brd ff:ff:ff:ff:ff:ff
      inet 10.200.1.33/24 brd 10.200.1.255 scope global eth0
  3: tr0: <BROADCAST,MULTICAST,UP> mtu 2000 qdisc pfifo_fast qlen 100
      link/tr 00:20:35:ff:09:66 brd ff:ff:ff:ff:ff:ff
      inet 9.37.145.124/20 brd 9.37.159.255 scope global tr0
  4: tr1: <BROADCAST,MULTICAST,UP> mtu 2000 qdisc pfifo_fast qlen 100
      link/tr 00:60:94:b2:19:dd brd ff:ff:ff:ff:ff:ff
      inet 9.37.145.120/20 brd 9.37.159.255 scope global tr1
  5: tr2: <BROADCAST,MULTICAST,UP> mtu 2000 qdisc pfifo_fast qlen 100
      link/tr 00:60:94:b2:19:6d brd ff:ff:ff:ff:ff:ff
      inet 9.37.145.127/20 brd 9.37.159.255 scope global tr2

All trX interfaces are on the same subnet and use the same default gateway
of 9.37.144.1. The eth0 interface is a private network. Traffic from the
public Token Ring network should never cross onto the private eth0 network
or visversa.

I'm looking for one of two possible solutions:

1) Incoming requests are responded to on the same interface they came in on.
For example an ftp connection coming in on tr1 has all TX / RX packets stick
to tr1. 

2) All output packets are load balanced across the tr0, tr1, tr2
interfaces regardless of which tr interface they came in on. (This is my
preferred solution.)

What's currently happening is requests come in on tr0, tr1, tr2 but outgoing
traffic is being sent back only via tr0, the default route.

  [scottrus@xxxxx scottrus]$ ip route show
  10.200.1.33 dev eth0  scope link 
  9.37.145.120 dev tr1  scope link 
  9.37.145.127 dev tr2  scope link 
  9.37.145.124 dev tr0  scope link 
  10.200.1.0/24 dev eth0  proto kernel  scope link  src 10.200.1.33 
  9.37.144.0/20 dev tr0  proto kernel  scope link  src 9.37.145.124 
  9.37.144.0/20 dev tr1  proto kernel  scope link  src 9.37.145.120 
  9.37.144.0/20 dev tr2  proto kernel  scope link  src 9.37.145.127 
  10.200.0.0/16 via 10.200.1.1 dev eth0 
  127.0.0.0/8 dev lo  scope link 
  default via 9.37.144.1 dev tr2 
  default via 9.37.144.1 dev tr1 
  default via 9.37.144.1 dev tr0 

As you can see I've tried simply adding default routes for each token ring
interface and I think this is a step in the right direction but I'm missing
something.

*sigh* I thought I knew it all, how wrong I was. I have to say all this is
rather cool and beyond this initial problem I know I'm going to have play
with it more just for fun. The very thought of being able to twist these
packets into my own demented idea of how they should be handled is just to
tempting to ignore. Baby steps, must remember to take baby steps. 

1) Understand what the heck I've been reading all day.
2) Get the routes on ftp3 working so users stop yelling at me :)
3) Read more, play with iproute2, watch mailing list, help out. :) :)

Any help would be great. Examples would be better of course. Thanks much!

-- 
Regards,
 Scott Russell (scottrus@xxxxxxxxxxxxxxx)
 Linux Technology Center, System Admin, RHCE.




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux