Configuring Vlans and Trunks with layer 3 Switch
1. Take 1 Switch .
2. Configuring the switch.
Switch>
Switch>enable
Switch#config t
Enter configuration commands, one per
line. End with CNTL/Z.
Switch(config)#hostname CCNA
CCNA(config)#vlan 10
CCNA(config-vlan)#name Accounts
CCNA(config-vlan)#vlan 20
CCNA(config-vlan)#name Sales
CCNA(config-vlan)#vlan 30
CCNA(config-vlan)#name HR
CCNA(config-vlan)#exit
CCNA(config)#exit
CCNA#
%SYS-5-CONFIG_I: Configured from
console by console
CCNA#config t
Enter configuration commands, one per
line. End with CNTL/Z.
CCNA(config)#int fastethernet 0/1
CCNA(config-if)#switchport mode access
CCNA(config-if)#switchport access vlan
10
CCNA(config-if)#int fastethernet 0/2
CCNA(config-if)#switchport mode access
CCNA(config-if)#switchport access vlan
10
CCNA(config-if)#int fastethernet 0/3
CCNA(config-if)#switchport mode access
CCNA(config-if)#switchport access vlan
20
CCNA(config-if)#int fastethernet 0/4
CCNA(config-if)#switchport mode access
CCNA(config-if)#switchport access vlan
20
CCNA(config-if)#int fastethernet 0/5
CCNA(config-if)#switchport mode access
CCNA(config-if)#switchport access vlan
30
CCNA(config-if)#int fastethernet 0/6
CCNA(config-if)#switchport mode access
CCNA(config-if)#switchport access vlan
30
CCNA(config-if)#exit
CCNA(config)#exit
CCNA#
%SYS-5-CONFIG_I: Configured from
console by console
CCNA#sh vlan
VLAN Name Status Ports
------------------------------- ---------
----------------------------
1 default active Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13 Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21,Fa0/22
Fa0/23,
Fa0/24, Gig0/1, Gig0/2
10
Accounts
active Fa0/1, Fa0/4
20
Sales active Fa0/2, Fa0/5
30
HR
active Fa0/3, Fa0/6
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
CCNA#
CCNA#config
t
Enter configuration commands, one per
line. End with CNTL/Z.
CCNA(config)#int vlan 10
%LINK-5-CHANGED: Interface Vlan10,
changed state to up
%LINEPROTO-5-UPDOWN:
Line protocol on Interface Vlan10, changed
state to up
CCNA(config-if)#int vlan 20
%LINK-5-CHANGED: Interface Vlan20,
changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on
Interface Vlan20, changed state
to up
CCNA(config-if)#int vlan 30
%LINK-5-CHANGED: Interface Vlan30,
changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on
Interface Vlan30, changed state
to up
CCNA(config-if)#exit
CCNA(config)#exit
CCNA#
%SYS-5-CONFIG_I: Configured from
console by console
CCNA#sh ip int brief
CCNA#
CCNA#config t
Enter configuration commands, one per
line. End with CNTL/Z.
CCNA(config)#int vlan 10
CCNA(config-if)#ip address 192.168.1.1
255.255.255.0
CCNA(config-if)#int vlan 20
CCNA(config-if)#ip address 192.168.2.1
255.255.255.0
CCNA(config-if)#int vlan 30
CCNA(config-if)#ip address 192.168.3.1
255.255.255.0
CCNA(config-if)#
CCNA(config-if)#exit
CCNA(config)#exit
CCNA#
CCNA#config
t
CCNA(config)#ip routing
CCNA(config)#exit
CCNA#
%SYS-5-CONFIG_I: Configured from
console by console
CCNA#sh ip route
Codes:
C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 -
OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF
external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 -
IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user
static route, o - ODR
P
- periodic downloaded static route
Gateway
of last resort is not set
C 192.168.1.0/24 is directly connected,
Vlan10
C 192.168.2.0/24 is directly connected,
Vlan20
C 192.168.3.0/24 is directly connected,
Vlan30
Take
6 systems and rename as the following figure.
3. Using the Config tab in Packet Tracer,
configure the IP address, mask, and default gateway on each host.
PC – 192.168.1.10 255.255.255.0 Default gateway 192.168.1.1
PC – 192.168.1.20 255.255.255.0 Default gateway 192.168.1.1
PC – 192.168.2.10 255.255.255.0 Default gateway 192.168.2.1
PC – 192.168.2.20 255.255.255.0 Default gateway 192.168.2.1
PC – 192.168.3.10 255.255.255.0 Default gateway 192.168.3.1
PC – 192.168.3.20 255.255.255.0 Default gateway 192.168.3.1
CCNA#sh ip route.
Now try to ping from PC
192.168.1.10 to 192.168.1.20 and 192.168.1.10 to 192.168.3.20.
If is there any
mistakes and for any clarification please mail to