Sei sulla pagina 1di 5

Three methods to Route between VLANs

1. Separates Port to Each VLAN on the Router. 2. Router-ON-A-STICK. 3. Layer 3 Switching. For CCNA Exam you should be able to route through VLANs through number 1 & number 2, but for number 3 its in CCNP. 1- Starting with Separate Port to Each VLAN:

We have got two VLANs (50,51), were PC (192.168.1.50) is assigned to VLAN50, and the other PC (192.168.2.50)is assigned to VLAN51, now we can go to our router and configure their port to the perspective IP address as the same Subnet of the PC. Also the ports of the Switches will be assigned to VLAN50 and the other port will be assigned to Port VLAN51, the two PC will have a Default Gateway IP address as example the PC (192.168.1.50) will have a default GW 192.168.1.1. The problem in doing separate port for Each VLAN is that its neither Practicable nor its Scalable, meaning the more VLANs you add it will need more Ports to be connected to the router and that means you need a Router with a large number of interfaces supported and that will be Extremely Expensive, thats why Cisco came out with the Method number2 which is Router ON A STICK.
2- Router ON A STICK

What we do is we configure a Trunk connection to the router, now remember that TRUNK connection forwards all the VLANs Traffic, so if one of the PC wants to communicate with the other PC it will send the Traffic to the Default GW IP address through the Trunk port, we will explain later how its Configured.
1

3- Layer 3 Switching

Layer3 Switch is a (Router inside a Switch), instead of having an outside Router, we create a VLAN interfaces on that Layer3 Switch that is reachable by everything inside that VLAN.

Understands how a Router-On-A-Stick works

Router on a Stick method offers a routing between different VLANs, the ports between the Router and the Switch should be a Trunk port, and the interface should be FastEthernet or greater such as GigaEthernet, it will not work on Ethernet interface.

If VLAN50 is on Subnet 192.168.1.0 & VLAN51 is on Subnet 192.168.2.0, now what IP will the interface of the router to be configured?? NONE, cause we dont configure the physical interface of the router, but we configure the Subinterface of the router. Now accessing a Router from our previous Network, and we will configure Router as the Router on a Stick, and the F0/0 will be our Trunk Port: (here R2 is the Router)

Now first we check the interface F0/0, what IP address is configured in it.

R2#show ip interface brief

As you might see that FE0/0 has IP address 192.168.1.2, what we will do now is start creating Subinterface under that interface, so we will do the following Command.

R2(config)#interface fastEthernet 0/0.? (0-4294967295) fastEthernet interface number

As you might see there is a HUGE numbers of Sub-interfaces we may create it under the Main

If we tried to create the Subinterface 20 under the Fe0/0 and assign them an IP address as follow you will find that the following Message Appears:

R2(config)#interface fastEthernet 0/0.20 R2(config-subif)#ip address 192.168.20.1 255.255.255.0 %configuring IP routing on a LAN subinterface is only allowed if that subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q, or ISL vLAN.

This message means that I need to tell this router that this sub-interface will respond to Packets comes from a Specific VLAN; so the way we will do that is as following:
R2(config)#encapsulation dot1Q 20

What I have done is set the type of Encapsulation will be used on that Interface for VLAN 20 and that tells the router to response to packets coming from VLAN20 Specifically. The message appears below the command we type will be described later. Now we may assign our Sub-interface IP address normally:

R2(config-subif)#ip address 192.168.20.1 255.255.255.0

Now we will create our other Sub-interface and assign to it IP address normally, this Sub-interface will be created on the same Interface FE0/0.

R2(config)#interface fastEthernet 0/0.10 R2(config)#encapsulation dot1Q 10 R2(config-subif)#ip address 192.168.10.1 255.255.255.0

Now when we do the following command:

R2(config)#show ip interface brief

You will find out that the two Sub-interfaces we created should be appear in the table with their respective IP address.

Now all I have to do is assign the Default GW for the PC in VLAN20 to 192.168.20.1 & assign the Default GW for the PC in VLAN10 to 192.168.10.1.

Now we will describe the following paragraph why it did previously appears:

By default the biggest number of bytes can be send on Ethernet is 1500 Bytes, but when you enable the VLAN Mode and the switch will start to put the (4BYTES) of data for VLAN information over the 1500 bytes, you actually increase the size of the packet to 1504 Bytes, so that message says its better that the switch and the router be able to handle that Size of Packets.

In Cisco devices its done Automatic once you enable this feature, the Cisco Devices Automatically make the Maximum packet size (MTU) Maximum Transmission Unit is 1496Byte so when the 4 Byte is added it will be in total 1500 Byte.

Now if I ping from PC 192.168.20.20 to the Default GW of that PC which is 192.168.20.1, there should be a reply. And try to Ping from the PC 192.168.20.20 to the other VLAN which is 192.168.10.1, again there should be a reply. The reason why all those VLANs 10 & 20 are able to communicate with each other is because Router2 knows their route in its Routing table, so if we done the following command, you will find that the router had learned Two network address which are 192.168.10.0 & 192.168.20.0 and the type of Connection is C which Is directly connected through Sub-interface as following:
R2(config)#show ip route

Now if we ping on 192.168.1.1, from PC 192.168.20.20. It will give Request Timed Out. The reason why is because R1 doesnt know how to reach to the Route Network 192.168.20.0 because its not present in its Routing Table.
So we will add that Network by Static Route as Following:
R1(config)#ip route 192.168.20.0 255.255.255.0 192.168.1.2

The above Static Route will able the router to reach the network 192.168.20.0 through the Interface of Router2 F0/0.

Now we will try to Ping Again, then its successful. try to use Tracert from the PC 192.168.20.20 to the IP 192.168.1.1, That proof that the packets is going through the Router On A Stick (192.168.20.1), and then jump to the IP address 192.168.1.1

Potrebbero piacerti anche