linuxpakistan.net Forum Index linuxpakistan.net
LinuxPakistan.net discussion forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

load balance 2 DSL Modem in one server
Goto page 1, 2  Next
 
Post new topic   Reply to topic    linuxpakistan.net Forum Index -> Administration
View previous topic :: View next topic  
Display posts from previous:    
Author Message
onezeroinc
Naik


Joined: 22 May 2004
Posts: 53
Location: Karachi

PostPosted: Sat May 12, 2007 5:24 am    Post subject: load balance 2 DSL Modem in one server Reply with quote

Hi, How to load balance 2 DSL Modem in one server. I have two dsl modems (128kbps each) which is connected via ethernet to my server. i
installed three lan cards on the server. lancard1 and lancard2 is connected to both dsl modems and lancard3 is connected to the 8 port hub.

I want to use both dsl modems for internet, but at the same time. means, want to share both dsl modem to get 256kbps at the same time.

I think you got my point. please help me and show me the way.

waiting...

Best regards.
onezeroinc.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
lambda
Major General


Joined: 27 May 2003
Posts: 3410
Location: Lahore

PostPosted: Sat May 12, 2007 12:53 pm    Post subject: Reply with quote

i don't think it'll work. or maybe the last guy who tried missed something.
Back to top
View user's profile Send private message Visit poster's website
onezeroinc
Naik


Joined: 22 May 2004
Posts: 53
Location: Karachi

PostPosted: Sat May 12, 2007 3:28 pm    Post subject: Reply with quote

what is this? is this software solve my problem?http://www.inlab.de/balance.html

this guy give me the solution but i dont understand how he done it.
http://www.damia.net/comos/balance/

waiting....[/url][/quote]
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
lambda
Major General


Joined: 27 May 2003
Posts: 3410
Location: Lahore

PostPosted: Sat May 12, 2007 6:12 pm    Post subject: Reply with quote

the damia.net setup looks like it'll work. the only way to be sure is for you to set it up.
Back to top
View user's profile Send private message Visit poster's website
compucated
Naik


Joined: 13 Oct 2003
Posts: 75
Location: Karachi, Pakistan

PostPosted: Sun May 13, 2007 12:43 am    Post subject: Reply with quote

http://lartc.org/howto/
Read whole document for better understanding and section 4.2. (Routing for multiple uplinks/providers) to get more specific.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
siddiqi8
Naik


Joined: 25 Feb 2005
Posts: 88

PostPosted: Mon May 14, 2007 12:12 am    Post subject: Reply with quote

What you can do is to route all your web traffic through 1 dsl modem and rest to the other dsl connection..
Back to top
View user's profile Send private message
lambda
Major General


Joined: 27 May 2003
Posts: 3410
Location: Lahore

PostPosted: Mon May 14, 2007 2:15 pm    Post subject: Reply with quote

siddiqi8 wrote:
What you can do is to route all your web traffic through 1 dsl modem and rest to the other dsl connection..
which will probably work far less efficiently than the damia solution (if it works).
Back to top
View user's profile Send private message Visit poster's website
LinuxFreaK
Site Admin


Joined: 02 May 2003
Posts: 5130
Location: Karachi

PostPosted: Tue May 15, 2007 11:06 am    Post subject: Re: Reply with quote

Dear siddiqi8,
Salam,

Similar to this solution.

FYI, http://www.leglug.org/node/Load%20Balancing%20Across%20Multiple%20Links

Best Regards.
_________________
Farrukh Ahmed
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
onezeroinc
Naik


Joined: 22 May 2004
Posts: 53
Location: Karachi

PostPosted: Tue May 15, 2007 6:14 pm    Post subject: Reply with quote

hurra i done it.... thanks for damia solution.

but when i enter there commands, first error come, so i change IPTABLES to iptables. then again error come in SNAT, its says "Bad argument `SNAT' now what todo? ( but with out giving this commands, my both dsl modems are working but without natting. Rolling Eyes

