! 指定参与交换ospf更新的网络及这些网络所属的区域
netWork192.168.128.40255.255.255.248 area0.0.0.0
! 指定参与交换ospf更新的网络及这些网络所属的区域
end
2.S3550-24-B OSPF路由协议配置
router ospf
area0.0.0.0
netWork172.18.50.0255.255.255.0area0.0.0.0
netWork172.18.60.0255.255.255.0area0.0.0.0
netWork172.18.70.0255.255.255.0area0.0.0.0
netWork192.168.129.40255.255.255.248 area0.0.0.0
end
3.S6806E OSPF路由协议配置
router ospf
area0.0.0.0
netWork192.168.86.16255.255.255.240area0.0.0.0
netWork192.168.128.40255.255.255.248 area0.0.0.0
netWork192.168.129.40255.255.255.248 area0.0.0.0
end
4.R2624-A OSPF路由协议配置
router ospf1
! 启动ospf进程并指定本地进程号
netWork210.96.100.840.0.0.3area0.0.0.0
netWork192.168.86.160.0.0.15 area0.0.0.0
default-information originate alWays
! 不管路由器是否存在默认路由,总是向其他路由器公告默认路由
end
5.OSPF 验证
(1)S3550-24-A#shoW ip route
! 查看S3550-24-A路由表,以下路由信息除了直连路由外,都是通过ospf学习来的。
Type:C-connected,S-static,R-RIP,O-OSPF,IA-OSPF inter area
N1-OSPF NSSA external type1,N2-OSPF NSSA external type2
E1-OSPF external type1,E2-OSPF external type2
Type Destination IPNext hop Interface Distance Metric Status
O E20.0.0.0/0192.168.128.45 VL100110 1ActiVe
C172.16.10.0/240.0.0.0VL100 0ActiVe
C172.16.20.0/240.0.0.0VL200 0ActiVe
C172.16.30.0/240.0.0.0VL300 0ActiVe
O172.18.50.0/24192.168.128.45 VL100110 3ActiVe
O172.18.60.0/24192.168.128.45 VL100110 3ActiVe
O172.18.70.0/24192.168.128.45 VL100110 3ActiVe
C192.168.0.0/240.0.0.0VL10 0ActiVe
O192.168.86.16/28192.168.128.45 VL100110 2ActiVe
C192.168.128.40/290.0.0.0VL1000 0ActiVe
O192.168.129.40/29192.168.128.45 VL100110 2ActiVe
O210.96.100.84/30192.168.128.45 VL100110 3ActiVe
S3550-24-A#shoW ip ospf neighbor
! 查看S3550-24-A的邻居路由器
Neighbor ID Pri State DeadTime Address Interface
192.168.129.451full/DR00:00∶32192.168.128.45 VL100
S3550-24-A#
(2)S3550-24-B#shoW ip route
! 查看S3550-24-B路由表,以下路由信息除了直连路由外,都是通过ospf学习来的。
Type:C-connected,S-static,R-RIP,O-OSPF,IA-OSPF inter area
N1-OSPF NSSA external type1,N2-OSPF NSSA external type2
E1-OSPF external type1,E2-OSPF external type2
Type Destination IPNext hop Interface Distance Metric Status
O E20.0.0.0/0192.168.129.45 VL200110 1ActiVe
O172.16.10.0/24192.168.129.45 VL200110 3ActiVe
O172.16.20.0/24192.168.129.45 VL200110 3ActiVe
O172.16.30.0/24192.168.129.45 VL200110 3ActiVe
C172.18.50.0/240.0.0.0VL500 0ActiVe
C172.18.60.0/240.0.0.0VL600 0ActiVe
C172.18.70.0/240.0.0.0VL700 0ActiVe
C192.168.0.0/240.0.0.0VL10 0ActiVe
O192.168.86.16/28192.168.129.45 VL200110 2ActiVe
O192.168.128.40/29192.168.129.45 VL200110 2ActiVe
C192.168.129.40/290.0.0.0VL2000 0ActiVe
O210.96.100.84/30192.168.129.45 VL200110 3ActiVe
S3550-24-B#shoW ip ospf neighbor
! 查看S3550-24-B的邻居路由器
Neiahbor ID Pri State DeadTime Address Interface
192.168.129.451full/DR00:00∶35192.168.129.45 YL200
(3)S6806E-A#shoW ip route
! 查看S6806E-A路由表,以下路由信息除了直连路由外,都是通过ospf学习来的。
Type:C-connected,S-static,R-RIP,B-BOP,P-Policy
0-OSPF.IA-OSPF inter area
N1-OSPF NSSA external type1,N2-OSPF NSSA external type2
E1-OSPF external type1,E2-OSPF external type2
Type Destination IPNext hop Interface Distance Metric Status
O E20.0.0.0/0192.168.86.30VL300110 1ActiVe
O 172.16.10.0/24192.168.128.44VL100110 2ActiVe
O 172.16.20.0/24192.168.128.44VL100110 2ActiVe
O 172.16.30.0/24192.168.128.44VL100110 2ActiVe
O 172.18.50.0/24192.168.129.44VL200110 2ActiVe
O 172.18.60.0/24192.168.129.44VL200110 2ActiVe
O 172.18.70.0/24192.168.129.44VL200110 2ActiVe
C 192.168.0.0/240.0.0.0VL10 0ActiVe
C 192.168.86.16/280.0.0.0VL3000 0ActiVe
C 192.168.128.40/290.0.0.0VL1000 0ActiVe
C 192.168.129.40/290.0.0.0VL2000 0ActiVe
O 210.96.100.84/30192.168.86.30VL300110 2ActiVe
S6806E-A#shoW ip ospf neighbor
! 查看S6806E-A的ospf邻居
Neiahbor ID Pri State DeadTime Address Interface
210.96.100.851full/BDR00:00∶31192.168.86.30VL300
192.168.128.441full/BDR00:00∶30192.168.128.44VL100
192.168.129.441full/BDR00:00∶37192.168.129.44VL200
S6806E-A#
(4)R2624-A#shoW ip route
! 查看R2624-A路由表
Codes:C-connected,S-static.R-RIP
O-0SPF,IA-OSPF inter area
E1-OSPF external type1,E2-OSPF external type2
GateWay of last resort is210.96.100.86to netWork0.0.0.0
192.168.86.0/28 is subnetted,1subnets
C192.168.86.16is directly connected,FastEthernet0
172.16.0.0/24is subnetted,3subnets
O172.16.30.0[110/3]Via192.168.86.17,00:43:05,FastEthernet0
O172.16.20.0[110/3]Via192.168.86.17,00:43:05,FastEthernet0
O172.16.10.0[110/3]Via192.168.86.17,00:43:05,FastEthernet0
172.18.0.0/24is subnetted,3subnets
O172.18.60.0[110/3]Via192.168.86.17,00:43:05,FastEthernet0
O172.18.50.0[110/3]Via192.168.86.17,00:43:05,FastEthernet0
O172.18.70.0[110/3] Via192.168.86.17,00:43:05,FastEthernet0
210.96.100.0/30is subnetted,1subnets
C210.96.100.84is directly connected,FastEthernet1
192.168.128.0/29 is subnetted,1subnets
O192.168.128.40[110/2] Via192.168.86.17,00:43:05,FastEthernet0
192.168.129.0/29 is subnetted,1subnets
O192.168.129.40[110/2] Via192.168.86.11,00:43:05,FastEthernet0
S*0.0.0.0/0[1/0]Via210.96.100.86
R2624-A#shoW ip ospf neighbor
! 查看R2624-A的ospf邻居
Neighbor ID Pri State DeadTime Address Interface
192.168.129.451FULL/DR00:00∶36192.168.86.17 FastEthernet0
R2624-A#