CCNA 5.0 Bài lab cấu hình vlan trunk vtp intervlan routing TN
CCNA 5.0 Cấu hình chia subint trên R1 để định tuyến giữa các vlan
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hos
Router(config)#hostname R1
R1(config)#ena
R1(config)#enable pas
R1(config)#enable password cisco
R1(config)#li
R1(config)#line con
R1(config)#line console 0
R1(config-line)#pas
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
R1(config)#li
R1(config)#line vt
R1(config)#line vty 0 4
R1(config-line)#pas
R1(config-line)#password cisco
R1(config-line)#exit
R1(config)#ban
R1(config)#banner m
R1(config)#banner motd “R1-cuongnm”
R1(config)#int f0/0
R1(config-if)#no shut
R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#exit
R1(config)#int f0/0.10
R1(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 to up
R1(config-subif)#en
R1(config-subif)#encapsulation d
R1(config-subif)#encapsulation dot1Q
% Incomplete command.
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip add
R1(config-subif)#ip address 192.168.10.1 255.255.255.0
R1(config-subif)#exit
R1(config)#int f0/0.20
R1(config-subif)#
%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
R1(config-subif)#en
R1(config-subif)#encapsulation d
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip add
R1(config-subif)#ip address 192.168.20.1 255.255.255.0
R1(config-subif)#exit
R1(config)#int f0/0.30
R1(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.30, changed state to up
R1(config-subif)#en
R1(config-subif)#encapsulation d
R1(config-subif)#encapsulation dot1Q 30
R1(config-subif)#ip add
R1(config-subif)#ip address 192.168.30.1 255.255.255.0
R1(config-subif)#exit
R1(config)#exit
R1#
%SYS-5-CONFIG_I: Configured from console by console
R1#wr
Building configuration…
[OK]
R1#
CCNA 5.0 Cấu hình S1 vtp server
Switch>
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hos
Switch(config)#hostname S1
S1(config)#ena
S1(config)#enable pas
S1(config)#enable password cisco
S1(config)#li
S1(config)#line con
S1(config)#line console 0
S1(config-line)#pas
S1(config-line)#password cisco
S1(config-line)#login
S1(config-line)#exit
S1(config)#li
S1(config)#line v
S1(config)#line vty 0 15
S1(config-line)#pas
S1(config-line)#password cisco
S1(config-line)#login
S1(config-line)#exit
S1(config)#ban
S1(config)#banner m
S1(config)#banner motd “S1-cuongnm”
S1(config)#vlan 10
S1(config-vlan)#na
S1(config-vlan)#name CB
S1(config-vlan)#exit
S1(config)#vlan 20
S1(config-vlan)#na
S1(config-vlan)#name SV
S1(config-vlan)#exit
S1(config)#vlan 30
S1(config-vlan)#na
S1(config-vlan)#name QT
S1(config-vlan)#exit
S1(config)#vtp
S1(config)#vtp m
S1(config)#vtp mode ser
S1(config)#vtp mode server
Device mode already VTP SERVER.
S1(config)#vt
S1(config)#vtp d
S1(config)#vtp domain cisco.com
Changing VTP domain name from NULL to cisco.com
S1(config)#vtp pa
S1(config)#vtp password cisco
Setting device VLAN database password to cisco
S1(config)#int ra
S1(config)#int range f0/1 ?
, comma
– hyphen
<cr>
S1(config)#int range f0/1-3
S1(config-if-range)#sw
S1(config-if-range)#switchport m
S1(config-if-range)#switchport mode tr
S1(config-if-range)#switchport mode trunk
S1(config-if-range)#
%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 up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up
S1(config-if-range)#exit
S1(config)#exit
S1#
%SYS-5-CONFIG_I: Configured from console by console
S1#wr
Building configuration…
[OK]
S1#
S1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S1(config)#int vlan 30
S1(config-if)#
%LINK-5-CHANGED: Interface Vlan30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up
S1(config-if)#no shut
S1(config-if)#ip add
S1(config-if)#ip address 192.168.30.11 255.255.255.0
S1(config-if)#exit
S1(config)#ip de
S1(config)#ip default-gateway 192.168.30.1
S1(config)#exit
S1#
%SYS-5-CONFIG_I: Configured from console by console
S1#wr
Building configuration…
[OK]
S1#
CCNA 5.0 Cấu hình S2 vtp client
Switch>
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hos
Switch(config)#hostname S2
S2(config)#ena
S2(config)#enable pas
S2(config)#enable password cisco
S2(config)#li
S2(config)#line con
S2(config)#line console 0
S2(config-line)#pas
S2(config-line)#password cisco
S2(config-line)#login
S2(config-line)#exit
S2(config)#li
S2(config)#line vt
S2(config)#line vty 0 15
S2(config-line)#pas
S2(config-line)#password cisco
S2(config-line)#login
S2(config-line)#exit
S2(config)#ban
S2(config)#banner m
S2(config)#banner motd “S2-cuongnm”
S2(config)#vtp mo
S2(config)#vtp mode clie
S2(config)#vtp mode client
Setting device to VTP CLIENT mode.
S2(config)#vtp do
S2(config)#vtp domain cisco.com
Domain name already set to cisco.com.
S2(config)#vt
S2(config)#vtp p
S2(config)#vtp password cisco
Setting device VLAN database password to cisco
S2(config)#int f0/1
S2(config-if)#sw
S2(config-if)#switchport mo
S2(config-if)#switchport mode tr
S2(config-if)#switchport mode trunk
S2(config-if)#do show vlan
VLAN Name Status Ports
—- ——————————– ——— ——————————-
1 default active 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 CB active
20 SV active
30 QT 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
S2(config-if)#exit
S2(config)#int vlan 30
S2(config-if)#
%LINK-5-CHANGED: Interface Vlan30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up
S2(config-if)#no shut
S2(config-if)#ip add
S2(config-if)#ip address 192.168.30.12 255.255.255.0
S2(config-if)#exit
S2(config)#ip de
S2(config)#ip default-gateway 192.168.30.1
S2(config)#int f0/2
S2(config-if)#sw
S2(config-if)#switchport m
S2(config-if)#switchport mode ac
S2(config-if)#switchport mode access
S2(config-if)#sw
S2(config-if)#switchport ac
S2(config-if)#switchport access v
S2(config-if)#switchport access vlan 10
S2(config-if)#int f0/3
S2(config-if)#sw
S2(config-if)#switchport mo
S2(config-if)#switchport mode ac
S2(config-if)#switchport mode access
S2(config-if)#sw
S2(config-if)#switchport ac
S2(config-if)#switchport access v
S2(config-if)#switchport access vlan 20
S2(config-if)#exit
S2(config)#exit
S2#
%SYS-5-CONFIG_I: Configured from console by console
S2#wr
Building configuration…
[OK]
S2#