TCP/IP – VLAN Routing
«Would a single VLAN have a single IP, and thus I setup VLAN 10 on Switch 1 as having 192.168.0.1 as the IP, and then do the same on Switch 2? Wouldn’t that then create duplicate IP’s on the same subnet?»
No—I can show you an example in a Cisco L3 switch…or L2 with router-on-a-stick, for that matter. Let’s do the L3…
This is the IP address of the vlan. Then make access ports for the switchports…
and for all the rest of the switchports. Then the trunk…
Since the info is trunked to a second switch, all that is needed would be to make an access switchport for vlan 20, and the rest of the info is trunked across. I have usually seen DTP and VTP configured, so that there is a VTP domain with a VTP server with all the main VLAN info on it, and it sends the vlan info via a trunk. DTP will dynamically negotiate ports to either be a trunk or not a trunk.
Finally, which some people miss (actually a question on one of the CCNP tests!), enable ip routing
only for a L3 switch. This just tells the switch to route its own vlans.
«My query is regarding the default gateway… If I give the LAN vLAN an IP on the first switch of 172.16.0.1, then I assume that the clients on the same VLAN use that as the default gateway?»
Yes.
«If that’s correct, then what do I do about the same vLAN on the second switch? Does it get a different IP (say 172.16.0.2)? If so, what does that mean for any client machine that are in the LAN vLAN but are physically plugged into the 2nd switch? Do they use 172.16.0.2 as their default gateway?»
Answered in the first part of this post—the second switch gets info from the trunk.
Source: