掌握目标

一、基本IP地址配置
二、配置RIPV1
三、配置RIPV2
四、重分布静态路由
五、手工汇总路由
六、明文与MD5认证

拓扑一

华为路由交换由浅入深系列(三): RIP简单配置、路由汇总、认证、重分布静态_RIP

实验配置如下:

一、基本配置:
R1:
interface Serial1/0/0
ip address 10.0.12.1 255.255.255.0
interface LoopBack0
ip address 10.0.1.1 255.255.255.0

R2:
interface Serial1/0/0
ip address 10.0.12.2 255.255.255.0
interface Serial2/0/0
ip address 10.0.23.2 255.255.255.0
interface LoopBack0
ip address 10.0.2.2 255.255.255.0

R3:
interface Serial2/0/0
ip address 10.0.23.3 255.255.255.0
interface LoopBack0
ip address 10.0.3.3 255.255.255.0

测试:
[R2]ping 10.0.12.1
PING 10.0.12.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.1: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 10.0.12.1: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 10.0.12.1: bytes=56 Sequence=3 ttl=255 time=10 ms
[R2]ping 10.0.23.3
PING 10.0.23.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 10.0.23.3: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 10.0.23.3: bytes=56 Sequence=3 ttl=255 time=10 ms

二、配置RIPv1协议
R1:
[R1]rip 1 ===启用RIP进程
[R1-rip-1]network 10.0.0.0 ===宣告网络到RIP进程

R2:
[R2]rip
[R2-rip-1]network 10.0.0.0

R3:
[R3]rip
[R3-rip-1]network 10.0.0.0

[R1]display ip routing-table protocol rip ====查看路由表中RIP路由
Route Flags: R – relay, D – download to fib
——————————————————————————
Public routing table : RIP
Destinations : 3 Routes : 3
RIP routing table status :
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.2.0/24 RIP 100 1 D 10.0.12.2 Serial1/0/0
10.0.3.0/24 RIP 100 2 D 10.0.12.2 Serial1/0/0
10.0.23.0/24 RIP 100 1 D 10.0.12.2 Serial1/0/0
测试:
[R1]ping 10.0.23.3
PING 10.0.23.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 10.0.23.3: bytes=56 Sequence=2 ttl=254 time=20 ms
[R1]ping 10.0.3.3
PING 10.0.3.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=10 ms
Reply from 10.0.3.3: bytes=56 Sequence=2 ttl=254 time=10 ms
Reply from 10.0.3.3: bytes=56 Sequence=3 ttl=254 time=10 ms

debugging rip 1 ====开启RIP调试信息,必须在用户视图开启
terminal debugging
terminal monitor
display debugging rip ====查看开启debug功能
RIP Process id: 1
Debugs ON: SEND, RECEIVE, PACKET, TIMER, EVENT, BRIEF,
JOB, ROUTE-PROCESSING, ERROR,
REPLAY-PROTECT, GR
May 14 2014 13:15:09.866.1-05:13 R1 RIP/7/DBG: 6: 13414: RIP 1: Receiving v1 response on Serial1/0/0 from 10.0.12.2 with 3 RTEs
May 14 2014 13:15:09.866.2-05:13 R1 RIP/7/DBG: 6: 13465: RIP 1: Receive response from 10.0.12.2 on Serial1/0/0
May 14 2014 13:15:09.866.3-05:13 R1 RIP/7/DBG: 6: 13476: Packet: Version 1, Cmd response, Length 64
May 14 2014 13:15:09.866.4-05:13 R1 RIP/7/DBG: 6: 13527: Dest 10.0.2.0, Cost 1

undo debug rip 1 ====关闭RIP debug功能
undo debug all ====关闭所有debug功能

三、配置RIPv2协议
[R1]rip 1
[R1-rip-1]version 2

[R2]rip 1
[R2-rip-1]version 2

[R3]rip 1
[R3-rip-1]version 2

[R1]display ip routing-table protocol rip
Route Flags: R – relay, D – download to fib
——————————————————————————
Public routing table : RIP
Destinations : 3 Routes : 3
RIP routing table status :
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.2.0/24 RIP 100 1 D 10.0.12.2 Serial1/0/0
10.0.3.0/24 RIP 100 2 D 10.0.12.2 Serial1/0/0
10.0.23.0/24 RIP 100 1 D 10.0.12.2 Serial1/0/0
RIP routing table status :
Destinations : 0 Routes : 0

