I've been studying VLANs and the router on a stick setup.
I created an example in packet tracer that is working fine.
Configuration
There are 2 VLANs, 10 and 20.
The switch port Fa0/0 is an access port in VLAN 10 and port Fa0/1 is an access port in VLAN 20.
The switch is connected to the router via switch port Gig0/1 as a trunk.
The router port that connects to the switch, Gig0/0 has two subinterfaces, Gig0/0.10 (IP 192.168.10.1) and Gig0/0.20 (IP 192.168.20.1).
A client on switch port Fa0/0 on VLAN 10 would have an ip in 192.168.10.0/24 and the default gateway would be 192.168.10.1.
A client on switch port Fa0/1 on VLAN 20 would have an ip in 192.168.20.0/24 and the default gateway would be 192.168.20.1.
Question
In such a configuration, what addresses are used by the router and switch?
I would assume that the router would be reachable at the default gateway addresses 192.168.10.1 and 192.168.20.1? If not, how would I reach the router?
As for the switch, it doesn't appear to have an IP address in this setup. How then in a real-world situation would one access it over the network? I read somewhere to give it a static DHCP mapping outside of the DHCP pool. Does that mean using an entirely different subnet?