Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Mar 2006 10:24:31 +0100
From:      "[LoN]Kamikaze" <LoN_Kamikaze@gmx.de>
To:        Derrick Ryalls <ryallsd@gmail.com>
Cc:        freebsd-mobile@freebsd.org
Subject:   Re: Wireless/Wired LAN autoswitch
Message-ID:  <44250C4F.8050008@gmx.de>
In-Reply-To: <d5eb95fc0603241225j3d95fb36ra59a182341ba7206@mail.gmail.com>
References:  <d5eb95fc0603241225j3d95fb36ra59a182341ba7206@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Dhclient dies when its interface is turned down. You don't have to use
killall. However even if an interface is down it will still confuse
routing when it has a valid IP. Thus I advice you the following if you
unplug:

# ifconfig interface0 0.0.0.0 down
# route flush
# route add default -interface interface1

You have to replace inteface0 and 1 with whatever suits your system.

Derrick Ryalls wrote:
> Greetings mobile subscribers,
> 
> I have been playing around with trying to get wireless/wired switching
> working on my 6.1 PRERELEASE laptop, but haven't had much luck.  I can
> control the wired connection via ifconfig and the wireless via
> wpa_supplicant, but I am having a difficult time getting the routing
> adjusted when I plug/unlpug the network cable.
> 
> I am new to wireless in FreeBSD and don't have a lot of experience with
> using ifconfig/route in general, so maybe I am doing something brain dead.
> I tried the following workflow:
> 
> killall dhcp
> route flush
> (exec start wpa_supplicant script)
> route add 192.168.2.1 (for wireless)
> 
> 
> But that doesn't seem to work.  I have had the best luck when I do ifconfig
> bfe0 down to force not using the wired connection.  I have also tried
> putting the script in /etc/devd.conf but I it didn't work as I expected, so
> I doubt I had that configured correctly.
> 
> I guess my question comes in 2 parts. a) Besides using cron and scraping
> ifconfig, how do I detect the plug/unplug events and b) how do I reliable
> change the routing table to point to the correct gateway?
> 
> Thanks for any pointers.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44250C4F.8050008>