多區域ospf的配置
◆RA的配置是
int loopback 0
ip add 192.168.64.1 255.255.255.0
no shut
exit
int f1/0
ip add 192.168.1.1 255.255.255.0
no shut
exit
router ospf 1
network 192.168.64.1 0.0.0.0 area 1
network 192.168.1.1 0.0.0.0 area 0
◆RB的配置是
ip add 192.168.64.1 255.255.255.0
no shut
exit
int f1/0
ip add 192.168.1.1 255.255.255.0
no shut
exit
router ospf 1
network 192.168.64.1 0.0.0.0 area 1
network 192.168.1.1 0.0.0.0 area 0
◆RB的配置是
int loopback 0
ip add 192.168.3.1 255.255.255.0
no shut
exit
int f1/0
ip add 192.168.1.3 255.255.255.0
no shut
exit
int s0/0
ip add 192.168.224.1 255.255.255.252
no shut
router ospf 1
network 192.168.1.3 0.0.0.0 area 0
network 192.168.224.1 0.0.0.0 area 51
network 192.168.3.1 0.0.0.0 area 0
ip add 192.168.3.1 255.255.255.0
no shut
exit
int f1/0
ip add 192.168.1.3 255.255.255.0
no shut
exit
int s0/0
ip add 192.168.224.1 255.255.255.252
no shut
router ospf 1
network 192.168.1.3 0.0.0.0 area 0
network 192.168.224.1 0.0.0.0 area 51
network 192.168.3.1 0.0.0.0 area 0
◆RC的配置是
int s0/1
clock rate 128000
ip add 192.168.224.2 255.255.255.252
no shut
router ospf 1
network 192.168.224.2 0.0.0.0 area 51
之後都可以ping通
int s0/1
clock rate 128000
ip add 192.168.224.2 255.255.255.252
no shut
router ospf 1
network 192.168.224.2 0.0.0.0 area 51
之後都可以ping通
◆在RB上 show iproute則是
O IA 192.168.1.0/24 [110/782] via 192.168.224.1, 00:02:16, srial0/0
192.168.3.0/32 is subnetted, 1 subnets
O IA 192.168.3.1 [110/782] via 192.168.224.1, 00:02:16, Serial0/0
192.168.64.0/32 is subnetted, 1 subnets
O IA 192.168.64.1 [110/783] via 192.168.224.1, 00:02:16, Serial0/0
192.168.224.0/30 is subnetted, 1 subnets
C 192.168.224.0 is directly connected, Serial0/0
◆在RB和RC上
192.168.3.0/32 is subnetted, 1 subnets
O IA 192.168.3.1 [110/782] via 192.168.224.1, 00:02:16, Serial0/0
192.168.64.0/32 is subnetted, 1 subnets
O IA 192.168.64.1 [110/783] via 192.168.224.1, 00:02:16, Serial0/0
192.168.224.0/30 is subnetted, 1 subnets
C 192.168.224.0 is directly connected, Serial0/0
◆在RB和RC上
router ospf 1
area 51 stub
則出現的效果是
show ip route
O IA 192.168.1.0/24 [110/782] via 192.168.224.1, 00:00:02, Serial0/0
192.168.3.0/32 is subnetted, 1 subnets
O IA 192.168.3.1 [110/782] via 192.168.224.1, 00:00:02, Serial0/0
192.168.64.0/32 is subnetted, 1 subnets
O IA 192.168.64.1 [110/783] via 192.168.224.1, 00:00:02, Serial0/0
192.168.224.0/30 is subnetted, 1 subnets
C 192.168.224.0 is directly connected, Serial0/0
O*IA 0.0.0.0/0 [110/782] via 192.168.224.1, 00:00:02, Serial0/0
◆在RB上配置
192.168.3.0/32 is subnetted, 1 subnets
O IA 192.168.3.1 [110/782] via 192.168.224.1, 00:00:02, Serial0/0
192.168.64.0/32 is subnetted, 1 subnets
O IA 192.168.64.1 [110/783] via 192.168.224.1, 00:00:02, Serial0/0
192.168.224.0/30 is subnetted, 1 subnets
C 192.168.224.0 is directly connected, Serial0/0
O*IA 0.0.0.0/0 [110/782] via 192.168.224.1, 00:00:02, Serial0/0
◆在RB上配置
router ospf 1
area 51 stub no-summary
則show ip route的結果是
C 192.168.224.0 is directly connected, Serial0/0
O*IA 0.0.0.0/0 [110/782] via 192.168.224.1, 00:00:02, Serial0/0
O*IA 0.0.0.0/0 [110/782] via 192.168.224.1, 00:00:02, Serial0/0
完成.