From owner-freebsd-net@freebsd.org Tue Jun 25 03:17:32 2019 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 F2C4B15B99D7 for ; Tue, 25 Jun 2019 03:17:31 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13::5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "eg.sd.rdtc.ru", Issuer "eg.sd.rdtc.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C0C7E6DF85 for ; Tue, 25 Jun 2019 03:17:20 +0000 (UTC) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: freebsd-net@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x5P3H6J0093191 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 25 Jun 2019 10:17:06 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: Can Ethernet and wi-fi be used concurrently? To: "Rodney W. Grimes" , Thomas Mueller References: <201906242016.x5OKGC0n045598@gndrsh.dnsmgr.net> Cc: freebsd-net@freebsd.org From: Eugene Grosbein Message-ID: <0e8ebf6b-56fd-d6ea-906b-5af1c8fa54ab@grosbein.net> Date: Tue, 25 Jun 2019 10:16:58 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201906242016.x5OKGC0n045598@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0C7E6DF85 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [0.96 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.74)[-0.740,0]; MX_INVALID(0.50)[greylisted]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[grosbein.net]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_PERMFAIL(0.00)[]; NEURAL_SPAM_LONG(0.51)[0.514,0]; NEURAL_HAM_SHORT(-0.27)[-0.272,0]; IP_SCORE(0.06)[asn: 29072(0.28), country: RU(0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:29072, ipnet:2a03:3100::/32, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 03:17:32 -0000 25.06.2019 3:16, Rodney W. Grimes wrote: >> from Nick Wolff: >> >>> Yes this is no issue just need to make sure you don't have an default route >>> on your Ethernet interface(May need to set a static) and that the hotspot >>> network and intranet network doesn't overlap. >> >> To use the ethernet, I believe I need >> >> route add default 192.168.0.1 >> >> if I don't use dhclient. >> >> How do I avoid this, and then how would I add route for the hotspot network? > > One of the night mares of trying to get 2 interfaces that > either one is using DHCP to play nice togeather is > a royal PITA as we have no way to ignore a default route > from a DHCP server. > > Our (the freebsd) dhclient is lacking in this area, this problem has > been solved in several other implementations. In fact, we have the they to ignore a default route from a DHCP server. Our DHCP client does NOT install any routes by itself. It merely passes routing info to shell script /sbin/dhclient-script that contains many distinct shell functions and allows user to override any function such as one rewriting /etc/resolv.conf or another adding routes including default one. One may create /etc/dhclient-enter-hooks script overriding some of noted functions. For example, to prevent DHCP client from touching /etc/resolv.conf in case you run your own DNS recursor at localhost: add_new_resolv_conf() { return 0 } Same way one may override following function that is called with "new_routers" variable to NOT change default route or change it conditionally etc. This feature is documented within dhclient-script(8) manual page liked with dhclient(8). I use this in production without any problem.