Home      Affiliated Colleges      Course content      First Sem     Second Sem     Third Sem     Fourth Sem     Fifth Sem     Sixth Sem     Seventh Sem     Eighth Sem     Lab report 4th sem     Contact    

Wednesday, January 26, 2011

Computer Networks: Packet tracer code for VLAN

===========================================switch1==============================================
Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vl
Switch(config)#vlan 10
Switch(config-vlan)#name student
Switch(config-vlan)#exit
Switch(config)#vl
Switch(config)#vlan 20
Switch(config-vlan)#name faculty
Switch(config-vlan)#exit
Switch(config)#in
Switch(config)#interface f
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access v
Switch(config-if)#switchport access vlan 10
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#in
Switch(config)#interface f
Switch(config)#interface fastEthernet 0/3
Switch(config-if)#s
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access v
Switch(config-if)#switchport access vlan 20
Switch(config-if)#no
Switch(config-if)#no  sh
Switch(config-if)#no  shutdown
Switch(config-if)#exit
Switch(config)#in
Switch(config)#interface f
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#sw
Switch(config-if)#switchport m
Switch(config-if)#switchport mode t
Switch(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upSwitch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
Switch#write
Destination filename [startup-config]?
Building configuration...
[OK]
Switch#
=================================================switch2=================================================
Switch>en
Switch#con
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vl
Switch(config)#vlan 10
Switch(config-vlan)#name student
Switch(config-vlan)#exit
Switch(config)#vl
Switch(config)#vlan 20
Switch(config-vlan)#name faculty
Switch(config-vlan)#no sh
Switch(config-vlan)#exit
Switch(config)#int
Switch(config)#interface f
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access v
Switch(config-if)#switchport access vlan 10
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#in
Switch(config)#interface f
Switch(config)#interface fastEthernet 0/3
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access v
Switch(config-if)#switchport access vlan 20
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#int
Switch(config)#interface f
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#sw
Switch(config-if)#switchport m
Switch(config-if)#switchport mode t
Switch(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upSwitch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
Switch#write
Destination filename [startup-config]?
Building configuration...
[OK]
Switch#
================================================central switch===============================================

Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#v
Switch(config)#vl
Switch(config)#vlan 10
Switch(config-vlan)#name student
Switch(config-vlan)#exit
Switch(config)#vl
Switch(config)#vlan 20
Switch(config-vlan)#name faculty
Switch(config-vlan)#exit
Switch(config)#int
Switch(config)#interface f
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access v
Switch(config-if)#switchport access vlan 10
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access v
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#int
Switch(config)#interface f
Switch(config)#interface fastEthernet 0/3
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access v
Switch(config-if)#switchport access vlan 10
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access v
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#in
Switch(config)#interface f
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport m
Switch(config-if)#switchport mode t
Switch(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upSwitch(config-if)#
Switch(config-if)#wr
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
Switch#write
Destination filename [startup-config]?
Building configuration...
[OK]
Switch#
=====================================================router================================================
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#in
Router(config)#interface f
Router(config)#interface fastEthernet 0/0.10
Router(config-subif)#en
Router(config-subif)#encapsulation d
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip ad
Router(config-subif)#ip address 192.168.1.1 255.255.255.0
Router(config-subif)#no sh
Router(config-subif)#no shutdown
Router(config-subif)#exit
Router(config)#in
Router(config)#interface f
Router(config)#interface fastEthernet 0/0.20
Router(config-subif)#en
Router(config-subif)#encapsulation d
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip ad
Router(config-subif)#ip address 192.168.2.1 255.255.255.0
Router(config-subif)#no sh
Router(config-subif)#no shutdown
Router(config-subif)#exit
Router(config)#in
Router(config)#interface f
Router(config)#interface fastEthernet 0/0
Router(config-if)#no sh
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
%LINK-5-CHANGED: Interface FastEthernet0/0.10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.10, changed state to up
%LINK-5-CHANGED: Interface FastEthernet0/0.20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.20, changed state to up
Router(config-if)#exit
Router(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
Router#write
Destination filename [startup-config]?
Building configuration...
[OK]
============================================================================================================

No comments:

Post a Comment

^ Scroll to Top Related Posts with Thumbnails ^ Go to Top