Fri Mar 03, 2023 5:53 pm
Everything I write here assumes the switch is strictly operating as a switch - the case if using SwitchOS.
I'm assuming your question involves a situation where a switch has multiple VLANs and a trunk to a router that among other tasks, routes traffic between VLANs. This is exactly my situation at home.
If there are multiple devices plugged into ports on the switch on for example VLAN 101, those devices do not need the router in order to communicate with each other. Similarly, multiple devices on VLAN 102 will be able to communicate with each other without needing the router. However devices on VLAN 101 can not communicate with devices on VLAN 102 without going through the router. So if the router fails or is disconnected, devices on VLAN 101 will not be able to communicate with devices on VLAN 102, even though they are plugged into the same switch (but on different VLANs). Easy way to think of it, each VLAN in a managed switch can be thought of as a separate switch. That's not entirely true, but for practical purposes, it can be thought of that way.
Note that besides routing between different VLANs, the devices plugged into the switch may well need the router for other services besides routing between VLANs or other LANs that do not involve the switch. For example, DHCP, DNS, Internet connection, etc. Some of those other services may prevent connectivity even though the devices are on the same VLAN on the switch. For example, if you use DHCP and the router fails, any new devices on the switch won't get an IP address.