一、模式命令,
首次開機,路由器設備需要初始化,這里我選擇no,
Router> 用戶模式
Router>enable 進入特權模式
Router# 特權模式
Router#configure terminal 進入全域配置模式
Router(config)# 全域配置模式
ctrl +v shift ? 控制臺輸入?
二、基本命令
Router(config)#hostname RO1 配置路由器名稱
Router(config)#no hostname 取消設定的用戶名
RO1(config)#enable password 123456 配置登錄密碼
RO1(config)#enable secret 1234567 配置使用加密密碼
RO1(config)#interface Ethernet 0/0 進入e0/0埠
RO1(config-if)#interface e0/0.10 進入e0/0.10子介面
RO1(config-if)#int e0/0 RO1(config-if)#ip address 192.168.1.1 255.255.255.0 設定埠IP地址
RO1(config-if)#no shutdown 啟用埠
RO1(config-if)#shutdown 關閉埠
RO1(config-if)#exit 退出介面
RO1(config)#end 退出全域配置模式
RO1#write 保存設定
RO1#disable 退出特權模式
三、查看命令
1.思科發現協議
CDP ( Císco Discovery Protocol)思科發現協議,通過cdp,我們可以獲取相鄰設備上的硬體和協議資訊,這些資訊可用于排除故障和記錄網路資訊,
cdp 定時器:描述所有活動介面將CDP分組發送出去的時間間隔,
cdp 保持時間:描述接收自相鄰設備的cdp分組應當被當前設備保持的時間長度,
RO1#show cdp 查看設備的cdp全域配置資訊 RO1#show cdp interface e0/0 查看設備的e0/0埠的cdp配置資訊 RO1#show cdp traffic 查看有關cdp包統計資訊 RO1#show cdp neighbors 查看直接連接設備的相關資訊
RO1#cdp holdtime ?
<10-255> Length of time (in sec) that receiver must keep this packet
RO1#cdp timer ?
<5-254>
2.基本查看命令
RO1#show version 查看系統中的所有版本資訊
RO1#show running interface e0/0 查看介面配置的資訊
RO1#show ip route 查看路由器的路由表
RO1#show log 查看路由器的log資訊
RO1#show ip arp 查看設別學習到的arp資訊
RO1#show arp detail 查看設別具體從哪個埠上學習到的
RO1#show ip interface brief 查看路由器IP地址資訊
RO1#show int e0/0 查看埠詳細
RO1#show cdp neighbors detail 用于搜集吡鄰資訊
RO1#show int st 查看路由器的介面是否up
RO1#show interfaces description 查看介面鏈接的描述資訊
四、基本設定
RO1(config)#int e0/0 進入e0/0埠
RO1(config-if)#description miaoshu 對埠設定描述
RO1#sh run int e0/0 顯示埠詳細描述
RO1(config-if)#ip address 192.168.1.1 255.255.255.0 為e0/0埠配置IP地址為192.168.1.1
RO1(config)#ip default-gateway 192.168.1.1 配置網關
RO1(config-if)#no shutdown 啟用埠
RO1(config)#line console 0 進入控制臺口
RO1(config)#no ip domain lookup 關閉域名決議
RO1(config-line)#logging synchronous 開啟資訊同步
RO1(config-line)#exec-time 5 5 設定超時操作時間(分鐘,秒)
RO1(config-line)#no exec-timeout 關倍訓話超時
RO1(config-line)#line vty 0 4 設定允許0-4個用戶可以遠程登錄
RO1(config-line)#login 要求口令驗證
RO1(config-line)#password 123456 設定登錄口令xx
RO1#reload 重新引導
RO1#wr er 恢復出廠設定
RO1#copy running-config startup-config 保存配置
RO1#copy running-config tftp 保存配置tftp
RO1#copy startup-config tftp 開機配置存到tftp
RO1#copy tftp startup-config 下載組態檔到tftp
RO1(config)#clock timezone GMT +8 設定時間時區
RO1#show clock 查看時區
RO1#sh cdp neighbors 查看各個介面鏈接,思科私有的
RO1(config)#lldp run 開啟lldp協議(公用協議)
RO1#show lldp neighbors 顯示lldp資訊
RO1(config)#no ip routing 關閉路由功能
RO1#clock set 21:46:30 13 jun 2019 設定時間
RO1(config)#banner motd #
*************************************************
weclome to alan
*************************************************
# 為登錄設定標語最后以#結束
五、靜態路由
1.配置靜態路由
配置出介面:非常依賴下一跳的代理ARP,關閉代理arp,就ping不通,
配置下一跳:出發遞回,
2.靜態路由最優:先寫出介面,再寫下一跳,
RO1(config)#ip route 2.0.0.0 255.255.255.0 e0/0 添加一條靜態路由(目的網路,子網掩碼(目的),下一跳地址)
RO1(config)#int loopback 1 啟動一個環回口
RO1(config-if)#ip add 1.1.1.1 255.255.255.0 為環回口設定ip
RO1#traceroute ip 追蹤兩端中得每一跳(目標IP地址 ,源地址)
RO1#show ip route static 顯示靜態路由的配置
3.ARP(Address Resolution Protocol)地址決議協議
作用:將已知的ip地址決議為MAC地址,
4.ARP請求報文,廣播請求,單播更新,
5.基本命令
RO1#show arp 查看ARP地址表映射
RO1(config-if)#no ip proxy-arp 關閉代理ARP
RO1(config)#arp 192.168.1.3 0003.0003.0003.0003 arpa 系結mac地址
RO1(config)#ip classless 打開有類路由功能
6.代理ARP:靜態路由,只有出介面,沒有下一跳的時候,會觸發代理ARP,
7.ARP特性:后到優先,多條路由情況,會導致次優,
六、RIP(Routing Information Protocol)路由協議
1.Rfc( 思科官網檔案編號):1058,
2.距離矢量協議,傳遞路由,不知道路由拓撲,
3.度量值:跳數,跳數超過15不可達,
4.每30秒收斂一次,也可觸發式更新,
5.V1使用廣播,V2使用組播,組播地址:224.0.0.9,
6.管理距離120,
7.RIPv1有類路由(不傳遞子網掩碼),RIPv2無類路由(傳遞子網掩碼,方便精確生成路由),
8.使用UDP協議傳輸,
9.源目的埠號520,
10.協議號:17,
11.訊息形式:請求訊息,回應訊息,
12.默認支持等價負載均衡:4 ,最大支持6,
13.RIP計時器
更新計時器(update):30s更新路由表,
無效計時器(invalid):180s不重繪則將該路由條目的度量值設定為16.
重繪計時器(flush):默認240s,比無效計時器長60s,重繪后路由條目則洗掉,
抑制計時器(Hold-down):180s,
14.RIPv1
1.有類路由協議
2.不支持變長子網掩碼(VLSM)
3.更新方式為廣播
4.不支持認證
5.每個更新包最大支持25條路由條目
6.路由表查詢方式主類網段
7.不支持不連續子網
15.RIPv2
1.無類路由協議
2.支持變長子網掩碼(VLSM)
3.路由更新方式為多播,目的地址為224.0.0.9
4.支持明文及密文認證(思科私有)
5.路由表查詢機制是由小類=》大類(按位查詢,最長匹配、精確匹配,先檢查32位掩碼的)
6.支持不連續子網
16.缺點:
1.選路只看跳數,最大跳數為16
2.收斂速度慢
3.更新浪費網路資源
17.基本命令
Router(config)#router rip 進入rip配置模式 Router(config-router)#version 2 設定版本(不設定版本,默認介于v1和v2之間) Router(config-router)#no auto-summary 關閉自動匯總
Router(config-router)#network 2.2.2.2 宣告進組播分組(宣告C網段地址)
Router#show ip route 查看路由表
Router#show ip rip database 顯示rip資料庫中的資訊
Router(config-router)#passive-interface e0/0 配置介面為被動介面
Router#show ip route
R 23.1.1.0 [120/1] via 12.1.1.2, 00:00:28, Ethernet0/0
備注:120表示管理地址,1表示開銷,rip以跳數計算,1表示1跳,
18.RIP路由環路,

