R1(s1/1)-(s1/0)R2(s1/1)-(s1/0)R3
一
:
基本配置
R1
(
config
)
#int lo 0
R1(config-if)#
ip address 1.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int s1/1
R1(config-if)#ip add 12.0.0.1 255.255.255.0
R1(config-if)#no sh
R2
(
config
)
#int lo 0
R2(config-if)#
ip address 2.2.2.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int s1/0
R2(config-if)#ip add 12.0.0.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int s1/1
R2(config-if)#ip add 23.0.0.2 255.255.255.0
R2(config-if)#no sh
R3
(
config
)
#int lo 0
R3(config-if)#
ip address 3.3.3.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int s1/0
R3(config-if)#ip add 23.0.0.3 255.255.255.0
R3(config-if)#no sh
二
:
路由配置
R1(config)#router rip
R1(config-router)# version 2
R1(config-router)# network 1.0.0.0
R1(config-router)#network 12.0.0.0
R2(config)#router rip
R2(config-router)# version 2
R2(config-router)#network 12.0.0.0
R2(config-router)#
redistribute ospf 100 metric 3
R2(config)#router ospf 100
R2(config-router)#net 23.0.0.0 0.0.0.255 a 0
R2(config-router)#net 2.2.2.0 0.0.0.255 a 0
R2(config-router)#
redistribute rip metric 3 subnets
R3(config)#int s1/0
R3(config-if)#ip add 23.0.0.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int lo 0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config)#router ospf 100
R3(config-router)#net 23.0.0.0 0.0.0.255 a 0
R3(config-router)#net 3.3.3.0 0.0.0.255 a 0
二
:
调试信息
R1#show ip route
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
R 2.0.0.0/8 [120/3] via 12.0.0.2, 00:00:09, Serial1/1
R 3.0.0.0/8 [120/3] via 12.0.0.2, 00:00:09, Serial1/1
R 23.0.0.0/8 [120/3] via 12.0.0.2, 00:00:09, Serial1/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, Serial1/1
R2#show ip route
R 1.0.0.0/8 [120/1] via 12.0.0.1, 00:00:11, Serial1/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 23.0.0.3, 00:30:22, Serial1/1
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial1/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, Serial1/0
R3#show ip route
O E2 1.0.0.0/8 [110/3] via 23.0.0.2, 00:30:31, Serial1/0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 23.0.0.2, 00:30:31, Serial1/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
O E2 12.0.0.0 [110/3] via 23.0.0.2, 00:30:31, Serial1/0
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
23.0.0.3 0 FULL/ - 00:00:37 23.0.0.3 Serial1/1
R3#show ip ospf database
OSPF Router with ID (23.0.0.3) (Process ID 100)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 1981 0x8000000B 0x0083A1 3
23.0.0.3 23.0.0.3 103 0x8000000A 0x00D33D 3
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
1.0.0.0 2.2.2.2 205 0x80000002 0x00F1B5 0
12.0.0.0 2.2.2.2 205 0x80000002 0x00623A 0
Type escape sequence to abort.
Tracing the route to 3.3.3.3
1 12.0.0.2 260 msec 656 msec 576 msec
2 23.0.0.3 720 msec 1680 msec 576 msec
R1#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 576/790/1276 ms
R2#debug ip ospf events
OSPF events debugging is on
R2#
*Apr 29 23:05:10.111: OSPF: Rcv hello from 23.0.0.3 area 0 from Serial1/1 23.0.0.3
*Apr 29 23:05:10.111: OSPF: End of hello processing
R2#
*Apr 29 23:05:16.051: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/1 from 23.0.0.2
R2#
*Apr 29 23:05:20.255: OSPF: Rcv hello from 23.0.0.3 area 0 from Serial1/1 23.0.0.3
*Apr 29 23:05:20.255: OSPF: End of hello processing
R2#
*Apr 29 23:05:26.051: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/1 from 23.0.0.2
R2#
*Apr 29 23:05:30.135: OSPF: Rcv hello from 23.0.0.3 area 0 from Serial1/1 23.0.0.3
*Apr 29 23:05:30.135: OSPF: End of hello processing
R2#
*Apr 29 23:05:36.051: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/1 from 23.0.0.2
R2#
*Apr 29 23:05:40.123: OSPF: Rcv hello from 23.0.0.3 area 0 from Serial1/1 23.0.0.3
*Apr 29 23:05:40.123: OSPF: End of hello processing
R2#
*Apr 29 23:05:46.051: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/1 from 23.0.0.2
R2#
*Apr 29 23:05:50.115: OSPF: Rcv hello from 23.0.0.3 area 0 from Serial1/1 23.0.0.3
*Apr 29 23:05:50.115: OSPF: End of hello processing
R2#
*Apr 29 23:05:56.051: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/1 from 23.0.0.2
R2#
*Apr 29 23:06:00.115: OSPF: Rcv hello from 23.0.0.3 area 0 from Serial1/1 23.0.0.3
*Apr 29 23:06:00.115: OSPF: End of hello processing
R2#
*Apr 29 23:06:06.051: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/1 from 23.0.0.2
R2#
*Apr 29 23:06:10.131: OSPF: Rcv hello from 23.0.0.3 area 0 from Serial1/1 23.0.0.3
*Apr 29 23:06:10.131: OSPF: End of hello processing
R2#
*Apr 29 23:06:16.051: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/1 from 23.0.0.2
R2#
*Apr 29 23:06:20.091: OSPF: Rcv hello from 23.0.0.3 area 0 from Serial1/1 23.0.0.3
*Apr 29 23:06:20.091: OSPF: End of hello processing
R2#
*Apr 29 23:06:26.051: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/1 from 23.0.0.2
R2#
*Apr 29 23:06:30.083: OSPF: Rcv hello from 23.0.0.3 area 0 from Serial1/1 23.0.0.3
*Apr 29 23:06:30.083: OSPF: End of hello processing
R3#debug ip ospf events
OSPF events debugging is on
R3#
*Apr 29 23:06:09.887: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/0 from 23.0.0.3
R3#
*Apr 29 23:06:15.819: OSPF: Rcv hello from 2.2.2.2 area 0 from Serial1/0 23.0.0.2
*Apr 29 23:06:15.819: OSPF: End of hello processing</FON< TD>