Các dòng lệnh thường cấu hình Switch Cisco Catalyst
1. Đặt password Console
SW(config)#line console 0
SW(config-line)#password 123456
SW(config-line)#login
2. Đặt password Telnet
SW(config)#line vty 0 4
SW(config-line)#password cisco
SW(config-line)#login
3. Đặt password Enable
SW(config)#enable password abc@123
Hoặc đặt Enable Secrec:
SW(config)#enable secret abc@456
4. Mã hoá Password
SW(config)#service password-encryption
5. Đặt IP VLAN
SW(config)#interface vlan 1
SW(config-if)#ip address 10.0.0.2 255.255.255.0
SW(config)#ip default-gateway 10.0.0.1
6. Cấu hình SSH or Telnet
SW(config)#ip domain-name vdo.vn
SW(config)#username tamhs password 123456
SW(config)#crypto key generate rsa
SW(config)#line vty 0 4
SW(config-line)#login local
SW(config-line)#transport input telnet
7. Cau hinh Mode access
SW(config)#interface range gigabitEthernet 0/1-24
SW(config-if-range)#switchport mode access
SW(config-if-range)#switchport access vlan 1
SW(config-if-range)#no shutdown
8. Cau hinh SNMP Comunity
SW(config)#snmp-server community AAAAAA ro
SW(config)#snmp-server location “FPT-Duy Tan”
SW(config)#snmp-server contact “Admin 0983666613”
9. Xóa VLAN
SW#vlan database
SW(vlan)#no vlan_id
SW(vlan)#exit
Hoặc xóa file vlan.dat và start-config
SW#erase startup-config
SW#delete flash:vlan.dat
SW#reload
10. Thiết lập tốc độ và duplex của cổng
Switch(config-int)#speed tốc độ
Switch(config-int)#duplex full
11.Thiết lập dịch vụ HTTP và cổng
Switch(config)#ip http server
Switch(config)#ip http port 80
12.Thiết lập, quản lý địa chỉ MAC
Switch(config)#mac-address-table static địa chỉ MAC interface fastethernet số vlan
Switch#show mac-address-table
Switch#clear mac-address-table
13.Cấu hình bảo mật cho cổng
Switch(config-if)#switchport mode acess
Switch(config-if)#switchport port-security
Cấu hình Static: Switch(config-if)#switchport port-security mac-address địa chỉ Mac
Cấu hình Sticky: Switch(config-if)#switchport port-security mac-address sticky (thông dụng nhất)
Switch(config-if)#switchport port-security maximum value
Switch(config-if)#switchport port-security violation shutdown
14. Cau hinh SWitch Layer3
SW(config)#ip routing
SW(config)#router rip
SW(config-router)#version 2
SW(config-router)#no auto-summary
SW(config-router)#network 203.162.120.0
SW(config-router)#network 10.0.0.0
15. switchport trunk encapsulation dot1q
#switchport trunk allowed vlan 16,58,59,160-163,166,204
#switchport mode trunk
16. Cấu hình cổng Trunk
SW1(config)# interface gigabitEthernet 0/24
SW1(config)# switchport trunk encapsulation dot1q
SW1(config)# switchport mode trunk
- Muốn giới hạn VLAN 10 hoặc vlan 20 được phép đi qua
SW1(config)# switchport trung allowed vlan 10,20
Thêm vlan 30 đi qua sẽ là:
SW1(config)# switchport trunk allowed vlan add 30
Hoặc
SW1(config)# switchport trunk allowed vlan 10,20,30
– Đổi VLan native :
SW1(config)# switchport trunk native vlan 10
SW1# show interface trunk (Chỉ khi up mới show được)
SW1# show int E1/2 switchport
Xem số lượng vlan hỗ trợ: SW1# show vtp status
SW1(config)# interface gigabitEthernet 0/1
SW1(config-if)# speed 1000
SW1(config-if)# storm-control unicast level bps 1000m
Hoặc
SW1(config-if)# no storm-control unicast level bps 1000m
17. Cấu hình Ethernet Management Port Cisco
sw1(config)# interface fastEthernet 0
sw1(config-if)# ip address 210.245.0.XX 255.255.255.224
18. Tìm địa chỉ MAC Address
#show mac address-table interface gigabitEthernet 1/0/2
#show mac address-table address 3c97.0ea6.3633
#show mac address-table (Lệnh này sẽ biết được Mac của Server đang cắm vào Port nào của Switch)
19. Kiểm tra trạng thái cổng
# show interface status
#show ip arp
– Chec trạng thai Port
#show ip interface
20. Giới hạn băng thông trên Switch Cisco
- Cách 1:
sw1(config)# interface gigabitEthernet 1/0/2
sw1(config-if)# speed 100 (Có 3 tuỳ chọn 10/100/1000 )
Thông số: 10 là giới hạn băng thông 10MB
100 là giới hạn băng thông 100MB
1000 là giới hạn băng thông 1GB
- Cách 2:
storm-control broadcast level pps 10
storm-control multicast level pps 10
storm-control unicast level bps 100m
storm-control action trap
- Dòng Cisco – Nexus
- Chú ý: Chỉ được dùng 1 trong 2 cách. Nếu dùng cả 2 cùng 01 lúc có thể sẽ bị lỗi.
– Dòng Cisco – Nexus
switch# configure terminal
switch(config)# interface ethernet 1/4
switch(config-if)# storm-control broadcast level 40
switch(config-if)# storm-control multicast level 40
switch(config-if)# storm-control unicast level 40
21. Các lệnh Show
#show history
#show interfaces status
#show interfaces trunk
#show interfaces status | i trunk
#show interfaces status | i id_vlan
22. Spanning-tree
description 203.162.120.0_UPlink_VNPT
switchport access vlan 1234
switchport mode access
spanning-tree bpdufilter enable
23. Access-List
=> Tạo Access-list
SW(config)#ip access-list standard INTERNET
SW(config-std-nacl)#permit 103.127.204.196
SW(config-std-nacl)#exit
=> Gán vào cổng chỉ định:
SW(config)#interface gigabitEthernet 1/0/2
SW(config-if)#ip access-group INTERNET in
SW(config-if)#exit
=> Như vậy những IP nào mà Permit thì mới cho phép đi qua Port gigabitEthernet 1/0/2 ra mạng Internet.
=> Lệnh Show
SW#show access-lists INTERNET
=> Tạo Access-list trên Switch Layer3 3750
SW_U46-B1(config)#access-list 1 permit host 183.81.32.228
SW_U46-B1(config)#interface gigabitEthernet 1/0/6
SW_U46-B1(config-if)#ip access-group 1 in
Liên hệ:
Qua Hotline: 024 7305 6666 - 0936 300 136 - 028 7308 6666 - 0936 108 858 hoặc điền vào mẫu Liên hệ
CÔNG TY CỔ PHẦN DỮ LIỆU TRỰC TUYẾN VIỆT NAM
Địa chỉ: ố 61 Mễ Trì Thượng, Phường Mễ Trì,Quận Nam Từ Liêm,Thành Phố Hà Nội, Việt Nam