Вы находитесь на странице: 1из 16

Capital University of Science and Technology Islamabad

Department of Computer Science,


Faculty of Computing

Lab Manual for Computer Communication & Networks


(LAB-11)
(Configuration of inter Virtual LAN’s)
Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing
Lab 11: Configuration of inter Virtual LAN’s
1. Introduction:

1.1 Inter VLAN’s routing:


When we learnt about VLANs, we said that each VLAN is usually on its own subnet,
switches mainly operate at layer 2 of the OSI model and therefore they do not
examine the logical addresses. Therefore, user nodes located on different VLANs
cannot communicate by default. In many cases, we may need connectivity between
users located on different VLANs. The way this can be accomplished is through
inter-VLAN routing.

Inter-VLAN routing can be defined as a way to forward traffic between different


VLAN by implementing a router in the network. As we learnt previously, VLANs
logically segment the switch into different subnets, when a router is connected to the
switch, an administrator can configure the router to forward the traffic between the
various VLANs configured on the switch. The user nodes in the VLANs forwards
traffic to the router which then forwards the traffic to the destination network
regardless of the VLAN configured on the switch.

1.2 Types of inter VLAN routing:


There are two ways in which inter-VLAN routing can be accomplished.

 Traditional inter-VLAN routing


 Router-on-a-stick

1.3 Encapsulation Dot1Q:


Allows you to use a router interface as a trunk port to a switch. This is also known as
“Router on a stick” because the switch uses the router to route between VLANs.
Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing
2. Tools required:

 CISCO Packet tracer

3. Objective of the Experiment:


Upon completion of this lab, you will be able to

1. Cable a network according to the topology diagram


2. Erase the startup configuration and reload a switch to the default state
3. Perform basic configuration tasks on a switch
4. Create VLANs
5. Assign switch ports to a VLAN
6. Add, move, and change ports.
7. Verify VLAN configuration
8. Enable trunking on inter-switch connections
9. Verify trunk configuration
10. Save the VLAN configuration
11. Connect router with switch
12. Do dot1q encapsulation
13. Do inter VLAN routing

4. Walk through tasks:

4.1 Task1:
Construct a topology that have two switches attached with each other with copper
cross through wire and four PC’s attached with them, a pair with each switch,
configure inter Virtual LAN in this configuration and show the results.

To configure this, we have to execute following steps:

1. Open cisco packet tracer.


2. Add two 2690 switches in the workspace.
Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing
3. Add four generic PC’s in the workspace.
4. Connect two switches with each other using copper cross over wire with fa
0/24 port.
5. Connect each pair of generic computers with switch using copper straight
through wire.
6. The topology should be seen like this:

Figure 1: Shows the topology connection

7. Now add notes on the workspace in the front of every network entity with IP
address and also mention the name of virtual LAN.

8. The workspace should be seen like this:


Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing

Figure 2: shows the captions of the network entities.

9. Click on the switch 1 and go in command line interface


10. Go in the privileged mode by using command enable.
11. Go in the configuration mode by using command configure terminal.
12. Now to give proper name to virtual LAN’s, write command vlan “mention
port number” and press enter.
13. Write command name “give name of the virtual Lan”.
14. Write command exit and press enter.
15. To give name to other Vlan, repeat steps 12,13 and 14.
16. The commands in the switch CLI can be seen the figure below:
Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing

Figure 3: shows the CLI of the switch.

17. To verify that the name has been given to the Virtual LAN’s, write command
show vlan brief.
18. The results will be like this:
Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing

Figure 4: show the results of verification of the vlan names

19. Now again come in the configuration mode and for the configuration of Vlan
on the switch 1, go in the configuration of interface fa 0/1 and write command
switchport access vlan 10 and press enter and write command exit and
press enter.
20. In the same way go in the configuration of fa 0/2 and write command
switchport access vlan 20 and press enter and write command exit and
press enter.
21. The command line interface of the switch 1 should be like this:
Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing

Figure 5: shows the command line interface of switch 1

22. For verification of vlan configuration write command do show vlan. You
should receive these results:

Figure 6: verification of vlan configuration


Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing
23. Now repeat all the steps as we have done for switch 1 for the switch 2
including name setting and vlan configuration in same steps, the command
line interface for the switch2 is attached below:

Figure 7: configuration of Switch 2

24. The results are given below:


Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing

Figure 8: shows the results of switch2 for vlan

25. After this configure trunk mode in switch 1 by going in the configuration mode
of switch 1 and write command interface fa 0/24 and press enter.
26. For enabling of trunk mode in switch 1 write command switchport mode
trunk and press enter and write command exit and press enter.
Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing

Figure 9: trunk mode enabling

27. After this provide IP addresses in all PC’s as mentioned in the text, also
provide subnet masks and default gateways. As provided in PC0, do same for
all.
Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing

Figure 10: configurating computers

28. Now after developing VLAN’s successfully we have to do inter VLAN routing
for this we will add a router.
29. Connect router with copper straight through wire to fa 0/3 port with fa 0/0 port
of the router.
30. The connections can be seen in the figure below:
Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing

Figure 11: shows the connection of router

31. For configuration click on the router.


32. Go in the command line interface of the router.
33. Write NO and press enter.
34. Go in the configuration mode by writing commands:
En
Config t
35. To change the state of the interface fa 0/0 to up write command interface fa
0/0 and press enter and then write command no shutdown, it will change the
state of the interface from down to up.
36. These commands can be seen in the figure below:
Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing

Figure 12: shows the cli of the router

37. After exciting these steps, write command exit and configure interface fa0/0.1
and do encapsulation of dot1Q for configuration of VLAN 10 inter VLAN
routing, also provide network address with subnet mask write commands:
Interface fa 0/0.1
Encapsulation dot1Q 10
Ip add 192.168.1.254 255.255.255.0
No shutdown
Exit
38. In the same way write command for configuration inter VLAN routing on
VLAN20, write same commands, with slight changes:
Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing
Interface fa 0/0.2
Encapsulation dot1Q 20
Ip add 192.168.2.254 255.255.255.0
No shutdown
Exit
39. You can also see the CLI of the router:

Figure 13: shows the CLI of the router

40. For verification of this tasks, ping from PC0 to PC1, you will see the reply will
come from this PC.
Capital University of Science and Technology Islamabad
Department of Computer Science,
Faculty of Computing

Figure 14: Result of ping

5. Evaluation tasks:

5.1 Task 1:
Your task is create 3 VLANS name HR, Sales and customers, first configure VLAN’S, after
configuration of VLAN, configure inter VLAN and ping PC of one VLAN from other.