Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jun 2000 07:04:58 +1000
From:      Dale Walker <dale@icr.com.au>
To:        Steve Price <sprice@hiwaay.net>
Cc:        freebsd-isp@FreeBSD.ORG
Subject:   Re: routing Qs
Message-ID:  <39512DFA.FCDC5157@icr.com.au>
References:  <20000621155748.A81471@bsd.planetwe.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Steve Price wrote:
> 
> Hi all,
> 
> I have a small problem that I need help with.  I'm trying to setup
> a box with two NICs: 192.168.12.11 and 192.168.12.21.  The default
> gateway is 192.168.12.1.  This works fine if the 192.168.12.11
> interface is up and connected.  However, what I'm trying to do is
> to get traffic to go through the second NIC when the first NIC goes
> away.
> 
> I've also tried (to no avail thus far) to setup two default gateways
> on separate machines: 192.168.12.1 and 192.168.11.1.  The two NICs
> then had addresses 192.168.12.11 and 192.168.11.1 but only being
> able to set a single default gateway sort of nixes this idea too.
> 
> Can someone clue me in to the obvious on how to set this up?
> 
> Thanks.
> 
> -steve



Steve,

You can do this with a 'ping', and using it's exit status...

ie:

---------------------------------------------
/usr/sbin/ping -c 1 gw1 && \
	/sbin/route change default gw1 || \
	/sbin/route change default gw2
---------------------------------------------

however this doesn't allow for the current default route working ok, and
will reset your correct route each time it runs... but this may get you
started...




-- 
Dale Walker                                              dale@icr.com.au
Independent Computer Retailers (ICR)               http://www.icr.com.au
ICRnet					           http://www.icr.net.au


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39512DFA.FCDC5157>