How can I connect one VLAN to two different routers ports? Should I do it, or will be better if I connect switches with each other and then connect one of them into router?
3 Answers
You can, and you should. If the switches are stacking switches then you can even have the ports on 2 separate switches. It's a rather simple port-channel configuration on the router and switch. Cisco has a document explaining this, Configuring EtherChannel and 802.1Q Trunking Between Catalyst L2 Fixed Configuration Switches and a Router (InterVLAN Routing).
interface Port-channel1
switchport trunk native vlan 10
switchport mode trunk
no ip address
flowcontrol send off
!
interface FastEthernet0/1
no ip address
!
interface FastEthernet0/2
switchport trunk native vlan 10
switchport mode trunk
no ip address
channel-group 1 mode on
!
interface FastEthernet0/3
switchport trunk native vlan 10
switchport mode trunk
no ip address
channel-group 1 mode on
And on the router:
interface Port-channel1
no ip address
hold-queue 150 in
!
interface Port-channel1.10
encapsulation dot1Q 10 native
ip address 10.10.10.1 255.255.255.0
!
interface Port-channel1.20
encapsulation dot1Q 20
ip address 10.10.11.1 255.255.255.0
!
!--- Output suppressed.
!
interface FastEthernet3/0
no ip address
channel-group 1
!
interface FastEthernet4/0
no ip address
channel-group 1
-
Per the comment, the router is an 1841. It doesn't support a layer-3 EtherChannel, but it can support a layer-2 EtherChannel with a minimum IOS version (12.3(8)T for 1800/2800).– Ron Maupin ♦Commented May 22, 2016 at 0:23
-
I'd try it as there is not alot of documentation. It is an older platform. They stopped selling them back in 2011... Commented May 22, 2016 at 1:52
-
There is a table in Understanding Layer 3 EtherChannel Support on the Cisco Integrated Services Router will explains this.– Ron Maupin ♦Commented May 22, 2016 at 2:00
If you mean should you use a router to connect two separate switches to each other at Layer 2 then probably not no.
A router is designed to be a gateway between two different layer two domains rather than linking them at Layer 2.
If you want the VLAN on each switch to be a single VLAN spanning both switches then connect them to each other. If you want to use the same VLAN ID to provide two separate VLANs, one on each switch, with different subnets assigned, then sure go via the router.
All that said, you can often make a router bridge two interfaces together, which is effectively making the router ports "switch", as switches are just bridging really. In Cisco land, they call this integrated routing and bridging.
Switches are designed to switch within VLANs, and routers route between networks (VLANs). Cisco routers can bridge, but that is an expensive way to switch. You didn't say what router model, so I can't be specific on how to do it.
-
I used Cisco router 1841, but if you right and this not best idea I have another question. Should I connect two switches with each other and then connect one of them into router? Or exist better way? Commented Dec 23, 2015 at 4:39
-
There is noting wrong with connecting switches to each other with one connected to the router, as long as you understand that failure of the first switch will keep both from the router. A better way would be to have two separate VLANs, each switch on its own VLAN and router connection. Very little today actually requires being on the same layer-2 domain.– Ron Maupin ♦Commented Dec 23, 2015 at 4:44