实验11配置RIP

夙愿已清 提交于 2019-12-18 01:48:04

实验任务一:配置ripv1
1.建立物理连接

2.PC和路由器上配置ip地址
[RTA-GigabitEthernet0/0]ip address 192.168.0.1 24
[RTA-Serial1/0]ip address 192.168.1.1 24
[RTB-GigabitEthernet0/0]ip address 192.168.2.1 24
[RTB-Serial1/0]ip address 192.168.1.2 24
3.配置rip协议
[RTA]rip
[RTA -rip-1]network 192.168.1.0
[RTA -rip-1]network 192.168.0.0

[RTB]rip
[RTB -rip-1]network 192.168.1.0
[RTB -rip-1]network 192.168.2.0

4.查看rip运行状态
[RTA-rip-1]display rip
Public VPN-instance name:
RIP process: 1
RIP version: 1//RIPv1版本
Preference: 100//协议优先级100
Checkzero: Enabled
Default cost: 0
Summary: Enabled//开启了自动聚合
Host routes: Enabled
Maximum number of load balanced routes: 32
Update time : 30 secs Timeout time : 180 secs
Suppress time : 120 secs Garbage-collect time : 120 secs
Update output delay: 20(ms) Output count: 3
TRIP retransmit time: 5(s) Retransmit count: 36
Graceful-restart interval: 60 secs
Triggered Interval : 5 50 200
BFD: Disabled
Silent interfaces: None
Default routes: Disabled
Verify-source: Enabled
Networks:
192.168.0.0 192.168.1.0
Configured peers: None
Triggered updates sent: 2
Number of routes changes: 3
Number of replies to queries: 1

打开RIP的debugging
terminal debugging
The current terminal is enabled to display debugging logs.
debugging rip 1 packet
//从s1/0收到来自192.168,1,2广播,192.168.2.0 cost
Apr 23 11:05:25:277 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Receiving response from 192.168.1.2 on Serial1/0
Apr 23 11:05:25:277 2018 H3C RIP/7/RIPDEBUG: Packet: version 1, cmd response, length 24
Apr 23 11:05:25:277 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.2.0, cost 1
//从GE0/0口全网广播,192,168,1,0 cost 1 192,168,2,0 cost 2
Apr 23 11:05:35:450 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Sending response on interface GigabitEthernet0/0 from 19 2.168.0.1 to 255.255.255.255//全网广播
Apr 23 11:05:35:450 2018 H3C RIP/7/RIPDEBUG: Packet: version 1, cmd response, length 44
Apr 23 11:05:35:450 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.1.0, cost 1
Apr 23 11:05:35:450 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.2.0, cost 2
//从s1/0全网广播192.168.0.0, cost 1
Apr 23 11:05:35:451 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Sending response on interface Serial1/0 from 192.168.1.1 to 255.255.255.255
Apr 23 11:05:35:451 2018 H3C RIP/7/RIPDEBUG: Packet: version 1, cmd response, length 24
Apr 23 11:05:35:451 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.0.0, cost 1
//从s1/0收到来自192.168,1,2广播,192.168.2.0 cost
Apr 23 11:05:59:786 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Receiving response from 192.168.1.2 on Serial1/0
Apr 23 11:05:59:787 2018 H3C RIP/7/RIPDEBUG: Packet: version 1, cmd response, length 24
Apr 23 11:05:59:787 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.2.0, cost 1
//从GE0/0口全网广播,192,168,1,0 cost 1 192,168,2,0 cost 2
Apr 23 11:06:09:950 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Sending response on interface GigabitEthernet0/0 from 192.168.0.1 to 255.255.255.255
Apr 23 11:06:09:950 2018 H3C RIP/7/RIPDEBUG: Packet: version 1, cmd response, length 44
Apr 23 11:06:09:950 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.1.0, cost 1
Apr 23 11:06:09:950 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.2.0, cost 2
//从s1/0口全网广播,192,168,0,0 cost 1
Apr 23 11:06:09:950 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Sending response on interface Serial1/0 from 192.168.1.1 to 255.255.255.255
Apr 23 11:06:09:950 2018 H3C RIP/7/RIPDEBUG: Packet: version 1, cmd response, length 24
Apr 23 11:06:09:950 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.0.0, cost 1

