Can Ethernet and wi-fi be used concurrently?
Eugene Grosbein
eugen at grosbein.net
Tue Jun 25 03:17:32 UTC 2019
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.
More information about the freebsd-net
mailing list