CCNA复习训练: RIP基础实验

RIP实验记录:

  复习之前网络基本知识,搭建基础模拟实验环境,熟练命令和掌握RIP路由更新原理和故障排除方法
  1. 熟悉路由器基本配置

  2. 掌握RIP v1/v2配置方法

  3. debug跟踪调试信息

拓扑:

 使用gns3绘制出下面拓扑,开始rip实验

一 基础配置参考

[路由器基本操作命令]

1.1 London 配置

#配置环路0接口
London(config)#int loopback 0
London(config-if)#ip add
Jan 27 19:24:07.047: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
London(config-if)#ip address 10.1.1.1 255.255.255.0
London(config-if)#


#配置环路1接口
London(config-if)#int loopback 1
London(config-if)#ip address 10.2.2.1 255.255.255.224
London(config-if)#no shutdown
London(config-if)#

#配置s0/0接口
London(config-if)#int s0/0
London(config-if)#ip address 10.3.3.1 255.255.255.0
London(config-if)#desc
London(config-if)#description London to Florence
London(config-if)#no shut
London(config-if)#


#开启rip路由协议配置,如果没有配置,实验结果将无法相互ping通
London#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
London(config)#router rip
London(config-router)#network 10.0.0.0
London(config-router)#

London#show ip protocols
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 12 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 1, receive any version
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial0/0             1     1 2
    Loopback0             1     1 2
    Loopback1             1     1 2
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    10.0.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 120)

London#

#rip v2
version 2
no auto

1.2 Florence 配置

#配置s0/0接口ip地址
Florence(config)#int s0/0
Florence(config-if)#ip address 10.3.3.2 255.255.255.0
Florence(config-if)#no shut
Florence(config-if)#desc Florence to London
Florence(config-if)#exit
Florence(config)#exit

#尝试ping下对端接口地址是否通,正常应该能够ping通,属于直连
Florence#ping 10.3.3.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.3.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/23/32 ms
Florence#


#配置s0/1接口
Florence(config)#int s0/1
Florence(config-if)#ip address 172.16.3.2 255.255.255.0
Florence(config-if)#desc Florence to Denver
Florence(config-if)#no shut
Florence(config-if)#

#配置环回口0
Florence(config-if)#int loopback 0
Florence(config-if)#ip address 192.168.1.1 255.255.255.0
Florence(config-if)#no shut
Florence(config-if)#

#rip配置

Florence(config)#router rip
Florence(config-router)#network 10.0.0.0
Florence(config-router)#network 172.16.0.0
Florence(config-router)#network 192.168.1.0
Florence(config-router)#exit
Florence(config)#exit


#rip v2
version 2
no auto


1.3 Denven 配置

#配置s0/0配置
Denver(config)#int s0/0
Denver(config-if)#ip address 172.16.3.1 255.255.255.0
Denver(config-if)#no shut
Denver(config-if)#exit
Denver(config)#e
*Mar  1 03:41:08.891: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up
Denver(config)#exit

Denver#ping 172.16.3.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.3.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/31/40 ms
Denver#

#配置环路地址
Denver(config)#int loopback 0
Denver(config-if)#ip address 172
*Mar  1 03:42:08.915: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
Denver(config-if)#ip address 172.16.1.1 255.255.255.0
Denver(config-if)#no shut
Denver(config-if)#int loopback 1
Denver(config-if)#
*Mar  1 03:42:28.075: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
Denver(config-if)#ip address 172.16.2.1 255.255.255.224
Denver(config-if)#no shut
Denver(config-if)#


#配置rip协议
Denver(config)#router rip
Denver(config-router)#network 172.16.0.0
Denver(config-router)#exit
Denver(config)#exit
Denver#show ip
*Mar  1 04:30:04.526: %SYS-5-CONFIG_I: Configured from console by console
Denver#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C       172.16.1.0/24 is directly connected, Loopback0
C       172.16.2.0/27 is directly connected, Loopback1
C       172.16.3.0/24 is directly connected, Serial0/0
R    10.0.0.0/8 [120/1] via 172.16.3.2, 00:00:05, Serial0/0
R    192.168.1.0/24 [120/1] via 172.16.3.2, 00:00:05, Serial0/0
Denver#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C       172.16.1.0/24 is directly connected, Loopback0
C       172.16.2.0/27 is directly connected, Loopback1
C       172.16.3.0/24 is directly connected, Serial0/0
R    10.0.0.0/8 [120/1] via 172.16.3.2, 00:00:01, Serial0/0
R    192.168.1.0/24 [120/1] via 172.16.3.2, 00:00:01, Serial0/0
Denver#

