02-26-2010 06:19 AM - edited 03-06-2019 09:55 AM
I understand the concept of vlans with a router on stick with one router and one switch but it is possible to connect to switches together and do vlans through the router?
Solved! Go to Solution.
02-26-2010 07:18 AM
So you would need to create two sub interfaces on fa 0/1 and configure the vlan1 interface? Ex. fa0/1.1 172.16.2.1/24 and fa0/1.2 172.16.3.1/24 and vlan1 int 172.16.1.1/24. Configure the fa0/1 as the trunk interface as dot.1q. Connect the fa0/1 to the switch A. Is the connection from the router the only trunk port? Or is the connection between the two switches also a trunk port?
David
In your diagram you only have vlan 2 on the second switch so you could actually configure the ports on that link to be in vlan 2 ie. "switchport access vlan 2". If you had both vlan 1 and 2 clients on second switch then you would need to make the link a trunk link.
If you only 2 vlans then you need either -
1) 2 subinterfaces on the router
or
2) 1 subinterface + the physical interface.
Note if vlan 1 is the native vlan on the trunk and it will be unless you change it then if you use option 1 you need to specify the native vlan eg.
int fa0/1.1
ip address x.x.x.x
encapsualtion dot1q 1 native
int fa0/1.2
ip address x.x.x.x
encapsulation dot1q 2
if you use option 2 then you don't eg.
int fa0/1 <-- if you use the physical it must match the native vlan of the trunk
ip address x.x.x.x
int fa0/1.2
ip address x.x.x.x
encapsulation dot1q 2
Jon
02-26-2010 06:22 AM
David
Yes you can do this. In fact you can have as many switches as you like, as long as the vlans are allowed across the uplinks ie. usually this means trunk links then one router can route for vlans on many switches.
Jon
02-26-2010 07:11 AM
So you would need to create two sub interfaces on fa 0/1 and configure the vlan1 interface? Ex. fa0/1.1 172.16.2.1/24 and fa0/1.2 172.16.3.1/24 and vlan1 int 172.16.1.1/24. Configure the fa0/1 as the trunk interface as dot.1q. Connect the fa0/1 to the switch A. Is the connection from the router the only trunk port? Or is the connection between the two switches also a trunk port?
02-26-2010 07:18 AM
So you would need to create two sub interfaces on fa 0/1 and configure the vlan1 interface? Ex. fa0/1.1 172.16.2.1/24 and fa0/1.2 172.16.3.1/24 and vlan1 int 172.16.1.1/24. Configure the fa0/1 as the trunk interface as dot.1q. Connect the fa0/1 to the switch A. Is the connection from the router the only trunk port? Or is the connection between the two switches also a trunk port?
David
In your diagram you only have vlan 2 on the second switch so you could actually configure the ports on that link to be in vlan 2 ie. "switchport access vlan 2". If you had both vlan 1 and 2 clients on second switch then you would need to make the link a trunk link.
If you only 2 vlans then you need either -
1) 2 subinterfaces on the router
or
2) 1 subinterface + the physical interface.
Note if vlan 1 is the native vlan on the trunk and it will be unless you change it then if you use option 1 you need to specify the native vlan eg.
int fa0/1.1
ip address x.x.x.x
encapsualtion dot1q 1 native
int fa0/1.2
ip address x.x.x.x
encapsulation dot1q 2
if you use option 2 then you don't eg.
int fa0/1 <-- if you use the physical it must match the native vlan of the trunk
ip address x.x.x.x
int fa0/1.2
ip address x.x.x.x
encapsulation dot1q 2
Jon
02-26-2010 08:35 AM
Worked like a charm. Was able to create two dhcp scopes on the router and pass out address to both devices on each vlan. Thanks for your help.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: