LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   2 ether cards auto-routering (https://www.linuxquestions.org/questions/linux-networking-3/2-ether-cards-auto-routering-28154/)

tola 08-17-2002 07:31 PM

2 ether cards auto-routering
 
Hi,
I'm new to this board.
My question is,
I have 2 ether cards on my Linux machine as server.
If #1 crashed for some reason, is there any idea to do some coding in the program to let #2 start to take over the job of #1
automaticly?
I mean #2 card is working as a kind of backup.

DavidPhillips 08-17-2002 11:00 PM

if you have dhcp setup as the protocol for each interface, and the isp accepts any mac address, and ifup, and ifdown are setup to work with your isp.

two files, there's a lot of ways to do this. but what the heck

start one of them from rc.local ( the one that's up at boot )

/usr/bin/ifupeth0 &

-----------------------------------------------------------

#!/bin/sh
# /usr/bin/ifupeth0
if ! ping -i 30 yourgateway.com; then
ifdown eth0
ifup eth1
sleep 30
fi
/usr/bin/ifupeth1 &

----------------------------------------------------------

#!/bin/sh
# /usr/bin/ifupeth1
if ! ping -i 30 yourgate.com; then
ifdown eth1
ifup eth0
sleep 30
fi
/usr/bin/ifupeth0 &

-----------------------------------------------------------
99.99999999 percent of the time I bet the problem will not be your card. I have never seen one go out.


All times are GMT -5. The time now is 09:13 PM.