From owner-freebsd-questions@FreeBSD.ORG Thu Aug 20 21:54:33 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E421B106568F for ; Thu, 20 Aug 2009 21:54:33 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id B445D8FC64 for ; Thu, 20 Aug 2009 21:54:33 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.lan.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 4DC557E859; Thu, 20 Aug 2009 13:54:32 -0800 (AKDT) From: Mel Flynn To: freebsd-questions@freebsd.org Date: Thu, 20 Aug 2009 13:54:29 -0800 User-Agent: KMail/1.11.4 (FreeBSD/8.0-BETA2; KDE/4.2.4; i386; ; ) References: <4A8D329D.5030205@infosec.pl> In-Reply-To: <4A8D329D.5030205@infosec.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908201354.30521.mel.flynn+fbsd.questions@mailing.thruhere.net> Cc: Michal Subject: Re: switching from one network interface to another without reboot X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2009 21:54:34 -0000 On Thursday 20 August 2009 03:25:17 Michal wrote: > Problem description: I've got a laptop with two network interfaces > (wired em0 and wireless ath0). Every now and then I have to set up a DSL > wireless box which comes with default settings so that I have to start > with connecting my laptop via em0. > em0 gets IP address from wireless box by DHCP. I log in to web interface > and set everything up including WLAN and restart wireless box. At this > point I would like to switch to ath0 and start using internet connection > via wireless box. > I'm taking em0 interface down with "ifconfig em0 down" and unplug the > cable. I'm changing /etc/rc.conf entries to: > ifconfig_em0="NOAUTO" > ifconfig_ath0="WPA DHCP" > Then I'm doing "/etc/rc.d/netif restart" and ath0 gets IP address via > DHCP and is connected to wireless box (/etc/wpa_supplicant.conf is set up). If these are on the same network (like most wireless routers), it can pay off to use lagg(4) and then simply unplug the cable. Plug it back in and it will use the cable again. You would need: cloned_interfaces="lagg0" ifconfig_em0="UP" ifconfig_ath0="ether 00:xx:xx:xx WPA" # set to MAC address of em0 ifconfig_lagg0="laggproto failover laggport em0 laggport ath0 DHCP" -- Mel