You are on page 1of 3

Bài tập thực hành switch

1 ĐẶT LẠI PASSWORD KHI BỊ MẤT (RECOVERY)


Bước 1: Kết nối PC với cổng Console của switch, bật ứng dụng HyperTerminal (Windows) hoặc Minicom
(Linux)

Bước 2: Đặt line speed là 9600 baud

Bước 3: Tắt switch (rút phích cắm)

Bước 4: Bấm và giữ nút Mode trên switch đồng thời cắm điện cho switch. Nếu chế độ phục hồi
password được bật, chúng ta sẽ thấy thông báo sau
The system has been interrupted prior to initializing the flash file system. The following
commands will initialize the flash file system, and finish loading the operating system
software:

flash_init
load_helper
boot

Bước 5: Lần lượt gõ các lệnh sau:


switch: flash_init

switch: load_helper

switch: dir flash: //Đây là lệnh liệt kê các file cấu hình sẵn có trên switch

Bước 6: đổi tên hoặc xóa file cấu hình cũ


switch: rename flash:config.text flash:config.text.old //đổi tên

switch: delete flash:config.text // xóa

Bước 7: khởi động lại hệ thống


switch: boot

Nếu được hỏi câu hỏi sau thì chọn N


Continue with the configuration dialog? [yes/no]: N

Đến đây, switch đã được khởi động lại với cấu hình default và không có password.

2 ĐẶT PASSWORD
Thực hiện các lệnh sau:
Switch> enable

Switch# configure terminal

Switch (config)# enable secret password //Đặt password cho switch

Switch (config)# line vty from_port to_port //Đặt password cho truy cập từ xa
Switch (config)# password your_password

Switch (config)# exit


Switch#

3 ĐẶT SWITCH NAME


Thực hiện các lệnh sau:
Switch> enable

Switch# configure terminal

Switch (config)# hostname new_switch_name

Switch (config)# exit

4 TẮT SPANNING-TREE TẠI MỘT VLAN


Thực hiện các lệnh sau:
Switch> enable

Switch# configure terminal

Switch (config)# no spanning-tree vlan vlan-id

Switch (config)# end

5 CHUYỂN VLAN CỦA MỘT DẢI CÁC INTERFACE


Thực hiện các lệnh sau:
Switch> enable

Switch# configure terminal

Switch(config)# vlan vlan_id //Tạo VLAN mới với vlan_id

Switch(config-vlan)# end

Switch(config)# interface fastethernet 0/port //Dùng lệnh này nếu chỉ cấu hình cho 1 port

Switch(config…)# interface range fastethernet 0/first_port-last_port //Dùng lệnh này nếu chỉ cấu hình
cho 1 dải các cổng

Switch(config…)# switchport mode access

Switch(config…)# switchport access vlan vlan_id

Switch(config…)# end

6 THIẾT LẬP MỘT INTERFACE HOẠT ĐỘNG Ở MODE TRUNK


Thực hiện các lệnh sau:
Switch> enable
Switch# configure terminal

Switch(config)# interface fastethernet 0/port

Switch(config-if)# switchport trunk encapsulation dot1q

Switch(config-if)# switchport mode trunk

Switch(config-if)# end

Hủy mode trunk ở 1 cổng


Switch> enable

Switch# configure terminal

Switch(config)# interface fastethernet 0/port

Switch(config-if)# switchport mode access

Switch(config-if)# end

7 XEM LẠI CÁC THÔNG TIN


Xem thông tin về các interface
Switch# show interfaces interface-id {switchport hoặc trunk}

Switch# show running-config interface interface-id

Xem thông tin về VLAN


Switch# show vlan {brief hoặc name vlan-name hoặc id vlan-id}

Xem thông tin về cấu hình


Switch# show running-config //Xem cấu hình hiện tại trong RAM

Switch# show startup-config //Xem cấu hình được load khi khởi động

8 GHI CẤU HÌNH ĐANG CHẠY VÀO FLASH


Thực hiện các lệnh sau
Switch# copy running-config startup-config

You might also like