03-18-2014 02:13 PM - edited 03-07-2019 06:46 PM
i have 2 setups and i want to make sure i have the right strategy to implement inter vlan routing
first setup : router connected to 3 access switches
-on each main interface i will create several sub-interfaces, one for each vlan, with encapsulation dot1q and an ip address from the assigned subnet for the vlan
- on the switch, i will just create the vlans
Qs:
1- is this correct?
2- for example, if the subnet assigned to vlan 1 is 1.1.1.0/26.. shall i configure an ip address 1.1.1.1/26 for the subinterface connected to the first switch and 1.1.1.2/26 for the subinterface connected to the second switch ?
second setup: router connected to a distribution switch and then to 3 access switches. pretty much like the first setup with the addition of the distribution switch
Qs: what is the configuration required between the DW switch and the router and the DW switch to each access switch ?
03-18-2014 02:30 PM
Qs:
1- is this correct?
2- for example, if the subnet assigned to vlan 1 is 1.1.1.0/26.. shall i configure an ip address 1.1.1.1/26 for the subinterface connected to the first switch and 1.1.1.2/26 for the subinterface connected to the second switch ?
You can't do this because the router will not let you assign multiple interfaces/subinterfaces from the same IP subnet.
So for the same vlans/IP subnets you can only really connect one switch with a trunk link to one router interface and create the subinterfaces and then connect the other switches to this switch using trunk links as well.
In terms of a distribution switch it depends on whether the switch is going to route the vlans as opposed to doing it on a router.
Jon
03-19-2014 02:26 AM
the router will act as the default gateway and dhcp helper for each vlan. so it is will be responsible for routing between vlans.
the router connected to 2 or more switches, what do i need to configure on the router and the 3 switches to implement the above ?
03-19-2014 08:55 AM
the router connected to 2 or more switches, what do i need to configure on the router and the 3 switches to implement the above ?
You cannot have the same vlan/IP subnet routed on two separate interfaces on the router because you cannot use the same IP subnet on two interfaces on a router. So you have two choices -
1) if you want to use two router interfaces then per interface you can only route certain vlans/IP
or
2) you use one subinterface and route all the vlans/IP subnets on that one interface
So it depends on -
1) how you connect the switches to each other
2) which vlans you want on which switches
3) how you want to connect the switch(es) to the router
If you could clarify that then we can go from there.
Jon
03-19-2014 09:55 AM
the router is directly connected to 3 access switches.
i have 5 vlans (guest, voip, data,etc..) and management
the switches are not connected to each other, only connected to the router and end devcies
the router will be the gateway and dhcp helper for each vlan
i want the 5 vlans on all 3 switches
03-19-2014 10:01 AM
If you want all 5 vlans on all switches then you need to connect the switches to each other with trunk links allowing those vlans.
In terms of the router connectivity you could split the L3 interfaces for the vlans across the 3 interfaces if you wanted or you could simply use one interface for all the L3 interfaces.
Usually with routing on a stick one interface on the router is used for all inter vlan routing and the router interfaces then connects to a switch with a trunk link. You would then connect the other switches to that switch with trunk links.
That is the only way i have set it up. I have never used multiple interfaces on a router, one for each switch and then also interconnected the switches with trunk links.
That said it may well work okay so if you want we can try that.
Up to you.
Jon
03-19-2014 10:02 AM
By the way, what models are the switches ?
Jon
03-19-2014 01:33 PM
please confirm the following:
1- i will separate the vlans among the switches (for example vlan 1&2 o switch 1, vlan 2 &3 on switch 2etc..)
2-i will create subinterfaces on the router with encapsulation dot1q vlan number and dhcp helper under each subinterface
3- create the vlans on the switches and assign the vlans to the end devices on access ports
Qs:
1- i want to configure the switches to have the router as the default gateway how do i do this?
2- on which switch should i configure the management vlan ? i know i need it to be configured on all but i will face the same problem as before with the ip addressing
03-19-2014 01:42 PM
Both questions relate to the same thing.
If you want a common management vlan for all switches then you cannot use multiple interfaces on the router. Well you can but it would mean interconnecting your switches which it sounds like you don't want to do.
So you may as well manage your switches by putting the L3 SVI on the switch into one of the vlans allowed on that switch and then you point the switch default gateway to the router subinterface IP for that vlan.
Jon
03-19-2014 02:01 PM
Asus you have 2 ways to do this:
1- i will separate the vlans among the switches (for example vlan 1&2 o switch 1, vlan 2 &3 on switch 2etc..)
2-i will create subinterfaces on the router with encapsulation dot1q vlan number and dhcp helper under each subinterface
3- create the vlans on the switches and assign the vlans to the end devices on access ports
===================================================
1. to separate the vlans among switches you would need to give each interface its own network example
int gi0/0 ip address 10.10.10.0/24
int gi0/1 ip address 10.10.11.0/24
int gi0/4 ip address 10.10.12.0/24 etc etc this would be costly and ineffective
this is NOT recommended way to do inter-vlans router on stick method.
2, The correct way to do this is to create sub interfaces on one physical interface
int gi0/0
no shut
int gig0/0.1
ip address 10.10.10.1/24
switchport trunk
switchport encapsulation 802.1q
int gi0/0.2
ip address 10.10.11.1/24
switchport encapsulation 802.1q
int gi0/0.3
ip address 10.10.12.1/24
notice that the third number is changing (you can set up networks however you want but you can NOT do 10.10.10.1 and 10.10.10.2 as that is the same network on 2 different interfaces)
in this case you connect gi0/0 to 1 switch (not to multiple switches to one only) and you configure that switchport to be a trunk port depending on your model it would be an "uplink" port
To give vlan access to your other switches you than configure a different switch port as a trunk and trunk the vlans to the second switch
example
sw1(config-if)int g0/24
description connection to router
switchport mode trunk
etc
sw1(config-if)int g0/23
description connection to sw2 only access vlan 101 & vlan 103 no vlan 102
switchport trunk vlan allowed 101,103
3. Because you want the router to be the DG of all vlans you create the vlan on the router - when you match the trunk ports the switches will than have the vlan db created as well
To configure the DG of each vlan you do this
int vlan x
ip address 192.168.1.2 (note I didnt use 192.168.1.1 that is the router)
default gateway 192.168.1.1
since IM assuming this is a layer 2 switch 2960? than the gateway is simply for management your switch isnt doing routing so the actual devices need to be configured with the correct gateway
You configure the management vlan on the router - as it is the point of contact for all switches.
so physically you connect 1 interface from router to 1 switchport on switch 1 (whatever switch you want that to be) than you connect switch 2 and switch 3 to switch 1 via trunks.
03-19-2014 03:29 PM
so physically you connect 1 interface from router to 1 switchport on switch 1 (whatever switch you want that to be) than you connect switch 2 and switch 3 to switch 1 via trunks.
let me make sure i got you correctly, i will physically connect 3 links one for each switch but i will configure subinterfaces for the vlans on only the first link to the first switch . on the first switch, other than the trunk uplink port, i will configure an extra trunk port to the second and third switch ? is this a physical link between the switches ? or logical through the router? could you provide the config for the other 2 switches ?
regarding the mgt vlan and DG. again let me make sure i got correctly:
1- i already have a subnet assigned for each vlan. on the router, i will configure a separte int vlan for each vlan with the same default gateway of the router
2- do i need to configure anything on the switch for the DG configuration ?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide