20201021 cisco RIP

課堂資料

Routing Information Rrotocol ( RIP ) 路由信息協定:

RIP版本差異

RIP v1
RIP v2
Layer
Application
Application
VLSM & CIDR
X
AD
120
120
Metric
hop count
hop count
Update Method
broadcast 255.255.255.255
multicast 224.0.0.9
Auto Summany
X

VLSM:Variable Length Subnet Mask

AD:Administration Distance

  • IEEE:OSI 第一第二層
  • RFC:OSI 第三層以上

課堂練習

Part 01.

期中練習:讓 R1、R2、R3 可以互 ping
操作筆記
設定 R1、R2、R3 IP、Route IP
IP
en
conf t
hostname [路由器名稱]
enable password [密碼]
int e0/0
ip addr [IP] [遮罩]
no shut
exit
int e0/1
ip addr [IP] [遮罩]
no shut
exit
int lo 0
ip addr [IP] [遮罩]
no shut
exit
do writ
do sh ip int brief
設定完後需互ping 測試
R1
R2
R3
Route IP
do sh ip ro
  • ro:同等 route
router rip
ver 2
  • ver:同等 version
no auto-summary
R1
R2
R3
network 12.1.1.0
network 13.1.1.0
network 1.1.1.0
network 12.1.1.0
network 23.1.1.0
network 2.2.2.0
network 13.1.1.0
network 23.1.1.0
network 3.3.3.0
exit
do show run
R1
R2
R3
exit
sh ip route rip
R1
R2
右擊開啟 Catpure > e0/0
ping 1.1.1.1 source 2.2.2.2
ping 1.1.1.1 repeat 10 source 2.2.2.2
ping 1.1.1.1 repeat 10 source 23.1.1.2
R3
int lo 1
ip addr 172.16.0.1 255.255.255.0
no shut
int lo 2
ip addr 172.16.1.1 255.255.255.0
no shut
int lo 3
ip addr 172.16.2.1 255.255.255.0
no shut
int lo 4
ip addr 172.16.3.1 255.255.255.0
no shut
do sh ip int brief
router rip
network 172.16.0.0
do sh run
^Z
sh ip route
執行結果
R1
R2
R3
R3 進行合併操作
int e0/1
ip summary-address rip 172.16.0.0 255.255.252.0
合併後網路遮罩將變為 22
R1
R2
同時清除 IP Route
clear ip route *
sh ip ro rip
同時清除 IP Route
clear ip route *
sh ip ro rip

Part 02.

操作筆記
R1
R2
R3
en
conf t
hostname R1
do writ
int e0/0
ip addr 192.168.12.1 255.255.255.0
no shut
exit
router rip
version 2
no auto-summary
network 192.168.12.0
exit
en
conf t
hostname R2
do writ
int e0/0
ip addr 192.168.12.2 255.255.255.0
no shut
exit
int e0/1
ip addr 192.168.23.2 255.255.255.0
no shut
exit
router rip
version 2
no auto-summary
network 192.168.12.0
network 192.168.23.0
exit
en
conf t
hostname R3
do writ
int e0/0
ip addr 192.168.23.3 255.255.255.0
no shut
exit
router rip
version 2
no auto-summary
network 192.168.23.0
exit

Passive Interface

操作筆記
R3只想在10.0.23.0/24執行RIP,而不想在10.0.34.0/24執行:
R3
router rip
ver 2
以下分為兩種方法:
method 1
method 2
使用 network 10.0.0.0 會讓兩個 interface 都被執行RIP,所以必須加一道passive-interface <interface>讓 e0/1 不執行RIP
passive-interface
先讓所有 interface passive,然後再 no 掉要執行的 interface
passive-interface default
on passive-interface e0/0
network 10.0.0.0

Default-Information Originate

操作筆記
R2 想發布 Default Route 給R1及R3,只需使用以下指令:
R2
router rip
default-information originate
在R1及R3可看到Default Route
R1
R3
sh ip ro rip
sh ip ro rip