From owner-freebsd-net@freebsd.org Fri Mar 30 17:46:08 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 435B3F50DA9 for ; Fri, 30 Mar 2018 17:46:08 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B73C1729E5 for ; Fri, 30 Mar 2018 17:46:07 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [IPv6:2a00:e10:2800::a135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id w2UHk4og002090; Fri, 30 Mar 2018 19:46:04 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 6AA32DC9; Fri, 30 Mar 2018 19:46:04 +0200 (CEST) Message-ID: <5ABE77DB.3030501@omnilan.de> Date: Fri, 30 Mar 2018 19:46:03 +0200 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Grzegorz Junka CC: "freebsd-net@freebsd.org" Subject: Re: Default network device References: <5237ec10-c906-db3c-f62f-cc7478a31dc0@yoonka.com> In-Reply-To: <5237ec10-c906-db3c-f62f-cc7478a31dc0@yoonka.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]); Fri, 30 Mar 2018 19:46:05 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: ; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Mar 2018 17:46:08 -0000 Bezüglich Grzegorz Junka's Nachricht vom 24.03.2018 17:21 (localtime): > Hi, > > In my laptop I have both, wlan0 and ue0 (ethernet). When both are > connected, FreeBSD chooses to use wlan0 by default. Only when I > disable wlan0 it switches to use ue0. Since ue0 is ethernet it's > obviously much faster than wlan0. > > Why FreeBSD is selecting wlan rather than ue? How to configure the > network so that wlan0 is only used when ue0 isn't available? > Hello GrzegorzJ, I don't know the internal details of FreeBSDs source address selection, but I as far as I know it doesn't care about the type of interface in any way, including it's capabilities like bandwidth. You can use if_lagg(4) and configure your 802.11 device as fallback only. Otehrwise simple IP matching algorithms are in place. So if the host, you're connecting to, is reachable via two lo0 routes (netstat -nr -f inet and look for /32 and /?? routes – the /32 is on the interface and the real network is on lo0), you could adjust it's metric probably... Never done so, but these are the places to start. -harry