LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-13-2007, 04:44 AM   #1
bondoq
Member
 
Registered: Nov 2004
Posts: 77

Rep: Reputation: 13
two gateway for one subnet


i have two linux box using fedora core 5 and each of them connected with ISP

i want to a backup solution in each linux box so in case any connection filed the other will be run


sorry for my english
 
Old 05-13-2007, 05:07 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
check chapter 4 of lartc.org
 
Old 05-13-2007, 05:45 AM   #3
bondoq
Member
 
Registered: Nov 2004
Posts: 77

Original Poster
Rep: Reputation: 13
thank you

i will check it
 
Old 05-13-2007, 06:03 AM   #4
bondoq
Member
 
Registered: Nov 2004
Posts: 77

Original Poster
Rep: Reputation: 13
thanks

i checked it but i found it explained another case
i have 2 linux boxes each Linux box has 2 nic but i explained when you have one linux box only

so i really confused and my experience too little

please help me
 
Old 05-13-2007, 07:40 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
two boxes with two nics? hm? no idea what you mean really... an ascii top[ology diagram maybe be needed here... remember to use [code ] tags please...
 
Old 05-13-2007, 07:58 AM   #6
bondoq
Member
 
Registered: Nov 2004
Posts: 77

Original Poster
Rep: Reputation: 13
i mean linux fedora core 5 with 2 nic eth0 10.0.0.1 and eth1 62.241.153.66 and it is a gateway to group of clients (10.0.0.10 - 10.0.0.100)

and linux fedora core 5 with 2 nic 10.0.0.164 and eth1 66.241.156.110 it is a gateway to group of clients (10.0.0.110 - 10.0.0.200)

i want to make each of them running and if any one failed the other group switch to the other gateway
 
Old 05-13-2007, 08:12 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well the above link still applies really, but what's the hardware being used for thei internet connections and such? you really should provide more detail...
 
Old 05-13-2007, 10:00 AM   #8
bondoq
Member
 
Registered: Nov 2004
Posts: 77

Original Poster
Rep: Reputation: 13
so let me show

i have 2 linux pc each of them working as gateway for the local network

the first has 2 nics eh0 with ip 10.0.0.1 and it is connected to the local network
the clients (10.0.0.100 - 10.0.0.200)
and eth1 with ip 62.241.153.147 connected to the internet and its gateway is 62.241.153.145

the second has 2 nics eh0 with ip 10.0.0.146 and it is connected to the local network the clients (10.0.0.210 - 10.0.0.240) and eth1 with ip 62.241.155.100 connected to the internet and its gateway is 62.241.155.101

so i want if the connection to the internet in the first linux gateway is failed it automatically swith to the other linux gateway

and the same in the other gateway

do you need more details ?

thank you
 
Old 05-13-2007, 10:18 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
this is making less and less sense with each post... so for no apparent good reason some hosts use box 1 as the gateway, some use box 2? yuck. but if that's waht you want, and then for the elected gateway to use the other box is the local connection is not working? still chapter 4 in the main... but also check this http://www.linuxquestions.org/questi...d.php?t=546224 has some similar ideaas in it.
 
Old 05-13-2007, 11:48 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
ok, trying to seeyour architecture differently, it seems you basically want somethign like hsrp or vrrp. simplest angle i see out of this is send_arp http://www.onlamp.com/pub/a/onlamp/2...inuxhacks.html whereby if server 1 stops responding then server 2 will assume that ip address and so clients using that as their gateway will then use the other box. now of course 1) you wouldn't use the real addresses, but virtual ones which are moveable and 2) you need a reason to take out the main ip address. i would suggest that you could just try to ping google.com every 5 seconds, and if it doesn't reply, run an ifconfig command to remove the ip address from the live box. this would then be noticed by the slave box and take over. i'm saying things liek slave as this is a master slave relationship, but just replicated and flipped over for the other address too.
 
Old 05-14-2007, 04:38 AM   #11
bondoq
Member
 
Registered: Nov 2004
Posts: 77

Original Poster
Rep: Reputation: 13
thanks

it is really very good link

but i would suggest that i can make it by making a script ping www.yahoo.com
(on the server 1)
if it is reply run
iptables -t nat -A POSTROUTING -o eth1 -j SNAT 62.241.153.145

and if it doesn't reply run

iptables -t nat -A POSTROUTING -o eth1 -j SNAT 62.241.155.101

(on the server 2)
if it is reply run

iptables -t nat -A POSTROUTING -o eth1 -j SNAT 62.241.155.101

and if it doesn't reply run

iptables -t nat -A POSTROUTING -o eth1 -j SNAT 62.241.153.145
 
Old 05-14-2007, 06:50 AM   #12
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
erm, no shouldn't work...you're sending traffic out of one router with the ip address of the other? that's *seriously* horrible. and also gives you no resilience at all, and thinking about it, if either link isn't available then both connections would die for most clients... router 1 is down, do server 1 can't ping yahoo. packet is then source natted to the other routers public ip address, and then the packet fails, as the default route for that box is dead... seriously. really not good.
 
Old 05-14-2007, 09:05 AM   #13
bondoq
Member
 
Registered: Nov 2004
Posts: 77

Original Poster
Rep: Reputation: 13
so what about your suggests to make this task ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Two NIC's on same subnet/gateway TBKDan Linux - Networking 4 04-06-2007 10:20 PM
how to detect which networkaddress, gateway, subnet on network without dhcp deadeyes Linux - Wireless Networking 2 03-02-2007 01:53 AM
Setup FC4 as a subnet router/gateway rfancella Linux - Networking 1 06-01-2006 10:53 AM
How to connect to a gateway on a different subnet? anGeR Linux - Networking 1 04-09-2004 08:50 AM
Gateway on different subnet mikewelter Linux - Networking 2 12-17-2003 12:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration