On 2015/12/23 09:22, Timo Myyrä wrote: > Ok, so failover trunk doesn't quite get me where I want. Gotta see if I can > find > time to tweak my network config now that I have better understanding about the > trunk. Hmm, could probably add ifstated to monitor em0 up/down messages and > use > that to trigger the dhclient runs.
Failover trunk used to be the best way to do it, but things have moved on and nowadays I'd only use that if I have two wired interfaces and need to use the same IP whichever interface I'm currently using (usually just for servers). The normal way in recent OpenBSD versions is to just run dhclient on both interfaces. The wlan interface has a lower priority and this gets carried across to the route priority, so wired is preferred when it's up. No more MACs moving between switch ports like you get with trunk, avoiding issues with some network setups. There's a remaining problem of reaching hosts in an interface's directly- connected subnet when that interface is down - route table like so: Destination Gateway Flags Refs Use Mtu Prio Iface default 10.15.8.254 UGS 1 9 - 12 iwn0 default 10.15.5.1 GS 5 22 - 8 em0 10.15.5/24 10.15.5.85 C 0 29 - 4 em0 10.15.5.85 f0:de:f1:f9:a7:52 UHLl 0 2 - 1 em0 10.15.5.255 10.15.5.85 Hb 0 0 - 1 em0 10.15.8/22 10.15.11.196 UC 1 3 - 4 iwn0 10.15.8.254 00:00:5e:00:01:42 UHLc 1 2 - 4 iwn0 10.15.11.196 8c:70:5a:62:b7:f8 UHLl 0 2 - 1 iwn0 10.15.11.255 10.15.11.196 UHb 0 0 - 1 iwn0 what I usually do if this happens and I need to access a host in the same network is to 'ifconfig em0 delete' (which triggers dhclient to terminate itself), and re-run dhclient when I reconnect. This could be automated by using ifstated but I haven't been sufficiently annoyed by it yet to do so. Though it would be better to fix it in the kernel than paper over it with ifstated.