From owner-freebsd-questions Thu Sep 5 1:54:42 2002 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 8E09237B401 for ; Thu, 5 Sep 2002 01:54:37 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A92643E81 for ; Thu, 5 Sep 2002 01:54:34 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk ([IPv6:::1]) by smtp.infracaninophile.co.uk (8.12.5/8.12.5) with ESMTP id g858sVGk032388; Thu, 5 Sep 2002 09:54:31 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.12.5/8.12.5/Submit) id g858sQX5032387; Thu, 5 Sep 2002 09:54:26 +0100 (BST) Date: Thu, 5 Sep 2002 09:54:26 +0100 From: Matthew Seaman To: Chris Kulish Cc: freebsd-questions@FreeBSD.ORG Subject: Re: wireless nic+wired nic+same subnet Message-ID: <20020905085426.GA31635@happy-idiot-talk.infracaninophi> References: <010201c25489$3a4f6650$0101010a@superbeast> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <010201c25489$3a4f6650$0101010a@superbeast> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Sep 04, 2002 at 10:06:28PM -0500, Chris Kulish wrote: > I have a wireless pc card and a wired ethernet card in the same laptop, > each with its own ip, but on the same subnet. Currently, I have to > disable one in rc.conf and reboot to get connectivity with the other. > Is there any way to set this up, so that if the wired nic isn't plugged > into the network and the wireless is, it will use the wireless, and vice > versa? As you've no doubt managed to convince yourself by now, it's not kosher to have two network interfaces on the same subnet. What you want is essentially to have a redundant pair of network interfaces and to automatically failover from one to the other. The keyword there is "VRRP" -- virtual redundant router protocol (RFC2338). Unfortunately, although there is a net/vrrp port, it's marked broken and the parent website http://www.vrrp.net/ seems to have gone the way of all flesh. The next best thing I can think of is the netgraph ng_one2many(4) implementation, which essentially takes two or more physical network interfaces and makes them into one big virtual NIC. This looks promising, but there is no automatic mechanism for discovering if one or other of the interfaces has lost connectivity --- you can use ngctl(8) to send a message to the node telling it to enable one NIC and disable the other. However, this is all probably way too complicated for your needs. You can switch between two NIC without rebooting by judicious use of the ifconfig(8) command. Suppose your wireless NIC is wi0 and your standard NIC is de0, and they distinct addresses on the 192.168.0.0/24 network. Thus on bootup, set up the wired NIC: ifconfig de0 inet 192.168.0.1 netmask 255.255.255.0 up (which can be done through the usual /etc/rc.conf settings) Then to switch to wi0: ifconfig de0 down ifconfig wi0 inet 192.168.0.2 netmask 255.255.255.0 up (and vice versa to switch back). This can be scripted quite readily, but it isn't particularly bulletproof and will quite probably get snarled up at the least excuse... Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message