Computer >> Hướng Dẫn Máy Tính >  >> Kết Nối Mạng >> An Ninh Mạng

Cách thay đổi cài đặt bảo mật mạng trên thiết bị Cisco

Thay đổi cài đặt bảo mật trên Cisco Router/Switch/AP

Thiết bị Cisco (Router ISR/ASR, Switch Catalyst/Nexus, AP Aironet/Catalyst, Meraki, Firepower) có giao diện CLI (IOS/IOS-XE/NX-OS) và/hoặc GUI (Web UI, Meraki Dashboard, Firepower Management Center). Dưới đây là hướng dẫn chung cho các tác vụ phổ biến.

1. Đăng nhập thiết bị Cisco

  • Console Cable: Kết nối cáp Console (RJ45-USB) → PuTTY/Tera Term (9600-8-N-1).
  • SSH (Khuyên dùng): `ssh admin@` (cần bật SSH, tắt Telnet).
  • Web UI: `https://` (cần bật `ip http secure-server`).
  • Meraki Dashboard: `dashboard.meraki.com` (cloud-managed).
  • Firepower Management Center (FMC): Quản trị Firepower Threat Defense (FTD).

2. Thay đổi chế độ mã hóa Wi-Fi (Cisco AP/WLC/Meraki)

CLI (IOS-XE AP / WLC):

! Vào chế độ config WLAN
config wlan security wpa wpa2 ciphers aes enable 
config wlan security wpa akm psk enable 
config wlan security wpa akm 802.1x disable   ! Nếu dùng PSK
config wlan security wpa psk set-key ascii  
config wlan enable 

WPA3 (SAE) trên WLC 9800/IOS-XE 17.x+:

config wlan security wpa wpa3 enable 
config wlan security wpa akm sae enable 
config wlan security wpa psk set-key ascii  

Meraki Dashboard (Cloud):

  1. Wireless → Configure → Access control.
  2. Chọn SSID → Association: WPA3 only (hoặc WPA2/WPA3 Transition).
  3. PSK: Nhập mật khẩu mạnh → Save.

3. Hardening Cisco Router/Switch (Cốt lõi)

! 1. Tắt dịch vụ không cần thiết
no service pad
no service tcp-small-servers
no service udp-small-servers
no ip http server
no ip http secure-server  ! Nếu không dùng Web UI
no cdp run  ! Hoặc 'cdp enable' chỉ trên interface cần thiết
no lldp run  ! Tương tự

! 2. Mật khẩu & AAA mạnh
enable algorithm-type scrypt secret 
username admin privilege 15 algorithm-type scrypt secret 
aaa new-model
aaa authentication login default local
aaa authorization exec default local
line vty 0 4
 transport input ssh  ! Chỉ cho SSH, KHÔNG Telnet
 login authentication default
 exec-timeout 5 0
logging synchronous

! 3. SSH Hardening
ip ssh version 2
ip ssh time-out 60
ip ssh authentication-retries 3
ip ssh algorithm encryption aes256-ctr aes192-ctr aes128-ctr
ip ssh algorithm mac hmac-sha2-256 hmac-sha2-512
ip ssh algorithm kex curve25519-sha256 curve25519-sha256@libssh.org diffie-hellman-group-exchange-sha256
crypto key generate rsa modulus 4096  ! Key 4096-bit

! 4. Bảo vệ Control Plane (CoPP/CPPr)
! 5. Logging & Monitoring
logging buffered 512000
logging host  transport tcp port 6514  ! TLS syslog
logging trap informational
service timestamps log datetime msec localtime show-timezone
service sequence-numbers

! 6. Bảo vệ Routing Protocol (Nếu chạy OSPF/EIGRP/BGP)
router ospf 1
 area 0 authentication message-digest  ! Hoặc key-chain
! Key-chain cho OSPF/EIGRP/BGP/ISIS/RIPng

! 7. Port Security (Switch Access Port)
interface range Gi1/0/1 - 48
 switchport mode access
 switchport port-security
 switchport port-security maximum 2
 switchport port-security violation restrict
 switchport port-security aging time 2
 switchport port-security aging type inactivity
 spanning-tree portfast
 spanning-tree bpduguard enable

! 8. DHCP Snooping / DAI / IP Source Guard (Switch)
ip dhcp snooping
ip dhcp snooping vlan 10,20,30
no ip dhcp snooping information option
ip dhcp snooping limit rate 10
interface range Gi1/0/1 - 48
 ip dhcp snooping limit rate 10
! Trunk port: 'ip dhcp snooping trust'
ip arp inspection vlan 10,20,30
ip source binding ...  ! Hoặc 'ip verify source' trên access port

! 9. NTP An toàn
ntp server  key  prefer
ntp authenticate
ntp authentication-key  md5   ! Hoặc sha1

! 10. Banner pháp lý
banner motd ^C
*** UNAUTHORIZED ACCESS PROHIBITED ***
Violators will be prosecuted.
^C

4. Cisco Firepower (FTD) - Quản trị qua FMC

  • Access Control Policy: Block known bad (Talos IP Reputation, URL Filtering, File Policy - Malware, Snort IPS).
  • SSL Decryption Policy: Giải mã traffic HTTPS để kiểm tra (Policy-based, Known Key, Decrypt Resign).
  • Identity Policy: AD/LDAP integration cho User/Group based policy.
  • Intrusion Policy: Balanced Security / Connectivity / Security over Connectivity. Tune rule (Suppress false positive).
  • File Policy: Malware lookup (Cloud/Local), Dynamic Analysis (Sandbox), Block/Quarantine.
  • VPN: Site-to-Site (IPsec/IKEv2), Remote Access (AnyConnect/IKEv2), Profile, Group Policy.

5. Khôi phục khóa bảo mật / Reset Cisco

  • Password Recovery (Router/Switch): Break boot (Ctrl+Break / Send Break) → `confreg 0x2142` → `reset` → Bỏ qua startup-config → `enable` → `configure terminal` → `config-register 0x2102` → Đổi pass `enable secret` / `username secret` → `copy run start` → `reload`.
  • Factory Reset (Meraki/AP): Giữ nút Reset 10-20s (xem manual model cụ thể). Meraki: Claim lại trên Dashboard.

6. Best Practices tóm tắt

  • Quản trị Out-of-Band (OOB): Console Server / Terminal Server / Modem dial-up cho quản trị khi network down.
  • Config Version Control: Archive config lên Git (private repo) / TFTP/SCP server / Cisco DNA Center / NetBox / Ansible.
  • Change Management: Mọi thay đổi có ticket, review, test lab, rollback plan, maintenance window.
  • Audit định kỳ: `show running-config | include (password|secret|ssh|http|snmp|cdp|lldp|vty|aaa)`.
  • Automation: Ansible (cisco.ios, cisco.nxos, cisco.meraki, cisco.asa), Python (Netmiko, NAPALM, RESTCONF/NETCONF).

Kết luận

Thay đổi cài đặt bảo mật Cisco đòi hỏi hiểu rõ CLI (IOS/IOS-XE/NX-OS) và/hoặc GUI (Meraki/FMC). Tập trung vào: AAA mạnh (scrypt, MFA), Chỉ SSHv2, Tắt dịch vụ rác, CoPP, Port Security, DHCP Snooping/DAI, Logging tập trung, NTP an toàn, Routing Auth, Config Versioning, Automation. Luôn test trong lab trước khi áp dụng production. Cisco Meraki đơn giản hơn cho SMB (cloud UI), CLI IOS-XE/NX-OS linh hoạt nhất cho Enterprise/SP.