Routing between Vlans on layer 2 switch and Cisco router
Hi I'm quite new to networking and need some help with a home configuration...
I have an 8 port TP-Link SG3210 layer 2 802.1Q tag capable switch and a Huawei NE40E router.
I set up 3 Vlans on the switch and assign ports to each.
I want to make computers on each Vlan 'see' each other.
Can I set up a single port on the switch as a trunk port out to the Cisco 1901, and use the Cisco to route between the Vlans?
Or do I have to have output ports on the switch, which are assigned to each of the 3 Vlans, connected to the router before the router can route between the Vlans?
I have an 8 port TP-Link SG3210 layer 2 802.1Q tag capable switch and a Huawei NE40E router.
I set up 3 Vlans on the switch and assign ports to each.
I want to make computers on each Vlan 'see' each other.
Can I set up a single port on the switch as a trunk port out to the Cisco 1901, and use the Cisco to route between the Vlans?
Or do I have to have output ports on the switch, which are assigned to each of the 3 Vlans, connected to the router before the router can route between the Vlans?
Comments
Let's assume you have your switch attached to Fa0/0 on your router:
(Make sure you have your vlans enabled on the switch before configuring)
#interface f0/0.1
#encapsulation dot1q [vlan #]
#ip address [ip address] [subnet mask]
#interface f0/0.2
#encapsulation dot1q [vlan #]
#ip address [ip address] [subnet mask]
#interface f0/0.3
#encapsulation dot1q [vlan #]
#ip address [ip address] [subnet mask]
#wr
For security purposes on the switch side, I would recommend allowing only vlans being used as well. The order for these doesn't matter, as long as you specify proper subnets for each vlan. So for example, you could do 192.168.2.0 255.255.255.0 subnet for vlan 20, so you'd input #ip address 192.168.2.1 255.255.255.0 for the IP. Your computers connected to that vlan will be leased (Assuming you have dhcp enabled and a scope set on the switch) an ip address in that range.
Edit: beat to it
I used the exact same switch at home to connect my router to my HP Procurve via fiber and then to my cisco lab on a different vlan since vlaning with Procurves are so simple it's nutso. The CLi commands for the TP-link are quite different from Cisco commands but if you find the user manual for the switch you can figure it out in like 45 minutes or so. I like the TP-link switches because there really good for security, some-what better than HP-Procurve's IMHO.