Router on stick with two switches

Answered Question

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?

Attachment: 
Correct Answer by Jon Marshall about 7 years 3 months ago

[email protected]


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

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Jon Marshall Fri, 02/26/2010 - 06:22
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

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

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?

Correct Answer
Jon Marshall Fri, 02/26/2010 - 07:18
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

[email protected]


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

Actions

This Discussion