On Sat, Jul 21, 2018 at 07:49:48PM +0200, vincent delft wrote: > Hello Peter, all, > > I've just tested auto-join since 13 of july. > First of all. THANKS !!! It works great. > > This email is just because I've observed 2 strange situations. > I don't know if this is linked to auto-join or if this caused by errors on > my setup. > > > 1) > egress group is not following the connected interface. > To reproduce it, just establish a connection via a cable. ifconfig will > show you that egress group is on that connection. > Pull-off the ehternet cable and run "doas sh /etc/netstart". > The system will switch perfectly to the wifi connection described in the > hostname.if file. > But, if I do a ifconfig, I still see the egress group on the cable > interface. > This was not my expectation. I thought that the egress group will switch > too to the new running interface. > > 2) > Time to times, the connection is correctly established on the correct > interface (for example from cable to wifi), but arp shows that the arp > table for few machines remains on the wrong interface. > I have to run "doas arp -ad" several times to remove this bad entry in the > arp table. > Is there a better way to avoid such situation ?
Wifi has nothing to do with where the default route points to. The wifi stack only handles the link layer, ie. it works on a per-interface basis and only cares about wifi interfaces going up and down. Your questions concern routing decisions at the IP layer, which sits above the wifi layer and is managed by tools such as ifconfig and dhclient. In order to switch between different IP networks you need to kill dhclient on the wired interface and delete addresses and perhaps flush routes. Perhaps a trunk(4) in failover mode with a wired and wifi interface will do what you want. See the EXAMPLES section in the trunk(4) man page.

