Roaming between LAN and WLAN

If your LAN and WLAN networks are on the same subnet, you can use a trunk(4) interface for seamless switching back and forth. For example:

Wired interface /etc/hostname.re0 (just up, no IP):

up

Wireless interface /etc/hostname.ral0 (same here, only link settings):

nwid myssid
pwakey secret
up

Trunk interface /etc/hostname.trunk0 (including IPv4 and IPv6 autoconfiguration):

trunkproto failover
trunkport re0
trunkport ral0
dhcp
rtsol autoconfprivacy

Here is re0 a prefered and ral0 a fallback interface (order is important). I.e. the trunk switches seamless to the wireless interface if the wired interface gets disconnected and back to it if the link is available again.

By Dimitri Sokolyuk
Related articles