?
Solved

Set two default gateway?

Posted on 2003-03-30
5
Medium Priority
?
5,884 Views
Last Modified: 2007-12-19
I have 3 Linux boxes.Let me first define the specs:
1.pc A with kernel > 2.4, ext eth-->adsl connection,int eth --> 192.168.8.1
2.pc B with kernel > 2.4, ext eth-->adsl connection,int eth --> 192.168.8.2
3.pc C with kernel 2.0.x, eth--> 192.168.8.3, gw--> 192.168.8.1

I'm hosting a download service on pc C. Currently, any incoming packets from pc A are forwarded to pc C so that users can download via connection on pc A. I have another ppp connection on pc B.  I want to configure the connection on pc B as a backup line to pc A. How do I make it in such a way that users can download from both connections on pc A and pc B? I've found out that users can only download from connection on pc B if I swith the default gateway of pc C to refer to pc B. Is it possible to have two default gateways on pc C, so that download from both connections could happen at the same time? Or are there any other ways to solve this? Please advice.
0
Comment
Question by:viansoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 8234788

i.g. you cannot do it, simply ...
Have seen a question here where it has been discussed, not shure if the solution works (no link either).

What you want to do is usually done by a load balancer infront of the servers.
There're several load balabcing software available:
  http://www.zeus.com/
  http://www.zebra.org/
  http://www.linuxvirtualserver.org/
   http://www.linux-ha.org/
  http://www.lartc.org/
0
 
LVL 2

Accepted Solution

by:
sprinkmeier earned 150 total points
ID: 8235678
Load ballancing usually menad 2 connections to the same ISP and requires support at both ends.

Having a backup default gateway is easy, just set it upas a static route with a higher metric that the primary.

details vary from distro to distro, but in RH7.1 all you do is mangle

/etc/sysconfig/static-routes

to add

#primary
eth0 net 0.0.0.0 gw metric192.168.8.1  0
#backup
eth0 net 0.0.0.0 gw metric192.168.8.2  5

(going from memory, YMMV). The box __should___ use .2 if .1 becomes unresponsive. Alternativley add B as a backup gateway to A, the changeover will then be transparent yo C.
0
 

Author Comment

by:viansoo
ID: 8236009
sprinkmeier:
what do u mean by 'mangle' the /etc/sysconfig/static-routes. is it equivalent to 'vi' the static-routes. after adding the 2 lines into the file, do i need to restart the pc?
0
 
LVL 2

Expert Comment

by:sprinkmeier
ID: 8236036
vi, emacs, I'm not getting into that holy war ;-)

Restart the PC? What do you think this is, Windos?

ifdown eth0
ifup eth0

should be enough. actually,
/etc/sysconfig/network-scripts/ifup-routes eth0
should do the trick.

/etc/init.d/network restart
works too.

(sorry, being LINUX I feel obliged to point out several ways to skin the same cat)
0
 

Expert Comment

by:CleanupPing
ID: 9077566
viansoo:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question