or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
CCNA
簡介
ctrl
+shift
+6
: 中斷程式?
: helpSwitch設定
關掉加密功能,關掉前已經加密的密碼還是會顯示加密過的
設定檔
恢復原廠設定
密碼恢復
斷線時間,可設在console, vty,預設是10分鐘,0的話是不斷線
輸入指令時不會被系統訊息干擾
Router設定
設定密碼
vty
介面會有login
設定 IPv4 Routre Interface
DTE: 網路終端 (router)
DCE: 電路終端 (ISP控制的機器)
兩台router對接時要由一台來當DCE,設定連線速度
packet tracer 中紅色有時間符號的是專線,先點的那端是DCE
查詢是否為DCE
連線備註
configuration register
0000
: 檢查硬體後停在ROM0001
: 用ROM中的舊作業系統開機0
: 依startup-config執行1
: 忽略start-config密碼重設
開機後在IOS完全載入前按
ctrl
+break
中斷Switching Network and Security
網路規劃
設備種類
Switch LED
雙工
10M~100M只用到四根接腳
Cat5→100M、Cat5E→155M、Cat6→250M
1000M的話四跟線一定都要同時使用,因此不可能為半雙工
兩端都要是auto才能自動偵測,當自動偵測測不出來時預設會是半雙工
兩端設定不一時,碰撞率會提高
siwtch雙工模式
Auto-MDIX
交換器基本觀念
IOS Command
Switching Security
SSH
確認有沒有支援
設domain name,因為要用hostname與DNS產生金鑰,所以hostname也不能是預設值
設定使用者帳號密碼
限制只能用SSH連線
刪掉金鑰
Storm Control
Protected Port
Port Blocking
Port Security
port只能讓某個MAC address使用
port最多只能學習多少個網卡卡號
static secure MAC addr
dynamic secure MAC addr(預設): 第一個學到的
sticky secure MAC addr: 學習時會自動產生指令存到running config
學到超過一個MAC
shutdown
,再下no shutdown
最多可以學到幾個
查看設定
VLAN Trunk and VLAN routing
VLAN
對user來說是logical群組
不同VLAN屬於不同subnetwork
type
創vlan的方法
查看vlan
vlan設定檔vlan.bat放在flash中
creating a VLAN
設定VLAN所屬的port
刪除設定
VLAN Trunk
TRUNK介面透過tagging技術(1Q or ISL)可傳遞不同VLAN的流量
設定trunk
常見trunk的問題
native vlan mismatch
trunk mode mismatch
allowed vlans on trunks
VLAN Trunking Protocal
多部switch間維護VLAN資料不容易
用於自動更新VLAN DB
根據版本號最大者替代可能造成問題
版本號被歸零
查看
VTP設定
VTP環境,同domain下才能交換,沒設的收到會自動學習同步
VTP版本
dynamic trunking protocal, DTP
為了自動辨別介面是否需要成為trunk介面
DTP on: manually設定為trunk
DTP desirable: 自動偵測
DTP auto: 被動偵測,default
DTP off: 關閉DTP
VLAN routing
VLAN間需要靠L3設備轉送
三種方法
Legacy inter-VLAN routing
Router-on-a-Stick
Layer 3 switching using SVIs
L2 Redundancy, STP, STP-related Technologies
L2 loop
三個問題
解決辦法
STP:
port state:
指令
修改cost值
查看相對資訊
RSTP的edge port是個不接其他switch的switch port,因此可以link起來後馬上加入spanning tree,但可能會造成其他問題
EtherChannel
EtherChannel
把多個線併起來變成邏輯上的一個port
特色
PAgP
on
: 直接啟動desirable
: 主動,送測試訊息到對方auto
: 被動LACP
on
: 強迫active
: 主動passive
: 被動設定
FHRP
HSRP
版本:
priorty比較高的就是active router
stanby priority
這條指令設定stanby preempt
: 會讓最高priority 的routerst當作active設定
Cisco專屬
VRRP
GLBP
Power over Ethernet
網路線也是電源線
相關設定
Port Mirroring
port的流量複製一份傳到另外一個port
switch port analyzer, SPAN
remote SPAN: 複製一份丟掉另外一個switch的某個port上
local SPAN設定
remote SPAN設定: 利用vlan
Static Routing, Dynamic Routing & RIP
router
static
dynamic
metric
static route generaion
ipv6 routing
ipv6 routing預設是關掉的
要記得下
Dynamic Routing
RIP
packet
timer
路徑 metric 路量值為經過 hub 數
config
RIPv1 vs RIPv2
default為v1
v1的route資訊不含mask,因此不支援VLSM/CIDR,收到時只能套用收到介面的mask
v2支援認證
default是v1, v2都收,v2不收v1的訊息
版本切換
被動介面: 只收不送routing資訊,當interface接的LAN內沒有router時可以用
不連續網路問題
兩個相同class的網路中間隔了一個其他class的subnet,RIP封包會自動合併subnet
解決方法
傳遞default route
查看資訊
OSPFv2 & OSPFv3
OSPF
States
OSPFv2
process-id為1~65535,本地有效,router間不需相同
router ID 為唯一識別,不能重複,優先順序為
利用router-id命令指定
loopback介面之 IP 最大值 (開機自動up)
loopback介面config
active狀態介面之 IP 最大值 (不見得會是預期的)
已經設好的router ID 再設定一次不一定會更改,可以重新執行ospf process來更改
網路位址:
wildcard-mask
只收資訊不送出的被動介面設定 (passive-interface) 與 RIP, EIGRP相同
將default route利用 Routing Protocal 轉送出去,設定與 RIP 相同
路徑 metric 度量值為 cost,計算方式為 \(10^8/bps\)
10 Mbps cost = 10
100 Mbps 以上 cost = 1
修改參考頻寬 (\(10^8\))
serial介面之頻寬計算可能與實際不符 (租的頻寬跟預設的1544K可能不一樣)
可以直接在網路介面上指定cost
檢查鄰居
OSPFv3
router ID是32 bit,一定要直接指定
ipv6 default routing
hello packet來源是link local address
link-local address
Multi-Area OSPF
area: 差異在跟其他area交換資料的種類
stub area: 網路末端,會有一台router接backbone,不會再接往其他area
totally stubby area: 只保存area內的資料跟default route
not so stubby area, NSSA: 會皆非OSPF area,外部路由資訊可以傳遞進來
NSSA totally stubby area
Access Control Lists
Standard ACL
設定
早期 IOS 1-99 是給 Standard ACL用的,100-1200 是給 Extended ACL
來源位址條件
Log: 比對成功要記錄下來
刪掉ACL: 只能刪掉整個 list,不能刪掉某條 rule
修改時最好先關掉 ip access-group
查詢
named ACL: 可以刪掉裡面某條 rule,或是插入 rule
插入: 先查詢目前 rule 的編號狀態,再用新的編號插入
保護 vty
Extended ACL
設定
各 protocal 的來源/目的條件:
ip: ip wildcard
tcp/udp: port 編號通常只出現在一邊
icmp