Yêu cầu:
Gợi ý:
2a: Dùng lệnh sau trên switch trong mode interface:
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# switchport mode trunk
!Lưu ý: phải gõ lệnh “switchport trunk encapsulation dot1q” trước lệnh “switchport mode trunk”, nếu gõ theo thứ tự ngược lại sẽ không thể tạo kết nối trung kế thành công
2b: Dùng lệnh sau trên router để cấu hình trung kế dot1q:
Router(config)# interface fastethernet 0/0.11
Router(config-if)# encapsulation dot1q 10
Router(config-if)# ip address 192.168.1.1 255.255.255.0
!lưu ý: câu lệnh trên tạo subinterface f0/0.11, chỉ định encapsulation là dot1q, thuộc VLAN 10 và có IP 192.168.1.1.
3: Dùng lệnh sau để cấu hình VTP:
Switch(config)# vtp domain BCMSN
Switch(config)# vtp mode { client | server | transparent }
Switch(config)# vtp password CISCO
4: Dùng các lệnh sau để cấu hình VLAN:
Switch(config)# vlan 10
Switch(config-vlan)# name VLAN10 !ßđặt tên là VLAN10
Switch(config)# interface range fastethernet 0/1 – 6
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 10
Cấu hình đầy đủ:
!Nhóm 1:
!SW11:
!
configure terminal
!
interface fastEthernet0/8
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface fastEthernet0/9
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface fastEthernet0/24
switchport trunk encapsulation dot1q
switchport mode trunk
!
vtp domain BCMSN1
vtp pass CISCO
!
vlan 11
name VLAN11
!
vlan 12
name VLAN12
!
vlan 13
name VLAN13
!
interface range fastEthernet0/1 - 7
switchport mode access
switchport access vlan 11
!
interface range fastEthernet0/10 - 16
switchport mode access
switchport access vlan 12
!
int range fastEthernet0/17 - 23
switchport mode access
switchport access vlan 13
!
end
!SW12:
!
configure terminal
!
interface fastEthernet0/8
switchport trunk encapsulation dot1q
switchport mode trunk
!
vtp mode client
vtp domain BCMSN1
vtp pass CISCO
!
interface range fastEthernet0/1 - 7
switchport mode access
switchport access vlan 11
!
interface range fastEthernet0/9 - 16
switchport mode access
switchport access vlan 12
!
interface range fastEthernet0/17 - 24
switchport mode access
switchport access vlan 13
!
end
SW13:
configure terminal
!
interface fastEthernet0/8
switchport trunk encapsulation dot1q
switchport mode trunk
!
vtp mode client
vtp domain BCMSN1
vtp pass CISCO
!
interface range fastEthernet0/1 - 7
switchport mode access
switchport access vlan 11
!
interface range fastEthernet0/10 - 16
switchport mode access
switchport access vlan 12
!
interface range fastEthernet0/17 - 24
switchport mode access
switchport access vlan 13
!
end
!R11:
configure terminal
!
interface loopback0
ip address 1.1.1.1 255.255.255.0
!
interface serial0/0
clock rate 64000
ip address 192.168.1.1 255.255.255.0
no shutdown
!
interface fastEthernet0/0
no shutdown
!
interface fastEthernet0/0.11
encapsulation dot1q 11
ip address 172.16.1.1 255.255.255.0
!
interface fastEthernet0/0.12
encapsulation dot1q 12
ip address 172.16.2.1 255.255.255.0
!
interface fastEthernet0/0.13
encapsulation dot1q 13
ip address 172.16.3.1 255.255.255.0
!
router ospf 1
network 0.0.0.0 255.255.255.255 are 0
!
end
!Nhóm 2:
SW21:
!
configure terminal
!
interface fastEthernet0/8
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface fastEthernet0/9
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface fastEthernet0/24
switchport trunk encapsulation dot1q
switchport mode trunk
!
vtp domain BCMSN2
vtp pass CISCO
!
vlan 21
name VLAN21
!
vlan 22
name VLAN22
!
vlan 23
name VLAN23
!
interface range fastEthernet0/1 - 7
switchport mode access
switchport access vlan 21
!
interface range fastEthernet0/10 - 16
switchport mode access
switchport access vlan 22
!
interface range fastEthernet0/17 - 23
switchport mode access
switchport access vlan 23
!
end
SW22:
!
configure terminal
!
interface fastEthernet0/8
switchport trunk encapsulation dot1q
switchport mode trunk
!
vtp domain BCMSN2
vtp mode client
vtp pass CISCO
!
interface range fastEthernet0/1 - 7
switchport mode access
switchport access vlan 21
!
interface range fastEthernet0/9 - 16
switchport mode access
switchport access vlan 22
!
interface range fastEthernet0/17 - 24
switchport mode access
switchport access vlan 23
!
end
SW23:
!
configure terminal
!
interface fastEthernet0/8
switchport trunk encapsulation dot1q
switchport mode trunk
!
vtp domain BCMSN2
vtp mode client
vtp pass CISCO
!
interface range fastEthernet0/1 - 7
switchport mode access
switchport access vlan 21
!
interface range fastEthernet0/9 - 16
switchport mode access
switchport access vlan 22
!
interface range fastEthernet0/17 - 24
switchport mode access
switchport access vlan 23
!
end
R21:
!
configure terminal
!
interface loopback0
ip address 2.2.2.2 255.255.255.0
!
interface serial0/0
clock rate 64000
ip address 192.168.1.2 255.255.255.0
no shutdown
!
interface serial0/1
clock rate 64000
ip address 192.168.2.2 255.255.255.0
no shutdown
!
interface fastEthernet0/0
no shutdown
!
interface fastEthernet0/0.21
encapsulation dot1q 21
ip address 172.17.1.1 255.255.255.0
!
interface fastEthernet0/0.22
encapsulation dot1q 22
ip address 172.17.2.1 255.255.255.0
!
interface fastEthernet0/0.23
encapsulation dot1q 23
ip address 172.17.3.1 255.255.255.0
!
router ospf 1
network 0.0.0.0 255.255.255.255 are 0
!
end
!Nhóm 3:
SW31:
!
configure terminal
!
interface fastEthernet0/8
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface fastEthernet0/9
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface fastEthernet0/24
switchport trunk encapsulation dot1q
switchport mode trunk
!
vtp domain BCMSN3
vtp pass CISCO
!
vlan 31
name VLAN31
!
vlan 32
name VLAN32
!
vlan 33
name VLAN33
!
interface range fastEthernet0/1 - 7
switchport mode access
switchport access vlan 31
!
interface range fastEthernet0/10 - 16
switchport mode access
switchport access vlan 32
!
interface range fastEthernet0/17 - 23
switchport mode access
switchport access vlan 33
!
end
SW32:
!
configure terminal
!
interface fastEthernet0/8
switchport trunk encapsulation dot1q
switchport mode trunk
!
vtp mode client
vtp domain BCMSN3
vtp pass CISCO
!
interface range fastEthernet0/1 - 7
switchport mode access
switchport access vlan 31
!
interface range fastEthernet0/9 - 16
switchport mode access
switchport access vlan 32
!
interface range fastEthernet0/17 - 24
switchport mode access
switchport access vlan 33
!
end
SW33:
!
configure terminal
!
interface fastEthernet0/8
switchport trunk encapsulation dot1q
switchport mode trunk
!
vtp mode client
vtp domain BCMSN3
vtp pass CISCO
!
interface range fastEthernet0/1 - 7
switchport mode access
switchport access vlan 31
!
interface range fastEthernet0/9 - 16
switchport mode access
switchport access vlan 32
!
interface range fastEthernet0/17 - 24
switchport mode access
switchport access vlan 33
!
end
R31:
configure terminal
!
interface loop 0
ip address 3.3.3.3 255.255.255.0
!
interface s0/0
clock rate 64000
ip address 192.168.2.3 255.255.255.0
no shutdown
!
interface fastEthernet0/0
no shutdown
!
interface fastEthernet0/0.31
encapsulation dot1q 31
ip address 172.18.1.1 255.255.255.0
!
interface fastEthernet0/0.32
encapsulation dot1q 32
ip address 172.18.2.1 255.255.255.0
!
interface fastEthernet0/0.33
encapsulation dot1q 33
ip address 172.18.3.1 255.255.255.0
!
router ospf 1
network 0.0.0.0 255.255.255.255 are 0
!
end
!kiem tra trunk
#show int trunk
!kiem tra vtp
#show vtp status
!kiem tra routing table
#show ip route