实验任务二:配置ripv2

  1. 建立物理连接

  2. PC和路由器上配置ip地址
    [RTA]interface GigabitEthernet 0/0
    [RTA-GigabitEthernet0/0]ip address 192.168.0.1 24
    [RTA]interface GigabitEthernet 0/1
    [RTA-GigabitEthernet0/1]ip address 192.168.1.1 24

[RTB]interface GigabitEthernet 0/0
[RTB-GigabitEthernet0/0]ip address 10.0.0.1 24
[RTB]interface GigabitEthernet 0/1
[RTB-GigabitEthernet0/1]ip address 192.168.1.2 24

  1. 配置RIPV1,观察路由表
    [RTA]rip 1
    [RTA-rip-1]network 192.168.0.0
    [RTA-rip-1]network 192.168.1.0

[RTB]rip 1
[RTB-rip-1]network 192.168.1.0
[RTB-rip-1]network 10.0.0.0

[RTA-rip-1]display ip routing-table

Destinations : 17 Routes : 17

Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
10.0.0.0/8 RIP 100 1 192.168.1.2 GE0/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
192.168.0.0/24 Direct 0 0 192.168.0.1 GE0/0
192.168.0.0/32 Direct 0 0 192.168.0.1 GE0/0
192.168.0.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.0.255/32 Direct 0 0 192.168.0.1 GE0/0
192.168.1.0/24 Direct 0 0 192.168.1.1 GE0/1
192.168.1.0/32 Direct 0 0 192.168.1.1 GE0/1
192.168.1.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.255/32 Direct 0 0 192.168.1.1 GE0/1
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0

查看ip路由表发现,ripv1自动聚合。学习到路由10.0.0.0/8自然掩码。

  1. 配置ripv2
    [RTA-rip-1]version 2
    [RTA-rip-1]undo summary

[RTB-rip-1]version 2
[RTB-rip-1]undo summary

[RTA-rip-1]display ip routing-table

Destinations : 18 Routes : 18

Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
10.0.0.0/8 RIP 100 1 192.168.1.2 GE0/1
10.0.0.0/24 RIP 100 1 192.168.1.2 GE0/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
192.168.0.0/24 Direct 0 0 192.168.0.1 GE0/0
192.168.0.0/32 Direct 0 0 192.168.0.1 GE0/0
192.168.0.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.0.255/32 Direct 0 0 192.168.0.1 GE0/0
192.168.1.0/24 Direct 0 0 192.168.1.1 GE0/1
192.168.1.0/32 Direct 0 0 192.168.1.1 GE0/1
192.168.1.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.255/32 Direct 0 0 192.168.1.1 GE0/1
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0

由上面知道 ,ripv2取消自动聚合,可以学习到正确的路由10.0.0.0/24
但是还是存在路由10.0.0.0/8,原因是,rip路由的老化路由需要180s,到未收到路由更新180s。Rip才把其路由从ip路由表撤销。

terminal debugging
debugging rip 1 packet
//rip协议报文从GE0/0发送到组播地址224.0.0.9,报文包括,目的网段,掩码,下一跳,度量
Apr 23 15:53:40:989 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Sending response on interface GigabitEthernet0/0 from 192.168.0.1 to 224.0.0.9
Apr 23 15:53:40:989 2018 H3C RIP/7/RIPDEBUG: Packet: version 2, cmd response, length 44
Apr 23 15:53:40:989 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 10.0.0.0/255.255.255.0, nexthop 0.0.0.0, cost 2, tag 0
Apr 23 15:53:40:989 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.1.0/255.255.255.0, nexthop 0.0.0.0, cost 1, tag 0

  1. 配置RIPV2认证

[RTA-GigabitEthernet0/1]rip authentication-mode md5 rfc2453 plain aaaaa
[RTB-GigabitEthernet0/1]rip authentication-mode md5 rfc2453 plain abcde
//原有的路由需要一段时间才能老化,将接口关闭再启用,可以重新学习路由的过程。
[RTA-GigabitEthernet0/1]shutdown
[RTA-GigabitEthernet0/1]undo shutdown
//查看ripv2的报文
terminal debugging
debugging rip 1 packet
//GE0/0md5验证失败
Apr 23 16:02:27:583 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Ignored this packet on interface GigabitEthernet0/1 from 192.168.1.2: Authentication digest check failed.//密码不一致,错误
Apr 23 16:02:27:583 2018 H3C RIP/7/RIPDEBUG: First RTE: ff ff 00 03 af 92 fc 64 21 3a e9 11 a2 63 20 0f 83 11 64 90
//GE0/0发送路由信息给组播地址224.0.0.9
Apr 23 16:02:29:489 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Sending response on interface GigabitEthernet0/0 from 192.168.0.1 to 224.0.0.9
Apr 23 16:02:29:489 2018 H3C RIP/7/RIPDEBUG: Packet: version 2, cmd response, length 24
*Apr 23 16:02:29:489 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.1.0/255.255.255.0, nexthop 0.0.0.0, cost 1, tag 0

