1

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?

3

The router address for a network can be any valid host address in the network. Some people always use the first host address, and some people always use the last host address, but it does not matter what host address, although you should be consistent. The router address for the network is the address that you use as the gateway address for the hosts on that network.

For your switch, you set up an SVI for one of the VLANS, and the address is a valid host address for that network. You also set the switch default gateway as the router address for that network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.