Quote:
IPTABLES=/sbin/iptables
$IPTABLES -t nat -A POSTROUTING -o $EXTIF1 -j SNAT --to-source 81.203.149.126
$IPTABLES -t nat -A POSTROUTING -o $EXTIF2 -j SNAT --to-source 81.203.144.81
$IPTABLES -t nat -A POSTROUTING -o $EXTIF3 -j SNAT --to-source 81.203.128.69
$IPTABLES -t nat -A POSTROUTING -o $EXTIF4 -j SNAT --to-source 81.203.144.88


my second questions is, when ever system restart eth1 and eth2 gateways changed, so please confirm me every time i enter these commands or what?

is there any script to get eth1 and eth2 gateway automatically?

please help me and others,
best regards,
Onezero
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
lambda
Major General


Joined: 27 May 2003
Posts: 3410
Location: Lahore

PostPosted: Tue May 15, 2007 6:50 pm    Post subject: Reply with quote

those are the commands on the page. what are the commands you ran? please paste the exact commands.
Back to top
View user's profile Send private message Visit poster's website
onezeroinc
Naik


Joined: 22 May 2004
Posts: 53
Location: Karachi

PostPosted: Tue May 15, 2007 7:15 pm    Post subject: Reply with quote

Quote:
root@ubuntu:~ # iptables -t nat -A POSTROUTING -o $EXTIF1 -j SNAT --to-source 202.38.48.66
Bad argument `SNAT'
Try `iptables -h' or 'iptables --help' for more information.
root@ubuntu:~ #
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
lambda
Major General


Joined: 27 May 2003
Posts: 3410
Location: Lahore

PostPosted: Wed May 16, 2007 12:13 am    Post subject: Reply with quote

in a shell prompt $something refers to a shell variable. before you can use $EXTIF1 in a command, you must first define it. that's probably also why $IPTABLES didn't work for you.

change that to
Code:
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 202.38.48.66
or whatever the interface should be.
Back to top
View user's profile Send private message Visit poster's website
onezeroinc
Naik


Joined: 22 May 2004
Posts: 53
Location: Karachi

PostPosted: Wed May 16, 2007 3:31 am    Post subject: Reply with quote

done.
i give these commands with no error come. that mean all are ok. but please tell me that what is the effect of these commands? as i already told that with out these commands, my problem already solved. both the dsl modem working and give me 256kbps speed. what this do?
Quote:
root@ubuntu:~ # iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 202.38.48.66


my other question is: when my pc restart. all browsing stops. i manually gave this gateway because of dhcp of dsl modem. what to do?

best regards
onezero.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
lambda
Major General


Joined: 27 May 2003
Posts: 3410
Location: Lahore

PostPosted: Wed May 16, 2007 12:22 pm    Post subject: Reply with quote

onezeroinc wrote:
my other question is: when my pc restart. all browsing stops. i manually gave this gateway because of dhcp of dsl modem. what to do?


i guess you'll need to write a script. on startup, you'll need to do the following:

- get the local ip addresses for each ethernet interface
- get the remote gateway addresses for each interface
- delete the default routes and use the "ip route add" command to set the routes
- run iptables for SNAT with the local ip addresses

here's how you get the gateway address for, say, eth0:
Code:
netstat -rn | grep ^0.0.0.0 | grep eth0 | awk '{print $2}'

here's how you get the ip address for, say, eth1:
Code:
ifconfig eth1 | grep 'inet addr' | awk '{ print $2 }' | sed -e 's/.*://'

the damia page tells you how to use these two pieces of information.

i googled for shell scripting and found this guide. time to start learning, 10.
Back to top
View user's profile Send private message Visit poster's website
LinuxFreaK
Site Admin


Joined: 02 May 2003
Posts: 5130
Location: Karachi

PostPosted: Thu May 17, 2007 3:08 pm    Post subject: Re: Reply with quote

Dear onezeroinc,
Salam,

This will also help Smile

# route -n | awk /UG/'{print $2}'

Best Regards.
_________________
Farrukh Ahmed
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    linuxpakistan.net Forum Index -> Administration All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group