Skip to contentSkip to conversation

Loadbalancing the gateway

LARTC Logu 3 participants 7 messages Oct 9, 2001 – Oct 17, 2001

lore
Share & tools
lore

Logu

author
#0 lore raw

Hi,
I have 3 isdn connections. Is it possible to loadbalace the bandwidth using a linux box in between the routers and the client. I will be very much greatful to you if someone helps me in this.

-Logu

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

#1 lore raw

You might try multi-path routing. It doesn't exactly load balance the lines, as in aggregating the bandwidth together, but it does allow N number of simultaneous connections (where N would be the maximum number of different routes you have).

In your scenario, let's say you have the 3 routers with IP addresses of 1.1.1.1/30, 2.2.2.2/30, and 3.3.3.3/30. Now, you have your Linux firewall/gateway/router/thingy between the routers and the client. On your Linux box, you could have 3 separate network cards each connected to one of the routers, or you could have a single network card connected to all three routers via a hub or switch (switch would probably be better). Let's say you have one network card. In that scenario, you would assign an IP address in each of the network ranges for the each of the routers. I.e., 1.1.1.2/30, 2.2.2.3/30, 3.3.3.4/30 (note: these IP address are probably completely incorrect for assignment in the network range I have chosen, just using them as examples; you would get usable IP's from your ISP). To assign these IP address, use the 'ip' command.

ip addr add 1.1.1.2/30 brd + dev eth0
ip addr add 2.2.2.3/30 brd + dev eth0
ip addr add 3.3.3.4/30 brd + dev eth0

Now, you will need to setup the multi-path route as your default route.
You can specify the 'equalize' parameter if you like, but I have found
that it doesn't do exactly what you might expect it to do.

ip route add default nexthop via 1.1.1.1 dev eth0 \

                     nexthop via 2.2.2.2 dev eth0 \
                     nexthop via 3.3.3.3 dev eth0

And that should take care of that. Now all of this is assuming that you have multiple, different IP ranges for your 3 ISDN lines. If they are all in the same network range, you can forego having 3 IP's assigned to the same network card on your firewall. In that case you would only need one. Then substitue appropriately for the router IP addresses.

Quoted 17 lines · Logu

Hi,
I have 3 isdn connections. Is it possible to loadbalace the bandwidth using a linux box in between the routers and the client. I will be very much greatful to you if someone helps me in this.

-Logu

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

Signature · 9 lines
Jason A. Pattie
[email protected]




_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/
#2 lore raw
In reply to Logu

Hello,

Quoted 4 lines · Logu

Hi,
I have 3 isdn connections. Is it possible to loadbalace the bandwidth using a linux box in between the routers and the client. I will be very much greatful to you if someone helps me in this.

Heh, I see you on another list, with the same question. This
time I have more tutorials for you :)

http://www.linuxvirtualserver.org/~julian/dgd-usage.txt
http://www.linuxvirtualserver.org/~julian/

Quoted 1 line

-Logu

Regards

--
Julian Anastasov <[email protected]>

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

author
#3 lore raw
In reply to Logu

Hi,
This is my network
My LAN IP is 172.16.1.0/255.255.255.0
I have two router which has LAN IP 172.16.1.204 and another one 172.16.1.205 My Linux machine IP is 172.16.1.1.
I have two interface for linux machine one is conected to switch where all my windows machines are connected and another one 172.16.1.2 is connected to hub where my routers are connected
I set windows machines gateway as 172.16.1.1

Now how should i activate multipath routing

-Logu
----- Original Message -----
From: "Jason A. Pattie" <[email protected]>
To: "Logu" <[email protected]>
Cc: "Linux-routing" <[email protected]>
Sent: Tuesday, October 09, 2001 8:11 PM
Subject: Re: [LARTC] Loadbalancing the gateway

Quoted 30 lines

You might try multi-path routing. It doesn't exactly load balance the lines, as in aggregating the bandwidth together, but it does allow N number of simultaneous connections (where N would be the maximum number of different routes you have).

