CCNA R&S (CCNA5.0) Lab vlan trunk vtp intervlan routing layer3 switch (phần 1)
Cấu hình layer3 Switch:
Switch>
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S3
S3(config)#enable password cisco
S3(config)#line console 0
S3(config-line)#password cisco
S3(config-line)#exit
S3(config)#line vty 0 15
S3(config-line)#password cisco
S3(config-line)#exit
S3(config)#banner motd “hang hieu”
S3(config)#vlan 10
S3(config-vlan)#name teacher
S3(config-vlan)#exit
S3(config)#vlan 20
S3(config-vlan)#name student
S3(config-vlan)#exit
S3(config)#vlan 30
S3(config-vlan)#name manage
S3(config-vlan)#exit
S3(config)#vtp mode server
Device mode already VTP SERVER.
S3(config)#vtp domain npower
Changing VTP domain name from NULL to npower
S3(config)#vtp password cisco
Setting device VLAN database password to cisco
S3(config)#int range f0/2-4
S3(config-if-range)#switchport trunk encapsulation dot1q
S3(config-if-range)#switchport mode trunk
%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
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up
S3(config-if-range)#
S3(config-if-range)#exit
S3(config)#int vlan 10
S3(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up
S3(config-if)#no shut
S3(config-if)#ip address 192.168.10.13 255.255.255.0
S3(config-if)#exit
S3(config)#int vlan 20
S3(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
S3(config-if)#no shut
S3(config-if)#ip address 192.168.20.13 255.255.255.0
S3(config-if)#exit
S3(config)#int vlan 30
S3(config-if)#
%LINK-5-CHANGED: Interface Vlan30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up
S3(config-if)#no shut
S3(config-if)#ip address 192.168.30.13 255.255.255.0
S3(config-if)#exit
S3(config)#ip default-network 192.168.30.13
S3(config)#ip routing
S3(config)#int f0/1
S3(config-if)#no switchport
S3(config-if)#ip address 10.0.0.13 255.255.255.0
S3(config-if)#exit
S3(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.2
S3(config)#exit
S3#
%SYS-5-CONFIG_I: Configured from console by console
S3#wr
S3#
Cấu hình S2:
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S2
S2(config)#enable password cisco
S2(config)#line vty 0 15
S2(config-line)#pas
S2(config-line)#password cisco
S2(config-line)#exit
S2(config)#line console 0
S2(config-line)#password cisco
S2(config-line)#exit
S2(config)#vtp mode client
Setting device to VTP CLIENT mode.
S2(config)#vtp domain npower
Domain name already set to npower.
S2(config)#vtp password cisco
Setting device VLAN database password to cisco
S2(config)#int range f0/1-2
S2(config-if-range)#switchport mode trunk
%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
S2(config-if-range)#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 address 192.168.30.12 255.255.255.0
S2(config-if)#exit
S2(config)#ip default-gateway 192.168.30.13
S2(config)#exit
S2#
%SYS-5-CONFIG_I: Configured from console by console
S2#wr
S2#show vlan brief
VLAN Name Status Ports
– –
1 default active 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 teacher active
20 student active
30 manage active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
S2#
Nguồn: Trung tâm thiết bị viễn thông bách khoa