Documente Academic
Documente Profesional
Documente Cultură
This is how to configure VLAN on Cisco Switch or Virtual LAN on Cisco Switches in your
network. A VLAN is a switched network that is logically segmented by function, project team,
or application, without regard to the physical locations of the users. VLANs have the same
attributes as physical LANs, but you can group computers even if they are not physically located
on the same LAN segment. Any switch port can belong to a VLAN, and unicast, broadcast, and
multicast packets are forwarded and flooded only to end stations in the VLAN.
Each VLAN is considered a logical network, and packets destined for stations that do not belong
to the VLAN must be forwarded through a router or bridge or layer 3 switches. Because a VLAN
is considered a separate logical network.
Here we just configure VLAN on Cisco switch and not talking about VTP, STP, and other
advanced Switching techniques. It is the basic VLAN configuration. Read more about VLAN on
Cisco Packet Tracer CCNA Lab.
1. Open the VLAN lab and create these three VLAN and named Marketing, Accounting, and
Sales. So let’s create them with the following commands.
Related Posts
How Hiring Online Physics Tutor will Save You Time and…
4. Just type the “do sh vlan” command from config mod to see whether VLANs are created or
not.
5. Now try to add interfaces to each of these VLANs. All the Interfaces ports are within the
default VLAN and not yet grouped to Marketing, Accounting, and Sales. So try to add an
interface to a VLAN with the “Switchport” command.
I have added the [fastEthernet 0/5] and [fastEthernet 0/6] to VLAN 2 which is our Marketing
VLAN. In this method, we add each interface one by one, but you can use “Interface range”
command to add a group of ports to a VLAN.
Now you can set up VLAN on your network Switches. The next step is configuring Inter-VLAN
Routing. I hope you find this article helpful and do comment us about the qualities and
improvements of Technig articles.
Configure Inter VLAN Routing on Cisco
Router and Layer 3 Switches
By Shais Last updated Jun 1, 2017
A step by step guide to configure Inter-VLAN Routing on the Cisco router or layer 3 switches.
Basically, on a VLAN, no host can communicate with hosts within other VLANs. It means only
hosts that are members of the same VLAN can communicate with each other. So if you want
your VLANs hosts can communicate with each other, you must configure inter-VLAN routing
using a router or a layer 3 switch. Here we completely demonstrate the Inter-VLAN
configuration using a Cisco router and a layer 3 switch.
The router you are using for Inter-VLAN routing must be compatible and support Inter-Switch
Link (ISL) which is a Cisco Systems proprietary protocol, and IEEE 802.1q frame format
for routing on the Fast Ethernet interfaces. In Inter-VLAN the physical Fast Ethernet interface of
the router is divided into sub-Interfaces for each VLAN. You can set IP address for each sub-
Interface in order to route between VLANs.
1. First of all, create two VLAN in the switch and named VLAN A and VLAN B with the
following command.
Sw itch>enable
Sw itch#configure terminal
Enter configuration commands,
Sw itch(config)#vlan 2
1 Switch>enable
2 Switch#configure terminal
3 Enter configuration commands, one per line. End with CNTL/Z.
4 Switch(config)#vlan 2
5 Switch(config-vlan)#name VLAN-A
6 Switch(config-vlan)#vlan 3
7 Switch(config-vlan)#name VLAN-B
8 Switch(config-vlan)#exit
2. OK, the VLANs A and B are created successfully. Now check them with “show vlan”
command.
3. You see the result on the screenshot, the VLANs are ready for assigning switch ports to them.
1. Try to assign switch ports for each VLANs with the following commands.
2. Now the port FastEthernet 0/2 and FastEthernet 0/5 are members of VLAN 2 which named
VLAN-A. Go to set the PC3 and PC2 to VLAN-B.
Sw itch(config)#interface range
Sw itch(config-if-range)#sw itch
Sw itch(config-if-range)#sw itch
Sw itch(config-if-range)#exit
Note: The interface range command can assign a range of interfaces to a VLAN. Read more
about basic VLAN configuration on “Configure VLAN on Cisco Switches Using Cisco Packet
Tracer” post.
Assign
Switch Ports to VLAN
4. Now we have just done the basic VLAN configuration like creating VLAN and assigning
switch ports to VLANs. Let’s enable Trunking mode on the switch port to the router and then
configure Inter-VLAN routing on the router.
1. Just navigate to FastEthernet 0/1 interface and type “switchport mode trunk“ the press
enter to enable trunking on Fa0/1 interface line.
Sw itch(config)#interface fastEt
Sw itch(config-if)#sw itchport m
Sw itch(config-if)#
2. Now the VLANs can transmit traffic over the FastEthernet 0/1 without any problems.
Note: Try to enable trunking mode only to interface between to switch or router devices. It’s not
necessary to enable it on the interface of the switch to PC.
1. Try to assign an IP address to the router and enable the interface you want to configure inter-
VLAN routing.
Related Posts
How Hiring Online Physics Tutor will Save You Time and…
VLAN Routing
Router>enable
Router#configure terminal
Enter configuration commands,
Router(config)#interface fastEth
1 Router>enable
2 Router#configure terminal
3 Enter configuration commands, one per line. End with CNTL/Z.
4 Router(config)#interface fastEthernet 0/0
5 Router(config-if)#ip address 192.168.10.1 255.255.255.248
6 Router(config-if)#no shutdown
2. Good, the IP 192.168.10.1 with the subnet mask of 255.255.255.248 is assigned for physical
FastEthernet 0/0 interface.
Note: We need to have subinterface for each VLANs on the router. The subinterface is a virtual
interface card that inter-VLAN doing routing using them.
3. Now try to create a subinterface for each VLAN with interface command and assign IP
address from the different network for each VLAN. In this case, I have subnetted the
192.168.10.0/24 IP address to 3 networks.
Router(config)#interface fastEth
Router(config-subif)#
Router(config-subif)#encapsula
Router(config-subif)#ip address
4. See the result with “do show ip interface brief” from sub-interface area.
Create Sub-Interface
The virtual sub-interface FastEthernet0/0.2 has created and it has the 192.168.10.9 IP address.
This sub-interface act as a default gateway for VLAN-A with an address of 192.168.10.8/29.
6. Everything is fine, but you see the error with red color! It is because we forgot to set the
encapsulation dot1Q command. Before assigning an IP address to a sub-interface, you
should set IEEE 802.1q with encapsulation command.
Finally, all VLANs hosts can communicate with each other. That’s all you need to configure
Inter-VLAN routing on your corporate network. Download the complete Lab of Inter-VLAN
routing Cisco Packet Tracer Lab. Follow the below steps if you want to configure inter-VLAN
on Layer 3 Switches or troubleshooting inter-VLAN on routers and switches.
To configure Inter-VLAN routing using layer 3 switches, you don’t need router anymore. All
configuration has done within the layer 3 switch.
Sw itch(config)#interface vlan 1
Sw itch(config-if)#ip address 19
Sw itch(config-if)#no shutdow n
1 Switch(config)#interface vlan 1
2 Switch(config-if)#ip address 192.168.10.4 255.255.255.248
3 Switch(config-if)#no shutdown
Check it with “do show ip interface brief” command, whether the default VLAN 1 has gotten
the IP address of 192.168.10.4/29 or not.
Default
VLAN 1 – Configure Inter-VLAN Routing
Yes, that’s fine. This can help you remotely configure VLANs through the internet or network.
To see the VLANs on a switch, type the “show vlan” command. This command will list all
created VLANs within a switch.
The “show interface trunk” command shows encapsulation and trunking status.
The “show interfaces fastEthernet 0/1 switchport” display the status of a specific switch port.
See the result on the screenshot.
Configure Inter-VLAN routing –
Encapsulation Status
OK, I think it’s enough for Configuring Inter-VLAN routing. I hope you find this configure
Inter-VLAN routing article’s helpful and if you have any problem or question regarding this
article, ask us through the comment section.