From owner-freebsd-questions@FreeBSD.ORG Wed Oct 13 01:45:45 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5960E16A4CE for ; Wed, 13 Oct 2004 01:45:45 +0000 (GMT) Received: from gremlin.internode.com.au (gremlin.internode.com.au [192.83.231.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9824743D45 for ; Wed, 13 Oct 2004 01:45:44 +0000 (GMT) (envelope-from adam@internode.com.au) Received: from gremlin.internode.com.au (localhost [127.0.0.1]) i9D1jfxs043043 for ; Wed, 13 Oct 2004 11:15:41 +0930 (CST) (envelope-from adam@internode.com.au) Received: (from adam@localhost) by gremlin.internode.com.au (8.13.1/8.13.1/Submit) id i9D1jfm1043042 for freebsd-questions@freebsd.org; Wed, 13 Oct 2004 11:15:41 +0930 (CST) (envelope-from adam@internode.com.au) X-Authentication-Warning: gremlin.internode.com.au: adam set sender to adam@internode.com.au using -f Resent-From: adam@internode.com.au Resent-Date: Wed, 13 Oct 2004 11:15:40 +0930 Resent-Message-ID: <20041013014540.GG752@internode.com.au> Resent-To: freebsd-questions@freebsd.org Date: Wed, 13 Oct 2004 11:07:05 +0930 From: Adam Smith To: freebsd-questions@freebsd.org Message-ID: <20041013013704.GE752@internode.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Face: $vsV$1FNbZN\JVpjV#&+/!oVW`Kw$j?w_,te\SS}(tKD21c+l$t%\RCS(r$G; XXk]6,(!N:&(N3EV0bY`3):UrgG7'*qsj3l.75IaHV1<`i*{[L\:F*l6fH##C:-p2]xW/R-Z:!bo; 5g3GP-{I{}7O>tN}`Xm/=-:8NG?f-r'$Qc3y[aW-7'W_S<`KYU!_; `7K=kuC$-.7J2*kk=~`c@ADp+xhsv(!a@eW-R_5wtx+tC)(]%W+ User-Agent: Mutt/1.5.6i Subject: IP address assignment over two interfaces X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2004 01:45:45 -0000 Hi, I have two network interfaces in my laptop, rl0 and an0. rl0 is my onboard Ethernet adapter and an0 is a Cisco wireless PCMCIA card. When I'm at home, there are often times in which I may wish to switch from wireless to wired for performance reasons when transferring files over my LAN. Unfortunately the process to do this, as far as I know, is rather awful. My wireless network is configured with a WEP key and a passphrase. As a result I have attempted to simplify my life by creating a script that I execute when my system boots. It checks to see if my hard-wired ethernet has an IP address, and if not, it grabs one via the wireless card (and sets up the WEP key etc): ------ [adam@myhost /home/adam]$ cat /usr/local/bin/wireless #!/bin/sh # Check to see if we have an Ethernet address on the physical port if ifconfig rl0 | grep 0.0.0.0 then killall dhclient ifconfig an0 wepmode on wepkey mywepkey ssid myssid dhclient an0 mount /data fi ------ It kills dhclient, because I can't run two instances of it at once. This works rather well at the moment, however if I want to switch back from wireless to wired, I have to kill dhclient, config my wireless with 'ifconfig an0 0.0.0.0' and then re-run 'dhclient rl0'. That's really annoying. What I'd like to accomplish is to be able to switch between these two cards automatically. Preferably, I'd like to use wireless as a 'backup' to wired, so that if I am hardwired in, wireless just shouldn't bother trying to obtain an IP address. If I unplug my Ethernet connection, wireless should sync up and take over operations. I was inspired by OS/X's sweetness. It does exactly that; switches between the two interfaces magically. I want some of that sweet stuff. Any idea if the FreeBSD OS itself has any underlying capability for this kind of thing (some sort of Interface watching daemon?) Also, if I configured DHCP to assign the same IP address to both my wireless and wired interfaces, that would possibly mean that any TCP sessions that I have open will stay open, which is really, really cool. Thanks for listening! :) -- Adam Smith Internode : http://www.internode.on.net Phone : (08) 8228 2999 Dog for sale: Eats lots and is fond of children.