
You can check if its already established routes to the VLAN subnets by using the show ip route command. Router(config-subif)#encapsulation dot1q 20 Router(config-subif)#encapsulation dot1q 10 Then, configure the subinterfaces for each VLAN on the trunk. %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up It is advisable to use a router with a Gigabit Ethernet interface if you are handling large amounts of data transfer.įirst thing is to bring up the trunk port: Router#conf t We will now go inside the router to configure the 802.1Q trunk.
Use the ip address address mask command to configure the IP settings. Use the encapsulation dot1q vlan_id command to enable 802.1Q trunking and associate each VLAN with the subinterface. Use the interface type number.subint command in global configuration mode to create a unique subinterface for each VLAN to be routed. PC2 has an IP of 10.1.10.2 and it belongs to VLAN 20, it can successfully ping PC3 which is on the same VLAN 20 but cannot ping PC1 and PC2 which are on VLAN 10. We will assign static IPs to the machines for now to show that computers inside each VLANs have connectivity with each other but they are unable to reach computers on a different VLAN. It will look something like this: Switch#show vlan briefġ default active Fa0/1, Fa0/6, Fa0/7, Fa0/8ġ0 Payroll-dept active Fa0/2, Fa0/3 20 Marketing-dept active Fa0/4, Fa0/5 So, when you now issue the show vlan brief command. We will then assign ports fa0/1-2 to VLAN 10 and ports fa0/4-5 to VLAN 20. This will create VLANs 10 and 20 with their corresponding names, descriptions and ip address. Switch(config-if)#description ***Marketing-dept*** Switch(config-if)#description ***Payroll-dept*** You will then issue the commands: Switch#conf t In our case, there are no pre-configured vlans. Let’s get inside the switch to create the VLANs 10 and 20 and assign machines into it.įirst, issue the show vlan brief to command to check for any existing vlans. We will then configure 802.1Q trunking on the router and switch. Our network topology will consist of a router and a switch with VLANs 10 and 20, having two computers each. The router then treats the frames tagged with VLAN 10 as if they came in or out of G0/0.10, and the frames tagged with VLAN 20 as if they came in or out G0/0.20. Looking at the figure above, two subinterfaces, named G0/0.10 and G0/0.20 are created for the router to be able to route to VLANs 10 and 20. The router creates multiple virtual router interfaces that is associated with each VLAN on the trunk, and then it treats all frames tagged with that VLAN ID as if they came in and out of that subinterface. You will use a router to be able to route between the VLANs for your servers and client data instead of using a layer 3 switch.
It simply means routing within your network between VLANs. ROAS is usually used in small to medium sized organizations that wants to implement inter-VLAN routing. It uses a router VLAN trunking configuration to give the router a logical interface connected to each VLAN. Router-on-a-stick (ROAS) is a feature that allows us to route packets to subnets associated with VLANs connected to a router 802.1Q trunk. And on the right side of the figure, each router has a VLAN trunk to connect and route for both VLANs. Two of the switches act as Layer 3 switches, combining the functions of a router and a switch, routing between all 12 subnets/VLANs. The figure shows a central site campus LAN on the left with 10 VLANs.
The example network below shows what the second and third option looks like.
Use a router with a VLAN trunk connected to a LAN switch. Use a router, with one router LAN interface and cable connected to the switch for each and every VLAN (typically not used). There are three options available for connecting a router to each subnet on a VLAN: The hosts inside each subnet can then use the router IP addresses as their default gateways, respectively. Each VLAN is a separate subnet and in order to route IP packets in and out of those VLANs – or more accurately, the subnets that sit on each of those VLANs – some router needs to have an IP address in each subnet and have a connected route for each of those subnets. Router on a stick is a network configuration used to allow the routing of traffic between different VLANs.Īlmost all enterprise networks use VLANs which stands for Virtual Local Area Network.