In your scenario, let's say you have the 3 routers with IP addresses of 1.1.1.1/30, 2.2.2.2/30, and 3.3.3.3/30. Now, you have your Linux firewall/gateway/router/thingy between the routers and the client. On your Linux box, you could have 3 separate network cards each connected to one of the routers, or you could have a single network card connected to all three routers via a hub or switch (switch would probably be better). Let's say you have one network card. In that scenario, you would assign an IP address in each of the network ranges for the each of the routers. I.e., 1.1.1.2/30, 2.2.2.3/30, 3.3.3.4/30 (note: these IP address are probably completely incorrect for assignment in the network range I have chosen, just using them as examples; you would get usable IP's from your ISP). To assign these IP address, use the 'ip' command.

ip addr add 1.1.1.2/30 brd + dev eth0
ip addr add 2.2.2.3/30 brd + dev eth0
ip addr add 3.3.3.4/30 brd + dev eth0

Now, you will need to setup the multi-path route as your default route.
You can specify the 'equalize' parameter if you like, but I have found
that it doesn't do exactly what you might expect it to do.

ip route add default nexthop via 1.1.1.1 dev eth0 \

                     nexthop via 2.2.2.2 dev eth0 \
                     nexthop via 3.3.3.3 dev eth0
Quoted 10 lines

And that should take care of that. Now all of this is assuming that you have multiple, different IP ranges for your 3 ISDN lines. If they are all in the same network range, you can forego having 3 IP's assigned to the same network card on your firewall. In that case you would only need one. Then substitue appropriately for the router IP addresses.

Quoted 2 lines · Logu

Hi,
I have 3 isdn connections. Is it possible to loadbalace the bandwidth

using

Quoted 6 lines
Quoted 6 lines

a linux box in between the routers and the client. I will be very much greatful to you if someone helps me in this.

-Logu

Quoted 8 lines
Quoted 8 lines

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:

http://ds9a.nl/2.4Routing/

Quoted 9 lines
Quoted 1 line

--
Jason A. Pattie
[email protected]

Quoted 3 lines

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:

http://ds9a.nl/2.4Routing/

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

#4 lore raw
In reply to Logu

You actually only have two connections then that Linux can see. One, I'm assuming, is a router that has multiple connections to the ISP which it assigns as the same IP address (multi-line ISDN is similar).

You will need to setup your multipath default route like so on the Linux box:

If eth0 is assigned 172.16.1.2 on your Linux router, then

ip route add default nexthop via 172.16.1.204 dev eth0 nexthop via 172.16.1.205 dev eth0

If you want to make one route work more than the other, you can assign weights to the routes right after each dev entry in the route statement (i.e., "ip route ... dev eth0 weight 2 ... dev eth0 weight 1", this would send twice as many connections out the first route as the second route). Remember that if you do not use the 'equalize' modifier to the route statement, you get traffic broken up across the links on a per session basis. If using the 'equalize' parameter, it will be broken across the links on a per packet basis.

Quoted 104 lines · Logu

Hi,
This is my network
My LAN IP is 172.16.1.0/255.255.255.0
I have two router which has LAN IP 172.16.1.204 and another one 172.16.1.205 My Linux machine IP is 172.16.1.1.
I have two interface for linux machine one is conected to switch where all my windows machines are connected and another one 172.16.1.2 is connected to hub where my routers are connected
I set windows machines gateway as 172.16.1.1

Now how should i activate multipath routing

-Logu
----- Original Message -----
From: "Jason A. Pattie" <[email protected]>
To: "Logu" <[email protected]>
Cc: "Linux-routing" <[email protected]>
Sent: Tuesday, October 09, 2001 8:11 PM
Subject: Re: [LARTC] Loadbalancing the gateway

Quoted 30 lines

You might try multi-path routing. It doesn't exactly load balance the lines, as in aggregating the bandwidth together, but it does allow N number of simultaneous connections (where N would be the maximum number of different routes you have).

In your scenario, let's say you have the 3 routers with IP addresses of 1.1.1.1/30, 2.2.2.2/30, and 3.3.3.3/30. Now, you have your Linux firewall/gateway/router/thingy between the routers and the client. On your Linux box, you could have 3 separate network cards each connected to one of the routers, or you could have a single network card connected to all three routers via a hub or switch (switch would probably be better). Let's say you have one network card. In that scenario, you would assign an IP address in each of the network ranges for the each of the routers. I.e., 1.1.1.2/30, 2.2.2.3/30, 3.3.3.4/30 (note: these IP address are probably completely incorrect for assignment in the network range I have chosen, just using them as examples; you would get usable IP's from your ISP). To assign these IP address, use the 'ip' command.

ip addr add 1.1.1.2/30 brd + dev eth0
ip addr add 2.2.2.3/30 brd + dev eth0
ip addr add 3.3.3.4/30 brd + dev eth0

Now, you will need to setup the multi-path route as your default route. You can specify the 'equalize' parameter if you like, but I have found that it doesn't do exactly what you might expect it to do.

ip route add default nexthop via 1.1.1.1 dev eth0 \

                    nexthop via 2.2.2.2 dev eth0 \
                    nexthop via 3.3.3.3 dev eth0
Quoted 11 lines

And that should take care of that. Now all of this is assuming that you have multiple, different IP ranges for your 3 ISDN lines. If they are all in the same network range, you can forego having 3 IP's assigned to the same network card on your firewall. In that case you would only need one. Then substitue appropriately for the router IP addresses.

Quoted 3 lines · Logu

Hi,
I have 3 isdn connections. Is it possible to loadbalace the bandwidth

using

Quoted 11 lines
Quoted 11 lines

a linux box in between the routers and the client. I will be very much greatful to you if someone helps me in this.

-Logu

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Quoted 4 lines
Quoted 4 lines

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:

http://ds9a.nl/2.4Routing/

Quoted 11 lines

--
Jason A. Pattie
[email protected]

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:

http://ds9a.nl/2.4Routing/

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

Signature · 9 lines
Jason A. Pattie
[email protected]




_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/
author
#5 lore raw
In reply to Logu

Hi Jason,
thanks for your response.
I am not able to ping outside from client machines.
I have a doubt. If the client and router is on different network, is it necessary to implement NATing.

Quoted 21 lines

You actually only have two connections then that Linux can see. One, I'm assuming, is a router that has multiple connections to the ISP which it assigns as the same IP address (multi-line ISDN is similar).

You will need to setup your multipath default route like so on the Linux box:

If eth0 is assigned 172.16.1.2 on your Linux router, then

ip route add default nexthop via 172.16.1.204 dev eth0 nexthop via 172.16.1.205 dev eth0

If you want to make one route work more than the other, you can assign weights to the routes right after each dev entry in the route statement (i.e., "ip route ... dev eth0 weight 2 ... dev eth0 weight 1", this would send twice as many connections out the first route as the second route). Remember that if you do not use the 'equalize' modifier to the route statement, you get traffic broken up across the links on a per session basis. If using the 'equalize' parameter, it will be broken across the links on a per packet basis.

Quoted 6 lines
Quoted 4 lines · Logu

Hi,
This is my network
My LAN IP is 172.16.1.0/255.255.255.0
I have two router which has LAN IP 172.16.1.204 and another one

172.16.1.205

Quoted 2 lines
Quoted 2 lines

My Linux machine IP is 172.16.1.1.
I have two interface for linux machine one is conected to switch where

all

Quoted 1 line
Quoted 1 line

my windows machines are connected and another one 172.16.1.2 is connected

to

Quoted 47 lines
Quoted 47 lines

hub where my routers are connected
I set windows machines gateway as 172.16.1.1

Now how should i activate multipath routing

-Logu

Quoted 41 lines

You might try multi-path routing. It doesn't exactly load balance the lines, as in aggregating the bandwidth together, but it does allow N number of simultaneous connections (where N would be the maximum number of different routes you have).

In your scenario, let's say you have the 3 routers with IP addresses of 1.1.1.1/30, 2.2.2.2/30, and 3.3.3.3/30. Now, you have your Linux firewall/gateway/router/thingy between the routers and the client. On your Linux box, you could have 3 separate network cards each connected to one of the routers, or you could have a single network card connected to all three routers via a hub or switch (switch would probably be better). Let's say you have one network card. In that scenario, you would assign an IP address in each of the network ranges for the each of the routers. I.e., 1.1.1.2/30, 2.2.2.3/30, 3.3.3.4/30 (note: these IP address are probably completely incorrect for assignment in the network range I have chosen, just using them as examples; you would get usable IP's from your ISP). To assign these IP address, use the 'ip' command.

ip addr add 1.1.1.2/30 brd + dev eth0
ip addr add 2.2.2.3/30 brd + dev eth0
ip addr add 3.3.3.4/30 brd + dev eth0

Now, you will need to setup the multi-path route as your default route. You can specify the 'equalize' parameter if you like, but I have found that it doesn't do exactly what you might expect it to do.

ip route add default nexthop via 1.1.1.1 dev eth0 \

                    nexthop via 2.2.2.2 dev eth0 \
                    nexthop via 3.3.3.3 dev eth0

And that should take care of that. Now all of this is assuming that you have multiple, different IP ranges for your 3 ISDN lines. If they are all in the same network range, you can forego having 3 IP's assigned to the same network card on your firewall. In that case you would only need one. Then substitue appropriately for the router IP addresses.

Quoted 3 lines · Logu

Hi,
I have 3 isdn connections. Is it possible to loadbalace the bandwidth

Quoted 7 lines
Quoted 7 lines

using

Quoted 5 lines
Quoted 5 lines

a linux box in between the routers and the client. I will be very much greatful to you if someone helps me in this.

-Logu

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

#6 lore raw
In reply to Logu

Of course, unless the other network knows how to route to the network your client resides on, and I'm sure it probably can't.

Quoted 112 lines · Logu

Hi Jason,
thanks for your response.
I am not able to ping outside from client machines.
I have a doubt. If the client and router is on different network, is it necessary to implement NATing.

Quoted 21 lines

You actually only have two connections then that Linux can see. One, I'm assuming, is a router that has multiple connections to the ISP which it assigns as the same IP address (multi-line ISDN is similar).

You will need to setup your multipath default route like so on the Linux box:

If eth0 is assigned 172.16.1.2 on your Linux router, then

ip route add default nexthop via 172.16.1.204 dev eth0 nexthop via 172.16.1.205 dev eth0

If you want to make one route work more than the other, you can assign weights to the routes right after each dev entry in the route statement (i.e., "ip route ... dev eth0 weight 2 ... dev eth0 weight 1", this would send twice as many connections out the first route as the second route). Remember that if you do not use the 'equalize' modifier to the route statement, you get traffic broken up across the links on a per session basis. If using the 'equalize' parameter, it will be broken across the links on a per packet basis.

Quoted 7 lines
Quoted 5 lines · Logu

Hi,
This is my network
My LAN IP is 172.16.1.0/255.255.255.0
I have two router which has LAN IP 172.16.1.204 and another one

172.16.1.205

Quoted 3 lines
Quoted 3 lines

My Linux machine IP is 172.16.1.1.
I have two interface for linux machine one is conected to switch where

all

Quoted 2 lines
Quoted 2 lines

my windows machines are connected and another one 172.16.1.2 is connected

to

Quoted 48 lines
Quoted 48 lines

hub where my routers are connected
I set windows machines gateway as 172.16.1.1

Now how should i activate multipath routing

-Logu

Quoted 41 lines

You might try multi-path routing. It doesn't exactly load balance the lines, as in aggregating the bandwidth together, but it does allow N number of simultaneous connections (where N would be the maximum number of different routes you have).

In your scenario, let's say you have the 3 routers with IP addresses of 1.1.1.1/30, 2.2.2.2/30, and 3.3.3.3/30. Now, you have your Linux firewall/gateway/router/thingy between the routers and the client. On your Linux box, you could have 3 separate network cards each connected to one of the routers, or you could have a single network card connected to all three routers via a hub or switch (switch would probably be better). Let's say you have one network card. In that scenario, you would assign an IP address in each of the network ranges for the each of the routers. I.e., 1.1.1.2/30, 2.2.2.3/30, 3.3.3.4/30 (note: these IP address are probably completely incorrect for assignment in the network range I have chosen, just using them as examples; you would get usable IP's from your ISP). To assign these IP address, use the 'ip' command.

ip addr add 1.1.1.2/30 brd + dev eth0
ip addr add 2.2.2.3/30 brd + dev eth0
ip addr add 3.3.3.4/30 brd + dev eth0

Now, you will need to setup the multi-path route as your default route. You can specify the 'equalize' parameter if you like, but I have found that it doesn't do exactly what you might expect it to do.

ip route add default nexthop via 1.1.1.1 dev eth0 \

                   nexthop via 2.2.2.2 dev eth0 \
                   nexthop via 3.3.3.3 dev eth0

And that should take care of that. Now all of this is assuming that you have multiple, different IP ranges for your 3 ISDN lines. If they are all in the same network range, you can forego having 3 IP's assigned to the same network card on your firewall. In that case you would only need one. Then substitue appropriately for the router IP addresses.

Quoted 3 lines · Logu

Hi,
I have 3 isdn connections. Is it possible to loadbalace the bandwidth

Quoted 7 lines
Quoted 7 lines

using

Quoted 5 lines
Quoted 5 lines

a linux box in between the routers and the client. I will be very much greatful to you if someone helps me in this.

-Logu

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

Signature · 9 lines
Jason A. Pattie
[email protected]




_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/