1.路由協議基礎
共同的目的:更新、維護和控制3層的路由
工做機制:
RIP,封裝在UDP這個協議上,端口號520(優先級100)
OSPF,封裝在IP層,協議號89(優先級,內部10,外部是150-ASE)
中間系統到中間系統,OSI模型上的路由協議,直接封裝在2層上,直接把協議報文發到0014(L1)/0015(Level2)上,優先級15
BGP,封裝在TCP這協議上的,端口號179(優先級255)
RIP到底工做在3層仍是4層?
優先級本地有效(不能影響其餘路由器的協議競爭路由表)
2.RIP 基礎配置
報文:request、response(command)
基本的配置:
[R2]dis current-configuration configuration rip
[V200R003C00]
#
rip 1
network 10.0.0.0
network 22.0.0.0
[R2]dis rip 1 neighbor
IP Address Interface Type Last-Heard-Time
10.1.12.1 Serial2/0/0 RIP 0:0:10
Number of RIP routes : 2
RIP每一個30s來發送一次response
[R2]dis ip rou pro rip
Route Flags: R - relay, D - download to fib
Public routing table : RIP
Destinations : 3 Routes : 3 數據庫
RIP routing table status : <Active>
Destinations : 3 Routes : 3網絡
Destination/Mask Proto Pre Cost(HOP) Flags NextHop Interfaceide
1.0.0.0/8 RIP 100 1 D 10.1.12.1 Serial2/0/0
10.1.1.0/24 RIP 100 1 D 10.1.12.1 Serial2/0/0
11.0.0.0/8 RIP 100 1 D 10.1.12.1 Serial2/0/0
<R2>dis rip 1 route
Route Flags : R - RIP
A - Aging, G - Garbage-collect
Peer 10.1.12.1 on Serial2/0/0
Destination/Mask Nexthop Cost Tag Flags Sec
11.1.1.1/32 10.1.12.1 1 0 RA 180
10.1.1.0/24 10.1.12.1 1 0 RA 180
1.1.1.1/32 10.1.12.1 1 0 RA 180 //老話時間aging time到時,會切換到垃圾收集時間,此時路由消失,可是DB中依舊存在:<R2>dis ip rou pro rip
<R2>
<R2>dis rip 1 route
Route Flags : R - RIP
A - Aging, G - Garbage-collect
Peer 10.1.12.1 on Serial2/0/0
Destination/Mask Nexthop Cost Tag Flags Sec
11.1.1.1/32 10.1.12.1 16 0 RG 84
10.1.1.0/24 10.1.12.1 16 0 RG 84
1.1.1.1/32 10.1.12.1 16 0 RG 84 //進入120s的垃圾收集時間,意味着該表項中存在於RIP路由表,而全局路由表早已消失
[R2-rip-1]timers rip 29 179 119 //修改RIP的時間值
3.防環機制:
1)水平分割(split horizon),從某個接口收到了路由。就不會再把該路由從接口發出去(被動方式)
<R2>dis rip 1 int ver
Serial2/0/0(10.1.12.2)
State : UP MTU : 500
Metricin : 0
Metricout : 1
Input : Enabled Output : Enabled
Protocol : RIPv2 Multicast
Send version : RIPv2 Multicast Packets
Receive version : RIPv2 Multicast and Broadcast Packets
Poison-reverse : Disabled
Split-Horizon : Enabled //水平分割開啓
Authentication type : None
Replay Protection : Disabled
2)毒性逆轉,發送不可達路由告知鄰居路由器(主動方式,壞消息總比沒有消息強)
interface Serial2/0/0
link-protocol ppp
ip address 10.1.12.2 255.255.255.0
rip poison-reverse //開啓毒性逆轉
3)觸發更新
拍錯:
rip metricin 15 //入方向度量值15
[R2]display rip 1 database //驗證數據庫
Advertisement State : [A] - Advertised
[I] - Not Advertised/Withdraw 表明消失
1.0.0.0/8, cost 16, ClassfulSumm
1.1.1.1/32, cost 16, [I], nexthop 10.1.12.1
10.0.0.0/8, cost 0, ClassfulSumm
10.1.1.0/24, cost 16, [I], nexthop 10.1.12.1
10.1.12.0/24, cost 0, [A], Rip-interface
11.0.0.0/8, cost 16, ClassfulSumm
11.1.1.1/32, cost 16, [I], nexthop 10.1.12.1
[R1-Serial2/0/0]rip metricout 9
interface Serial2/0/0
link-protocol ppp
ip address 10.1.12.1 255.255.255.0
rip metricout 2000 8 //精準的對acl 2000匹配的路由來進行度量值的修改
[R1]dis acl all
Total quantity of nonempty ACL number is 1
4.靜默端口(RIP、OSPF、中間系統到中間系統都存在)
不在發送某種協議的報文,一般用在環回接口以及鏈接終端的接口上,用於構建鄰居的物理接口上。
rip 1
version 2
network 10.0.0.0
network 22.0.0.0
silent-interface all //靜默全部接口
silent-interface disable Serial2/0/0//排除物理接口,物理接口不要靜默,用於構建鄰居code
Basic ACL 2000, 1 rule
Acl's step is 5
rule 10 permit source 1.1.1.1 0 (3 matches)
5.彙總:在路由可用的前提下減小路由條目數
RIP能夠在任何一個設備作彙總,要在路由更新出去的接口來實施
11.1.1.1 0000,0001
11.1.1.2 0000.0010
11.1.1.3 0000,0011
11.1.1.0 255.255.255.252
[R1-Serial2/0/0]rip summary-address 11.1.1.0 255.255.255.252 //推薦使用手工彙總
[R2-rip-1]dis ip rou pro rip
Route Flags: R - relay, D - download to fib
Public routing table : RIP
Destinations : 3 Routes : 3 接口
RIP routing table status : <Active>
Destinations : 3 Routes : 3ip
Destination/Mask Proto Pre Cost Flags NextHop Interfaceci
1.1.1.1/32 RIP 100 8 D 10.1.12.1 Serial2/0/0
10.1.1.0/24 RIP 100 1 D 10.1.12.1 Serial2/0/0
11.1.1.0/30 RIP 100 1 D 10.1.12.1 Serial2/0/0
不推薦的自動彙總,把路由彙總到主類的邊界
[R2-rip-1]summary always
[R2-rip-1]dis ip rou pro rip
Route Flags: R - relay, D - download to fib
Public routing table : RIP
Destinations : 3 Routes : 3 路由
RIP routing table status : <Active>
Destinations : 3 Routes : 3it
Destination/Mask Proto Pre Cost Flags NextHop Interfaceio
1.0.0.0/8 RIP 100 1 D 10.1.12.1 Serial2/0/0
10.1.1.0/24 RIP 100 1 D 10.1.12.1 Serial2/0/0 //爲何這條路由沒有自動彙總呢?
11.0.0.0/8 RIP 100 1 D 10.1.12.1 Serial2/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
若是須要彙總的網絡和RIP構建鄰居的接口同一個主類網絡,則不會彙總
需求:1.兩個設備各自通告自身的環回接口,創建鄰居以後手工彙總環回接口到/162.靜默全部接口,請使用單播來創建鄰居關係,使用單播來更新RIP報文3.R1增長一個額外的環回接口1.1.1.1,R2上獲得這一條路由的度量爲15