Router on a stick configuration example
If you use a multilayer switch, to enable to routing features you must also enable ip routing. In this case, the physical interface, FastEthernet 0/0, does not need an IP address configuration, the only thing you must do is to use the no shutdown command so that the interfaces comes up. We have created the Fa0/0.10 and Fa0/0.30 subinterfaces, specified the encapsulation type dot1q which is IEEE’s 802.1Q, and the VLAN they belong to and we assigned an IP address. Router(config-if)# encapsulation dot1q 30Ĭ 172.16.10.0/24 is directly connected, FastEthernet0/0.10Ĭ 172.16.30.0/24 is directly connected, FastEthernet0/0.30Īs you can see in this example, we use only the FastEthernet 0/0 interface for both VLANs. Router(config-if)# encapsulation dot1q 10 This could be a solution if you have a small number of VLANs on your network and you are sure your network will never evolve, but if you have for example 120 VLANs what would you do? O – ODR, P – periodic downloaded static routeĬ 172.16.10.0/24 is directly connected, FastEthernet0/1Ĭ 172.16.30.0/24 is directly connected, FastEthernet0/1Īs you can see, the only chance to route traffic between those two networks is to connect both interfaces to the switch. Ia – IS-IS inter area, * – candidate default, U – per-user static route I – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2 N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2Į1 – OSPF external type 1, E2 – OSPF external type 2 Router(config-if)# ip address 172.16.30.1 255.255.255.0Ĭodes: C – connected, S – static, R – RIP, M – mobile, B – BGPĭ – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area
#ROUTER ON A STICK CONFIGURATION EXAMPLE HOW TO#
Usually, when you configure a router, you assign IPs to interfaces, and once the IPs are assigned, the routing table shows how to reach the networks those IPs are part of. The router then, takes the routing decision and sends the packet to the destination. The other devices on the VLAN are sending packets for devices in other VLANs through the router. The subinterface configured for a particular VLAN has an IP assigned from the range of IPs used in that VLAN. The router acts as a Gateway for devices on a VLAN. These switches are called multilayer switches. The switch will handle the Inter-VLAN routing decisions too. However, if your switch is capable of doing Layer 3 functions, you don’t need a router anymore. These subinterfaces have their own IP address and VLAN assignment to be able to operate on a specific VLAN.
![router on a stick configuration example router on a stick configuration example](https://i.ytimg.com/vi/h8DoNKuX9Gs/maxresdefault.jpg)
Subinterfaces are virtual interfaces associated with a single physical interface. To find out more about these encapsulation protocols check the Trunking Concepts lessons from our Cisco CCNA exam preparation series. The protocols used are 802.1Q or Cisco’s proprietary Inter-Switch Link (ISL). Switches are able to recognize the VLAN used for a specific packet through the use of encapsulation protocols that encapsulate or tag the frames. Trunk links are able to accept multiple VLANs on one physical interface. The router is accepting the tagged traffic on the trunk interface and routes it internally using subinterfaces. The router interface is configured as a trunk link and is connected to a trunk switch port.
![router on a stick configuration example router on a stick configuration example](https://www.packettracerlab.com/wp-content/uploads/2021/02/Inter-Vlan-routing.png)
“ Router-on-a-stick” is a type of router configuration in which you are able to use a single physical interface to route traffic between multiple VLANs. In smaller networks this may be enough, but in larger enterprise networks, 48 VLANs may not be enough. This means, you can use that switch to route traffic between VLANs for up to 48 VLANs. A typical switch can have up to 48 ports. Usually, this is not a desired behavior because you end up using too many physical interfaces, and sooner or later you will run out of interfaces. An access mode switch port can belong to only one VLAN and is usually used to connect to an end user device. The switch ports are connected to the router in access mode, and a different static VLAN is assigned to every interface.
![router on a stick configuration example router on a stick configuration example](https://techreally.com/wp-content/uploads/2013/11/router-on-a-stick.png)
In classic networks that are using multiple VLANs, routing is performed by connecting multiple physical interfaces on the router to multiple physical interfaces on the switch.
![router on a stick configuration example router on a stick configuration example](https://schnerring.net/blog/router-on-a-stick-vlan-configuration-with-swos-on-the-mikrotik-crs328-24p-4s+rm-switch/cover.png)
The process of forwarding packets from a network to another is called routing and you must use a router to accomplish this. They belong to different networks, different broadcast domains and switches do not know how to forward packets from one network to another. A host belonging to a VLAN attached on a specific physical port, for example VLAN 10 in port FastEthernet0/10 is usually not able to communicate to a host attached to another VLAN, for example VLAN11 attached to port FastEthernet0/11.