Vlans and Trunks between Router and Switch
1. Take 1 Switch and 1 router.
2. Connect two devices through cross
over.
3. Configure the 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 HR
CCNA(config-vlan)#vlan 30
CCNA(config-vlan)#name
Sales
CCNA(config-vlan)#exit
CCNA(config)#exit
CCNA#
%SYS-5-CONFIG_I: Configured
from console by console
CCNA#show vlan
VLAN Name Status Ports
----
-------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, 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
Gig1/1, Gig1/2
10 Accounts active
20 HR active
30
Sales
active
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
VLAN Type SAID
MTU Parent RingNo BridgeNo
Stp BrdgMode Trans1 Trans2
---- ----- ----------
----- ------ ------ -------- ---- -------- ------ ------
1 enet
100001 1500 -
- - -
- 0 0
10 enet
100010 1500 -
- - -
- 0 0
20 enet
100020 1500 -
- - -
- 0 0
30 enet
100030 1500 -
- - -
- 0 0
1002 fddi 101002
1500 - -
- -
- 0 0
1003 tr 101003
1500 - -
- - -
0 0
1004 fdnet 101004 1500
- - -
ieee - 0 0
1005 trnet 101005 1500
- - -
ibm - 0
0
Remote SPAN VLANs
------------------------------------------------------------------------------
Primary Secondary Type Ports
------- ---------
----------------- ------------------------------------------
CCNA#
CCNA#config t
Enter configuration
commands, one per line. End with CNTL/Z.
CCNA(config)#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 10
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 20
CCNA(config-if)#int
fastethernet 0/6
CCNA(config-if)#switchport
mode access
CCNA(config-if)#switchport
access vlan 30
CCNA(config-if)#int
fastethernet 0/7
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#show vlan
VLAN Name Status Ports
----
-------------------------------- --------- -------------------------------
1 default active Fa0/1, 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, Gig1/1, Gig1/2
10 Accounts active Fa0/2, Fa0/3
20
HR active Fa0/4, Fa0/5
30 Sales active Fa0/6, Fa0/7
1002
fddi-default
act/unsup
1003
token-ring-default
act/unsup
1004
fddinet-default
act/unsup
1005
trnet-default
act/unsup
VLAN
Type SAID MTU
Parent RingNo BridgeNo Stp
BrdgMode Trans1 Trans2
---- -----
---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet
100001 1500 -
- - -
- 0 0
10 enet
100010 1500 -
- - -
- 0 0
20 enet
100020 1500 -
- - -
- 0 0
30 enet
100030 1500 -
- - -
- 0 0
1002
fddi 101002 1500
- - -
- - 0
0
1003
tr 101003 1500
- - -
- - 0
0
1004
fdnet 101004 1500 -
- - ieee - 0
0
1005 trnet 101005 1500
- - -
ibm - 0
0
Remote
SPAN VLANs
------------------------------------------------------------------------------
Primary
Secondary Type Ports
------- ---------
----------------- ------------------------------------------
CCNA#
CCNA#
CCNA#config
t
Enter configuration commands, one per
line. End with CNTL/Z.
CCNA(config)#int
fastethernet 0/1
CCNA(config-if)#description uplink
CCNA(config-if)#switchport
mode trunk
CCNA(config-if)#
CCNA(config-if)#
CCNA(config-if)#exit
CCNA(config)#exit
CCNA#
%SYS-5-CONFIG_I:
Configured from console by console
CCNA#show cdp
CCNA#show cdp ?
entry
Information for specific neighbor entry
interface
CDP interface status and configuration
neighbors
CDP neighbor entries
<cr>
CCNA#show cdp
CCNA#show cdp neighbors
Capability Codes: R - Router,
T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r -
Repeater, P - Phone
Device ID Local Intrfce Holdtme Capability Platform
Port ID
CCNA#
4. Take 6 systems and rename as
the following figure.
5. 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
6. Router configuration.
Router>enable
Router#config t
Enter configuration commands,
one per line. End with CNTL/Z.
Router(config)#hostname CCNA
CCNA(config)#int fa
% Incomplete command.
CCNA(config)#int fa
CCNA(config)#int
fastEthernet 0/0
CCNA(config-if)#no shut
%LINK-5-CHANGED: Interface
FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line
protocol on Interface FastEthernet0/0, changed state to
CCNA(config-if)#int
fa0/0.10
CCNA(config-subif)#
%LINK-5-CHANGED: Interface
FastEthernet0/0.10, changed state to up
%LINEPROTO-5-UPDOWN: Line
protocol on Interface FastEthernet0/0.10, changed state
CCNA(config-subif)#int
fa0/0.20
%LINK-5-CHANGED: Interface
FastEthernet0/0.20, changed state to up
%LINEPROTO-5-UPDOWN: Line
protocol on Interface FastEthernet0/0.20, changed state
CCNA(config-subif)#int
fa0/0.30
%LINK-5-CHANGED: Interface
FastEthernet0/0.30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on
Interface FastEthernet0/0.30, changed state
CCNA(config-subif)#
CCNA(config-subif)#do sh
ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES NVRAM
up up
FastEthernet0/0.10 unassigned YES unset
up up
FastEthernet0/0.20 unassigned YES unset
up up
FastEthernet0/0.30 unassigned YES unset
up up
FastEthernet0/1 unassigned YES NVRAM
administratively down down
Vlan1 unassigned YES NVRAM
administratively down down
CCNA(config-subif)#int
fa0/0.10
CCNA(config-subif)#encapsulation dot1Q 10
CCNA(config-subif)#ip address 192.168.1.1
255.255.255.0
CCNA(config-subif)#int
fa0/0.20
CCNA(config-subif)#encapsulation dot1Q 20
CCNA(config-subif)#ip
address 192.168.2.1 255.255.255.0
CCNA(config-subif)#int
fa0/0.30
CCNA(config-subif)#encapsulation dot1Q 30
CCNA(config-subif)#ip
address 192.168.3.1 255.255.255.0
CCNA(config-subif)#exi
CCNA(config)#exit
CCNA#
%SYS-5-CONFIG_I:
Configured from console by console
CCNA#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES NVRAM
up up
FastEthernet0/0.10 192.168.1.1 YES manual up up
FastEthernet0/0.20
192.168.2.1 YES manual up up
FastEthernet0/0.30
192.168.3.1 YES manual up up
FastEthernet0/1 unassigned YES NVRAM
administratively down down
Vlan1 unassigned YES NVRAM
administratively down down
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
No comments:
Post a Comment