Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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...
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
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.
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.