From owner-freebsd-questions@FreeBSD.ORG Thu Aug 20 12:14:35 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 AF87D106564A for ; Thu, 20 Aug 2009 12:14:35 +0000 (UTC) (envelope-from amvandemore@gmail.com) Received: from mail-yw0-f199.google.com (mail-yw0-f199.google.com [209.85.211.199]) by mx1.freebsd.org (Postfix) with ESMTP id 6954A8FC52 for ; Thu, 20 Aug 2009 12:14:35 +0000 (UTC) Received: by ywh37 with SMTP id 37so7172600ywh.28 for ; Thu, 20 Aug 2009 05:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=lv0tvwh3y9M3H8WF3ZhkEsEMGamYgrvEQAFhqUIIOzk=; b=pos2bfChO+GscxDPS91P3pl/C4E263Qf0xW6UeRJbRYco3bRNJgZYGkAaS3xBFtDDv U+vaqRkWTpO7D3rvPH4pUSMLUrQGmlSbawhIbyf505cfGa5bAFNaeWKPJTINIW/7gRE1 l9i39rc+wvSqftZ9fxej37w1AqGd8kpSBq/mM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ZBzlCUEpqvz9ZZVjxlbIpkM8CRihdNR2zUb3CcVL4RPF4DoJt/yPPAyenLfK/Jszmx 3mKL91rUeYdFhLY3RfUPQhLd+vj5vGnq5kRMUpqIyUpwbspHioDBZrAlyTm5DKh7Jp8J MdbW+Rkf+QH+iYwGPVYaxpoBA60Ps0eCcDHIQ= MIME-Version: 1.0 Received: by 10.150.63.2 with SMTP id l2mr12549550yba.207.1250770474862; Thu, 20 Aug 2009 05:14:34 -0700 (PDT) In-Reply-To: <4A8D329D.5030205@infosec.pl> References: <4A8D329D.5030205@infosec.pl> Date: Thu, 20 Aug 2009 07:14:34 -0500 Message-ID: <6201873e0908200514kcdf55d4r4ed645904f0f7170@mail.gmail.com> From: Adam Vande More To: Michal Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org 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 12:14:35 -0000 On Thu, Aug 20, 2009 at 6:25 AM, Michal wrote: > Hello, > > How can I switch from one network interface to another without rebooting my > system (7.2R)? > > 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). > > But whenever I try to ping anything (including wireless box) I get > "interface down" message because my system still tries to use em0. > What else should I do to tell it that I'm connected to network via ath0 > now? > > Any suggestions are welcome. > Michal > -- > "The quiter you become, the more you can hear." -Ram Dass > > > /etc/rc.d/netif stop em0 /etc/rc.d/netif start ath0 -- Adam Vande More