测试:
debugging rip 1 event
debugging rip 1 packet
undo debugging all
May 14 2014 13:31:30.266.2-05:13 R1 RIP/7/DBG: 6: 13476: Packet: Version 2, Cmd response, Length 24
May 14 2014 13:31:30.266.3-05:13 R1 RIP/7/DBG: 6: 13546: Dest 10.0.1.0/24, Nexthop 0.0.0.0, Cost 1, Tag 0
May 14 2014 13:31:42.106.1-05:13 R1 RIP/7/DBG: 6: 13465: RIP 1: Receive response from 10.0.12.2 on Serial1/0/0
May 14 2014 13:31:42.106.2-05:13 R1 RIP/7/DBG: 6: 13476: Packet: Version 2, Cmd response, Length 64

四、RIP中重分布静态路由
[R3]int lo 1
[R3-LoopBack1]ip add 172.16.3.3 24

ping -c 3 172.16.3.3
PING 172.16.3.3: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
[R2]ip route-static 172.16.3.0 24 10.0.23.3
[R2]rip 1
[R2-rip-1]import-route static ====RIP进程中重分布静态路由

R1>display ip routing-table protocol rip | in 172
Route Flags: R – relay, D – download to fib
——————————————————————————
Public routing table : RIP
Destinations : 4 Routes : 4
RIP routing table status :
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
172.16.3.0/24 RIP 100 1 D 10.0.12.2 Serial1/0/0

拓扑二

华为路由交换由浅入深系列(三): RIP简单配置、路由汇总、认证、重分布静态_路由汇总_02

一、基本配置

R3:
interface LoopBack1
ip address 172.16.0.1 255.255.255.0
interface LoopBack2
ip address 172.16.1.1 255.255.255.0
interface LoopBack3
ip address 172.16.2.1 255.255.255.0
interface LoopBack4
ip address 172.16.3.1 255.255.255.0

二、配置RIPv2

R1:
[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 10.0.0.0

R2:
[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 10.0.0.0

R3:
[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]net 10.0.0.0
[R3-rip-1]net 172.16.0.0

R1]display ip routing-table protocol rip
Route Flags: R – relay, D – download to fib
——————————————————————————
Public routing table : RIP
Destinations : 7 Routes : 7
RIP routing table status : 
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.2.0/24 RIP 100 1 D 10.0.12.2 Serial1/0/0
10.0.3.0/24 RIP 100 2 D 10.0.12.2 Serial1/0/0
10.0.23.0/24 RIP 100 1 D 10.0.12.2 Serial1/0/0
172.16.0.0/24 RIP 100 2 D 10.0.12.2 Serial1/0/0
172.16.1.0/24 RIP 100 2 D 10.0.12.2 Serial1/0/0
172.16.2.0/24 RIP 100 2 D 10.0.12.2 Serial1/0/0
172.16.3.0/24 RIP 100 2 D 10.0.12.2 Serial1/0/0
RIP routing table status : 
Destinations : 0 Routes : 0

三、配置手工路由汇总

[R2]int s1/0/0
[R2-Serial1/0/0]rip summary-address 172.16.0.0 255.255.0.0

测试
display ip routing-table protocol rip | in 172
Route Flags: R – relay, D – download to fib
——————————————————————————
Public routing table : RIP
Destinations : 4 Routes : 4
RIP routing table status : 
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
172.16.0.0/16 RIP 100 2 D 10.0.12.2 Serial1/0/0

四、配置明文与MD5认证

R1与R2明文认证
interface Serial1/0/0
rip authentication-mode simple cisco

interface Serial1/0/0
rip authentication-mode simple cisco
interface Serial2/0/0
rip authentication-mode md5 usual cisco

interface Serial2/0/0
rip authentication-mode md5 usual cisco

测试:
[R1]int s1/0/0
[R1-Serial1/0/0]rip authentication-mode simple huawei
debugging rip 1
terminal monitor
Info: Current terminal monitor is on.
terminal debugging
reset ip routing-table statistics protocol rip ====清除RIP路由表信息

本文首发于公众号:网络之路博客