Apr 23 16:02:29:490 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Sending response on interface GigabitEthernet0/1 from 192.168.1.1 to 224.0.0.9
Apr 23 16:02:29:490 2018 H3C RIP/7/RIPDEBUG: Packet: version 2, cmd response, length 48
Apr 23 16:02:29:490 2018 H3C RIP/7/RIPDEBUG: Authentication mode: MD5 RFC2453
Apr 23 16:02:29:490 2018 H3C RIP/7/RIPDEBUG: Digest: 69b36548.e332dd89.d8889737.c25cd924
Apr 23 16:02:29:490 2018 H3C RIP/7/RIPDEBUG: Authentication sequence number: 1096
Apr 23 16:02:29:490 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.0.0/255.255.255.0, nexthop 0.0.0.0, cost 1, tag 0

将RTB的认证密码设置为一致。可以正确的学习到对端设备发来的路由。
[RTB-GigabitEthernet0/1]rip authentication-mode md5 rfc2453 plain aaaaa
查看路由表
display ip routing-table

Destinations : 17 Routes : 17

Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
10.0.0.0/24 RIP 100 1 192.168.1.2 GE0/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
192.168.0.0/24 Direct 0 0 192.168.0.1 GE0/0
192.168.0.0/32 Direct 0 0 192.168.0.1 GE0/0
192.168.0.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.0.255/32 Direct 0 0 192.168.0.1 GE0/0
192.168.1.0/24 Direct 0 0 192.168.1.1 GE0/1
192.168.1.0/32 Direct 0 0 192.168.1.1 GE0/1
192.168.1.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.255/32 Direct 0 0 192.168.1.1 GE0/1
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0

debugging rip 1 packet
Apr 23 16:14:22:707 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Receiving response from 192.168.1.2 on GigabitEthernet0/1
Apr 23 16:14:22:707 2018 H3C RIP/7/RIPDEBUG: Packet: version 2, cmd response, length 48
Apr 23 16:14:22:707 2018 H3C RIP/7/RIPDEBUG: Authentication mode: MD5 RFC2453
Apr 23 16:14:22:707 2018 H3C RIP/7/RIPDEBUG: Digest: 03a95530.98fdaa4b.4a6891f7.1e11b97e
Apr 23 16:14:22:707 2018 H3C RIP/7/RIPDEBUG: Authentication sequence number: 1728
//可以正确的学习到路由
Apr 23 16:14:22:707 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 10.0.0.0/255.255.255.0, nexthop 0.0.0.0, cost 1, tag 0
Apr 23 16:14:25:989 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Sending response on interface GigabitEthernet0/0 from 192.168.0.1 to 224.0.0.9
Apr 23 16:14:25:989 2018 H3C RIP/7/RIPDEBUG: Packet: version 2, cmd response, length 44
Apr 23 16:14:25:989 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 10.0.0.0/255.255.255.0, nexthop 0.0.0.0, cost 2, tag 0
Apr 23 16:14:25:989 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.1.0/255.255.255.0, nexthop 0.0.0.0, cost 1, tag 0
Apr 23 16:14:25:989 2018 H3C RIP/7/RIPDEBUG: RIP 1 : Sending response on interface GigabitEthernet0/1 from 192.168.1.1 to 224.0.0.9
Apr 23 16:14:25:989 2018 H3C RIP/7/RIPDEBUG: Packet: version 2, cmd response, length 48
Apr 23 16:14:25:989 2018 H3C RIP/7/RIPDEBUG: Authentication mode: MD5 RFC2453
Apr 23 16:14:25:989 2018 H3C RIP/7/RIPDEBUG: Digest: d99febb0.c1b405cc.e62d08e1.31626bf8
Apr 23 16:14:25:989 2018 H3C RIP/7/RIPDEBUG: Authentication sequence number: 1816
Apr 23 16:14:25:989 2018 H3C RIP/7/RIPDEBUG: AFI 2, destination 192.168.0.0/255.255.255.0, nexthop 0.0.0.0, cost 1, tag 0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!