Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jun 2019 10:16:58 +0700
From:      Eugene Grosbein <eugen@grosbein.net>
To:        "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>, Thomas Mueller <mueller6722@twc.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Can Ethernet and wi-fi be used concurrently?
Message-ID:  <0e8ebf6b-56fd-d6ea-906b-5af1c8fa54ab@grosbein.net>
In-Reply-To: <201906242016.x5OKGC0n045598@gndrsh.dnsmgr.net>
References:  <201906242016.x5OKGC0n045598@gndrsh.dnsmgr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0e8ebf6b-56fd-d6ea-906b-5af1c8fa54ab>