七、OSPFv2(Open Shortest Path First)
1.RFC(思科官網檔案編號):2328
2.鏈路狀態路由協議:傳遞資料庫,知道整個路由拓撲,
3.度量值cost=10的8次方/寬帶
4.使用hello包建立鄰居,10s利用組播發送一次,組播地址224.0.0.5
5.管理距離:110.
6.沒有自動匯總功能
7.無類路由
8.OSPF協議號:89
9.五種資料報文:Hello,DBD(Database Description),LSR(Link-State Requeest),LSU(Link-state Update),LACK(Link-State Acknowledgement)
10.默認支持等價負載均衡4,最大支持16,只支持等價負載均衡,
11.Router-ID:環回口地址/活動的物理介面最大值
12.Hello作用:1.發現鄰居,2.對一些資料的協商,3.保持鄰居的Keeplive狀態,選舉DR、BDR,其他的稱other()224.0.0.6,
13Hello-interval=10s dead-interval=40s
14.形成鄰居的條件:區域號,認證型別,hello時間,死亡時間,
15.OSPF的八種狀態:Down,init,way,Exstart,Exchange,Loading,Full.
16.DR/BDR選舉
1.查看優先級,列出能參選DR/BDR的和申明自己就是DR/BDR的,
2.建立一個沒有申明自己就是DR的子集,申明自己是DR的不能被選成BDR,
3.在此子集中,優先級大的,router-id大的成為BDR,
4.然后選擇DR,若無宣告自己是DR的話,則新選的BDR成為DR,
17.基本命令
R1(config)#interface loopback 1 R1(config-if)#ip address 1.1.1.1 255.255.255.0 R1(config-if)#ip ospf network point-to-point /配置網路型別,不然會出現32主機路由 R1(config-if)#interface s1/1 R1(config-if)#ip address 10.1.1.2 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#interface s1/2 R1(config-if)#ip address 30.1.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#exit R1(config)#router ospf 100 /配置基本的 OSPF
R1(config-router)#distance 19 1.1.1.1 0.0.0.1 修改ospf的管理距離為19
R1(config-router)#router-id 1.1.1.1 /指定路由器 ID
R1(config-router)#network 10.0.0.0 0.0.0.255 area0 /通告直連路由建立鄰居關系
R1(config-router)#network 30.0.0.0 0.0.0.255 area0 /通告直連路由建立鄰居關系
R1(config-router)#network 1.1.1.0 0.0.0.255 area 0 /通告直連路由到骨干區域
R1(config-router)#exit
八、EIGRP
1.協議號:88,
2.組播地址:224.0.0.10,
3.管理路徑:內部(90),外部(170),匯總(5),
4.高級距離矢量協議
5.快速收斂
6.支持VLSM和不連續的子網
7.區域更新
8.支持多種網路層協議
9.組播和單播代替廣播更新
10.靈活的網路設計
11.組播喝廣播代替廣播更新
12.在網路中任何地方實作手動匯總
13.100%無環路的無類路由
14.支持WANs and LANs
15.可靠傳輸協議(RTP)保證EIGRP的包到達所有的鄰居
16.DUAL彌散更新演算法
Selects lowest-cost,loop free, paths to each destination
17.協議獨立模塊(PDMs)
EIGRP 支持IP,AppleTalk和Novell NetWare,每一種網路協議支持EIGRP都有 自己獨立的模塊,
18.DUAL演算法
作用:無環路徑,無環備用路徑,可可立即使用,快速收斂,限定更新以使用最少帶寬,
19.計算開銷的參考
Bandwidth(帶寬),Reliability(可靠性),Delay(延遲),Loading(負載),MTU(最大傳輸單元),
20.計算方法:256*[(10的7次方/鏈路最小介面帶寬)+(鏈路延遲之和/10)]
21.形成鄰居的條件:AS號必須相同,K值必須匹配,認證相同
22.基本配置命令
R1(config)#interface loopback 1 R1(config-if)#ip address 1.1.1.1 255.255.255.0 R1(config-if)#interface s1/1 R1(config-if)#ip address 10.1.1.2 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#interface s1/2 R1(config-if)#ip address 30.1.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#exit R1(config)#router eigrp 100 /配置基本的 EIGRP R1(config-router)#network 10.0.0.0 0.0.0.255 /通告直連路由建立鄰居關系 R1(config-router)#network 30.0.0.0 255.255.255.0 /通告直連路由建立鄰居關系 R1(config-router)#network 1.1.1.0 /通告直連路由到骨干區域 R1(config-router)#exit
Router#show run | sec eigrp 查看eigrp的配置資訊
Router#show ip ei topology all-links 顯示EIGRP拓撲表中的所有條目
R1(config-if)#bandwidth 100000 設定帶寬
R1(config-if)#delay 1000 設定延遲
R1(config-router)#variance 15 Variance 值通過控制備用鏈路的Metric 值與FD 的倍數
關系來控制,設定非等價負載
九、IS-IS(Intermediate System-Intermediate System)中間系統=中間系統
1、IS-IS與OSPF對比
相同:鏈路狀態路由協議、演算法SPF(LSDB同步一致)、 層次化、適用大型網路
不同:ospf區域劃分復雜,網路型別復雜
2、基本命令
R2配置: Router(config)#frame-relay switching Router(config)#ho FR-SW FR-SW(config)#int s1/0 FR-SW(config-if)#encapsulation frame-relay FR-SW(config-if)#frame-relay intf-type dce FR-SW(config-if)#frame-relay route 103 interface s1/1 301 FR-SW(config-if)#no sh FR-SW(config-if)#int s1/1 FR-SW(config-if)#encapsulation frame-relay FR-SW(config-if)#frame-relay intf-type dce FR-SW(config-if)#frame-relay route 301 interface s1/0 103 FR-SW(config-if)#no sh R1配置: Router(config)#int s1/0 Router(config-if)#encapsulation frame-relay Router(config-if)#no sh R3配置: Router(config)#int s1/1 Router(config-if)#encapsulation frame-relay Router(config-if)#no sh R5配置(模擬終端PC): Router(config)#no ip routing Router(config)#clns net 49.0001.0000.0000.0005.00 Router(config)#int e0/0 Router(config-if)#no sh Router(config-if)#clns enable 開啟clns R4配置: Router(config)#clns routing Router(config)#router isis Router(config-router)#log-adjacency-changes Router(config-router)#net 49.0001.0000.0000.0004.00 Router(config-router)#int e0/0 Router(config-if)#clns enable Router(config-if)#no sh Router(config-if)#end Router#show clns neighbors 查看鄰居 R3配置:
Router(config)#no ip routing
R4配置:
Router(config)#no ip routing
R3配置:
Router(config)#clns routing
Router(config)#router isis
Router(config-router)#log-adjacency-changes
Router(config-router)#net 49.0001.0000.0000.0003.00
Router(config-router)#int s1/0
Router(config)#int s1/0
Router(config-if)#clns router isis
Router(config-if)#no sh
R4配置:
Router(config)#int s1/0
Router(config-if)#clns router isis
Router(config-if)#do debug isis adj
Router(config-if)#do debug isis updat
Router(config-if)#no sh
Router(config-if)#do un all
Router#show clns protocol
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/45179.html
標籤:其他
上一篇:內網學習之MySQL服務提權
下一篇:嗅探、DNS劫持配合CS釣魚
