# **Cisco設備設定參考要點** --- # 一、常用設定項目 --- | 設定指令 | 用途說明 | | ------- | -------- | | clock timezone UTC 8 0|#設定本地時間為 UTC+8(例:台灣時間)| | ntp server 192.168.21.8|#設定設備透過NTP與內部伺服器同步時間,例IP:192.168.21.8| | logging buffered 40960 | #將syslog訊息記錄至記憶體緩衝區,最大緩衝大小為 40960 bytes(約40KB)。可用show logging 來查看此緩衝訊息,應用於除錯。| |no ip domain lookup| #當輸入錯誤指令時,不會誤觸DNS查詢,避免CLI卡住等待名稱解析。| |login on-success log|#啟用登入成功的紀錄功能,登入成功會寫入系統 log方便稽核。| # 二、VLAN部分 --- | 設定指令 | 用途說明 | | ------- | ------ | |vtp mode transparent|#不參與VLAN同步,也不接收或傳送VLAN更新且VLAN必須自行設定| |no ip redirects |#增強安全性,避免主機學習非預期路由(防止攻擊/混亂)| # 三、建置netflow --- ## 建立一條網路專線的input | 設定指令 | 用途說明 | | ------- | -------- | |flow record FNF-input |建立一個名為 FNF-input 的 flow record。| |description IPv4 NetFlow|說明此 Flow Record 是用於 IPv4 的 NetFlow。| |match ipv4 source address|比對來源 IP 位址。| |match ipv4 destination address|比對目的 IP 位址。| |match transport source-port|比對來源傳輸層(TCP/UDP)Port。| |match transport destination-port|比對目的傳輸層 Port。| |match ipv4 protocol|比對L3使用的協定(例如 TCP=6、UDP=17)。| |match interface input|比對流量進入的實體介面。 |match ipv4 tos|比對服務類型(Type of Service / Differentiated Services)。| |match flow direction|比對流量方向(input/output)。| |collect interface output|收集流量的輸出介面。| |collect counter bytes long|收集此 flow 傳送的 byte 數(64-bit 計數器)。| |collect counter packets long|收集此 flow 的封包數量。 |collect transport tcp flags|收集 TCP flags(如 SYN, FIN 等,適用於 TCP)。| |collect timestamp absolute first|記錄 flow 的第一個封包時間戳。| |collect timestamp absolute last|記錄 flow 的最後一個封包時間戳。| ## 建立一條網路專線的output | 設定指令 | 用途說明 | | ------- | -------- | |flow record FNF-input |建立一個名為 FNF-input 的 flow record。| |description IPv4 NetFlow|說明此 Flow Record 是用於 IPv4 的 NetFlow。| |match ipv4 source address|比對來源 IP 位址。| |match ipv4 destination address|比對目的 IP 位址。| |match transport source-port|比對來源傳輸層(TCP/UDP)Port。| |match transport destination-port|比對目的傳輸層 Port。| |match ipv4 protocol|比對L3使用的協定(例如 TCP=6、UDP=17)。| |match interface output|比對流量輸出的實體介面。| |match ipv4 tos|比對服務類型(Type of Service / Differentiated Services)。| |match flow direction|比對流量方向(input/output)。| |collect interface input|收集流量的 輸入介面(互換了 input/output)| |collect counter bytes long|收集此 flow 傳送的 byte 數(64-bit 計數器)。| |collect counter packets long|收集此 flow 的封包數量。| |collect transport tcp flags|收集 TCP flags(如 SYN, FIN 等,適用於 TCP)。| |collect timestamp absolute first|記錄 flow 的第一個封包時間戳。| |collect timestamp absolute last|記錄 flow 的最後一個封包時間戳。| | 總結說明 | FNF-input | FNF-output | |------|-----------|------------| | 觀察方向 | 進站流量 | 出站流量 | | match interface | `input` | `output` | | collect interface | `output` | `input` | | 功能目的 | 檢測誰流入設備 | 檢測誰流出設備 | # 四、LACP設置 --- ```code 1.建立Port-Channel介面(邏輯介面) interface Port-channel1 description LACP Aggregate Link #使用description自訂描述 switchport switchport mode trunk spanning-tree portfast trunk 2.把實體介面加進 Port-Channel,設定LACP模式為 active interface GigabitEthernet1/0/1 #設定第一埠Ga1/0/1 switchport switchport mode trunk channel-group 1 mode active #active:主動發起LACP封包、passive:被動等待LACP封包 interface GigabitEthernet1/0/2 #設定第二埠Ga1/0/2 switchport switchport mode trunk channel-group 1 mode active 3.確認相關資訊 show etherchannel summary #查看 Port-Channel 狀態 show etherchannel 1 detail #查看詳細資訊 show lacp neighbor #查看每一埠的 LACP 狀態 ``` ==注意事項== (1)所有加入同一個 Port-Channel 的埠: (2)速率需相同(需全為1G或10G) (3)VLAN 設定需一致 (4)雙方 trunk/native 設定需相同
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.