拓扑如下:
这个实验中配置如下:
R1:
interface Loopback0
ip address 192.168.1.1 255.255.255.0
interface Serial1/1
ip address 10.10.12.1 255.255.255.252
router ospf 100
router-id 1.1.1.1
log-adjacency-changes
network 10.10.12.0 0.0.0.3 area 1
network 192.168.1.0 0.0.0.255 area 1
R2:
interface Serial1/0
ip address 10.10.12.2 255.255.255.252
serial restart-delay 0
clock rate 64000
!
interface Serial1/1
ip address 10.10.23.1 255.255.255.252
serial restart-delay 0
clock rate 64000
router ospf 100
router-id 2.2.2.2
log-adjacency-changes
network 10.10.12.0 0.0.0.3 area 1
network 10.10.23.0 0.0.0.3 area 0
R3:
interface Loopback0
ip address 192.168.2.1 255.255.255.0
interface Serial1/0
ip address 10.10.23.2 255.255.255.252
router ospf 100
router-id 1.1.1.1
log-adjacency-changes
network 10.10.23.0 0.0.0.3 area 0
network 192.168.2.0 0.0.0.255 area 0
查看相应路由表:
R1(config-router)#do sh 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/30 is subnetted, 2 subnets
C 10.10.12.0 is directly connected, Serial1/1
O IA 10.10.23.0 [110/128] via 10.10.12.2, 00:42:00, Serial1/1
C 192.168.1.0/24 is directly connected, Loopback0
192.168.2.0/32 is subnetted, 1 subnets
O IA 192.168.2.1 [110/129] via 10.10.12.2, 00:40:43, Serial1/1
R2(config-router)#do sh 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/30 is subnetted, 2 subnets
C 10.10.12.0 is directly connected, Serial1/0
C 10.10.23.0 is directly connected, Serial1/1
192.168.1.0/32 is subnetted, 1 subnets
O 192.168.1.1 [110/65] via 10.10.12.1, 00:42:20, Serial1/0
192.168.2.0/32 is subnetted, 1 subnets
O 192.168.2.1 [110/65] via 10.10.23.2, 00:41:02, Serial1/1
R3(config-router)#do sh 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/30 is subnetted, 2 subnets
O IA 10.10.12.0 [110/128] via 10.10.23.1, 00:41:28, Serial1/0
C 10.10.23.0 is directly connected, Serial1/0
192.168.1.0/32 is subnetted, 1 subnets
O IA 192.168.1.1 [110/129] via 10.10.23.1, 00:41:28, Serial1/0
C 192.168.2.0/24 is directly connected, Loopback0
路由表没有异常,进行PING包测试:
R1#ping 192.168.2.1 so 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/23/48 ms
R1#
一切正常。后面要研究一下,带ASBR的情况。