初始配置第一步:在R1上根据拓朴进行初始配置R1(config)#int lo0R1(config-if)#ip add 1.1.1.1 255.255.255.0R1(config-if)#int
.
初始配置
第一步:在R1上根据拓朴进行初始配置
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#int s1/2
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int s1/3
R1(config-if)#ip add 10.1.2.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#
第二步:在R2上根据拓朴进行初始配置
R2(config)#
R2(config)#
R2(config)#int lo1
R2(config-if)#ip add 172.16.1.2 255.255.255.0
R2(config-if)#int s2/1
R2(config-if)#ip add 10.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#
00:15:18: %SYS-5-CONFIG_I: Configured from console by console
R2#sh ip in b
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset administratively down down
Ethernet0/1 unassigned YES unset administratively down down
Ethernet0/2 unassigned YES unset administratively down down
Ethernet0/3 unassigned YES unset administratively down down
Serial2/0 unassigned YES unset administratively down down
Serial2/1 10.1.1.2 YES manual up up
Serial2/2 unassigned YES unset administratively down down
Serial2/3 unassigned YES unset administratively down down
Serial3/0 unassigned YES unset administratively down down
Serial3/1 unassigned YES unset administratively down down
Serial3/2 unassigned YES unset administratively down down
Serial3/3 unassigned YES unset administratively down down
Loopback1 172.16.1.2 YES manual up up
R2#
R2#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 = 4/14/36 ms
R2#
第三步:在R3上根据拓朴进行初始配置
R3(config)#
R3(config)#int lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#int lo1
R3(config-if)#ip add 192.168.1.3 255.255.255.0
R3(config-if)#int s3/1
R3(config-if)#ip add 10.1.2.3 255.255.255.0
R3(config-if)#no sh
R3#
R3#ping 10.1.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.2.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R3#
R3#
R3#
R3#ping 10.1.2.1
Type escape s
实验过程:
第一步:配置RIP协议
R1(config)#router rip
R1(config-router)#network 1.0.0.0
R1(config-router)#network 10.0.0.0
R1(config-router)#
R2(config)#router rip
R2(config-router)#network 127.16.0.0
R2(config-router)#network 2.0.0.0
R2(config-router)#network 10.0.0.0
R3(config)#router rip
R3(config-router)#network 3.0.0.0
R3(config-router)#network 192.168.1.0
R3(config-router)#network 10.0.0.0
第二步:检查RIP协议的运行情况
R1#sh ip pro
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 1 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Outgoing update filter list for all interfaces is
Incoming update filter list for all interfaces is
Redistributing: rip
Default version control: send version 1, receive any version
Interface Send Recv Key-chain
Serial1/2 1 1 2
Serial1/3 1 1 2
Loopback0 1 1 2 (默认收V1和V2 发V1)
Routing for Networks:
1.0.0.0
10.0.0.0
Routing Information Sources:
Gateway Distance Last Update
10.1.2.3 120 00:00:19
Distance: (default is 120)
R1#
第三步:查看RIP协议运行正常后的路由情况
R1#show ip rou
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
T - traffic engineered route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
R 3.0.0.0/8 [120/1] via 10.1.2.3, 00:00:14, Serial1/3
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, Serial1/3
C 10.1.1.0 is directly connected, Serial1/2
R 192.168.1.0/24 [120/1] via 10.1.2.3, 00:00:14, Serial1/3
R1#
第四步:我们在R1上进行rip调试
R1#
00:28:09: RIP: sending v1 update to 255.255.255.255 via Serial1/2 (10.1.1.1)
00:28:09: subnet 10.1.2.0, metric 1
00:28:09: network 1.0.0.0, metric 1
00:28:09: network 3.0.0.0, metric 2
00:28:09: network 192.168.1.0, metric 2
00:28:09: RIP: sending v1 update to 255.255.255.255 via Serial1/3 (10.1.2.1)
00:28:09: subnet 10.1.1.0, metric 1
00:28:09: network 1.0.0.0, metric 1
00:28:09: RIP: sending v1 update to 255.255.255.255 via Loopback0 (1.1.1.1)
00:28:09: network 3.0.0.0, metric 2
00:28:09: network 10.0.0.0, metric 1
00:28:09: network 192.168.1.0, metric 2
00:28:09: RIP: received v1 update from 10.1.2.3 on Serial1/3
00:28:09: 3.0.0.0 in 1 hops
00:28:09: 192.168.1.0 in 1 hops
第五步:我们在R2上进行rip调试
R2#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
T - traffic engineered route
Gateway of last resort is not set
R 1.0.0.0/8 [120/1] via 10.1.1.1, 00:00:09, Serial2/1
R 3.0.0.0/8 [120/2] via 10.1.1.1, 00:00:09, Serial2/1
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Loopback1
10.0.0.0/24 is subnetted, 2 subnets
R 10.1.2.0 [120/1] via 10.1.1.1, 00:00:09, Serial2/1
C 10.1.1.0 is directly connected, Serial2/1
R 192.168.1.0/24 [120/2] via 10.1.1.1, 00:00:09, Serial2/1
R2#
第六步:分别查看R2和R3的路由表
R2#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
T - traffic engineered route
Gateway of last resort is not set
R 1.0.0.0/8 [120/1] via 10.1.1.1, 00:00:24, Serial2/1
R 3.0.0.0/8 [120/2] via 10.1.1.1, 00:00:24, Serial2/1
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Loopback1
10.0.0.0/24 is subnetted, 2 subnets
R 10.1.2.0 [120/1] via 10.1.1.1, 00:00:24, Serial2/1
C 10.1.1.0 is directly connected, Serial2/1
R 192.168.1.0/24 [120/2] via 10.1.1.1, 00:00:24, Serial2/1
R2#
R3#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
T - traffic engineered route
Gateway of last resort is not set
R 1.0.0.0/8 [120/1] via 10.1.2.1, 00:00:22, Serial3/1
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, Serial3/1
R 10.1.1.0 [120/1] via 10.1.2.1, 00:00:22, Serial3/1
C 192.168.1.0/24 is directly connected, Loopback1
R3#
第七步:我们在R3上个假设192.168.1.0接口down掉
R3#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
T - traffic engineered route
Gateway of last resort is not set
R 1.0.0.0/8 [120/1] via 10.1.2.1, 00:00:22, Serial3/1
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, Serial3/1
R 10.1.1.0 [120/1] via 10.1.2.1, 00:00:22, Serial3/1
C 192.168.1.0/24 is directly connected, Loopback1
R3#
R1#ping 192.168.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/15/28 ms
R1#