#rip v2
version 2
no auto

二 实验结果

2.1 实验:London上ping 192.168.1.1

开启rip后,发现路由

London#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

R    172.16.0.0/16 [120/1] via 10.3.3.2, 00:00:24, Serial0/0
     10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C       10.3.3.0/24 is directly connected, Serial0/0
C       10.2.2.0/27 is directly connected, Loopback1
C       10.1.1.0/24 is directly connected, Loopback0
R    192.168.1.0/24 [120/1] via 10.3.3.2, 00:00:24, Serial0/0
London#

可以ping通:

London#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/21/24 ms
London#


      

2.2 实验:London上ping 172.16.2.1

如果Denver没有配置rip,那么跟踪发现
London#ping 172.16.2.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.1, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
London#ping 172.16.3.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.3.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/41/60 ms
London#ping 172.16.3.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
London#


配置后
London#ping 172.16.3.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/56/76 ms
London#

2.3 实验:Florence上ping 10.2.2.1

Florence#ping 10.2.2.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
Florence#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 2 subnets
R       172.16.1.0 [120/1] via 172.16.3.1, 00:00:13, Serial0/1
C       172.16.3.0 is directly connected, Serial0/1
     10.0.0.0/24 is subnetted, 2 subnets
C       10.3.3.0 is directly connected, Serial0/0
R       10.1.1.0 [120/1] via 10.3.3.1, 00:00:03, Serial0/0
C    192.168.1.0/24 is directly connected, Loopback0
Florence#
Florence#show ip rip database
10.0.0.0/8    auto-summary
10.1.1.0/24
    [1] via 10.3.3.1, 00:00:06, Serial0/0
10.3.3.0/24    directly connected, Serial0/0
172.16.0.0/16    auto-summary
172.16.1.0/24
    [1] via 172.16.3.1, 00:00:17, Serial0/1
172.16.3.0/24    directly connected, Serial0/1
192.168.1.0/24    auto-summary
192.168.1.0/24    directly connected, Loopback0
Florence#

2.4 实验:Denver上ping 10.1.1.1

Denver#ping 10.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/72/88 ms
Denver#

2.5 实验:Denver上ping 192.168.1.1

Denver#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/23/32 ms
Denver#

2.6 实验:London上ping 172.16.2.1

London#    ping 172.16.2.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.1, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
London#


这里发现RIP V1默认是自动汇总,不可以手动开启或关闭

London#show ip rip database
10.0.0.0/8    auto-summary
10.1.1.0/24    directly connected, Loopback0
10.2.2.0/27    directly connected, Loopback1
10.3.3.0/24    directly connected, Serial0/0
172.16.0.0/16    auto-summary
172.16.0.0/16
    [1] via 10.3.3.2, 00:00:09, Serial0/0
192.168.1.0/24    auto-summary
192.168.1.0/24
    [1] via 10.3.3.2, 00:00:09, Serial0/0
London#


#重新升级配置,配置为ripv2后验证:
London#ping 172.16.2.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/63/88 ms

三 debug观察

3.1 RIP V1开启debug后观察

London#show ip protocols
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 25 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 1, receive any version
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial0/0             1     1 2
    Loopback0             1     1 2
    Loopback1             1     1 2
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    10.0.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.3.3.2             120      00:00:11
  Distance: (default is 120)



London#debug ip rip


London#
Jan 27 21:14:07.114: RIP: sending v1 update to 255.255.255.255 via Serial0/0 (10.3.3.1)
Jan 27 21:14:07.118: RIP: build update entries
Jan 27 21:14:07.118:    subnet 10.1.1.0 metric 1

Florence#debug ip rip


Florence#show ip protocols
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 20 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 1, receive any version
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial0/0             1     1 2
    Serial0/1             1     1 2
    Loopback0             1     1 2
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    10.0.0.0
    172.16.0.0
    192.168.1.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.3.3.1             120      00:00:07
    172.16.3.1           120      00:00:08




Florence#
*Mar  1 04:49:35.662: RIP: received v1 update from 172.16.3.1 on Serial0/1
*Mar  1 04:49:35.666:      172.16.1.0 in 1 hops
*Mar  1 04:49:36.610: RIP: sending v1 update to 255.255.255.255 via Serial0/1 (172.16.3.2)
*Mar  1 04:49:36.614: RIP: build update entries
*Mar  1 04:49:36.614:   network 10.0.0.0 metric 1
*Mar  1 04:49:36.618:   network 192.168.1.0 metric 1



Denver#show ip protocols
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 19 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 1, receive any version
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial0/0             1     1 2
    Loopback0             1     1 2
    Loopback1             1     1 2
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    172.16.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    172.16.3.2           120      00:00:25
  Distance: (default is 120)




Denver#debug ip rip


*Mar  1 04:49:42.574: RIP: sending v1 update to 255.255.255.255 via Loopback1 (172.16.2.1)
*Mar  1 04:49:42.578: RIP: build update entries
*Mar  1 04:49:42.578:   network 10.0.0.0 metric 2
*Mar  1 04:49:42.582:   network 192.168.1.0 metric 2



3.2 RIP V2开启debug后观察

London#
Jan 27 21:36:21.690: RIP: sending v2 update to 224.0.0.9 via Loopback0 (10.1.1.1)
Jan 27 21:36:21.694: RIP: build update entries
Jan 27 21:36:21.694:    10.2.2.0/27 via 0.0.0.0, metric 1, tag 0
Jan 27 21:36:21.698:    10.3.3.0/24 via 0.0.0.0, metric 1, tag 0
Jan 27 21:36:21.698:    172.16.0.0/16 via 0.0.0.0, metric 2, tag 0
Jan 27 21:36:21.698:    192.168.1.0/24 via 0.0.0.0, metric 2, tag 0
Jan 27 21:36:21.706: RIP: ignored v2 packet from 10.1.1.1 (sourced from one of our addresses)
London#

Florence#
*Mar  1 05:10:35.350: RIP: received v2 update from 10.3.3.1 on Serial0/0
*Mar  1 05:10:35.354:      10.1.1.0/24 via 0.0.0.0 in 1 hops
*Mar  1 05:10:35.358:      10.2.2.0/27 via 0.0.0.0 in 1 hops

Denver#
*Mar  1 05:10:52.566: RIP: sending v2 update to 224.0.0.9 via Serial0/0 (172.16.3.1)
*Mar  1 05:10:52.566: RIP: build update entries
*Mar  1 05:10:52.566:   172.16.1.0/24 via 0.0.0.0, metric 1, tag 0
*Mar  1 05:10:52.566:   172.16.2.0/27 via 0.0.0.0, metric 1, tag 0
Denver#


#关闭自动汇聚路由后,没有出现直接汇聚了
no auto
Jan 27 21:50:40.530: RIP: sending v2 update to 224.0.0.9 via Loopback0 (10.1.1.1)
Jan 27 21:50:40.534: RIP: build update entries
Jan 27 21:50:40.534:    10.2.2.0/27 via 0.0.0.0, metric 1, tag 0
Jan 27 21:50:40.538:    10.3.3.0/24 via 0.0.0.0, metric 1, tag 0
Jan 27 21:50:40.542:    172.16.1.0/24 via 0.0.0.0, metric 3, tag 0
Jan 27 21:50:40.542:    172.16.2.0/27 via 0.0.0.0, metric 3, tag 0
Jan 27 21:50:40.542:    172.16.3.0/24 via 0.0.0.0, metric 2, tag 0
Jan 27 21:50:40.542:    192.168.1.0/24 via 0.0.0.0, metric 2, tag 0
Jan 27 21:50:40.542: RIP: ignored v2 packet from 10.1.1.1 (sourced from one of our addresses)

验证测试,之前的操作可以正常通了。



3.3 rip v1路由协议观察

观察当down了London rip协议后,等了4分钟,才生效
London#show ip protocols
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 0 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 1, receive any version
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.3.3.2             120      00:04:01
  Distance: (default is 120)

London#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C       10.3.3.0/24 is directly connected, Serial0/0
C       10.2.2.0/27 is directly connected, Loopback1
C       10.1.1.0/24 is directly connected, Loopback0
London#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:

Jan 27 21:30:44.942: RIP: ignored v1 packet from 10.3.3.2 (not enabled on Serial0/0).....

posted @ 2023-01-27 22:26  菜熊熊  阅读(37)  评论(0)    收藏  举报