1.基本配置
1)按拓扑中区域Area要求,在每台路由器启用OSPF,使得整个网络可以互连互通。
n进程号Process ID配置为每台设备的主机编号,如R1配置为router ospf 1.
n路由器ID请使用router-id手工指定,如R1为router-id 1.1.1.1.
n每台设备的router-id要求用network通告到OSPF中.
n请确保R1为Area0的指定路由器DR,R7为备份指定路由器BDR.
2)要求在R1看到22、33、55开头的路由条目各7条,请确路由类型都为O IA.
3)要示在R4上可以看到11、77开头的路由条目7条,请确路由类型都为O.
配置R1:
router ospf 1
router-id 1.1.1.1
network 1.1.1.1 0.0.0.0 area 0
network 11.1.0.0 0.0.7.255 area 0
network 147.1.1.0 0.0.0.255 area 0
network 12.1.1.0 0.0.0.255 area 12
配置R2:router ospf 2router-id 2.2.2.2network 2.2.2.2 0.0.0.0 area 12network 12.1.1.0 0.0.0.255 area 12network 22.1.0.0 0.0.7.255 area 12
配置R3:
router ospf 3
router-id 3.3.3.3
network 3.3.3.3 0.0.0.0 area 73
network 33.1.0.0 0.0.7.255 area 73
network 73.1.1.0 0.0.0.255 area 73
network 133.1.0.0 0.0.7.255 area 133
配置R4:router ospf 4router-id 4.4.4.4network 4.4.4.4 0.0.0.0 area 0network 147.1.1.0 0.0.0.255 area 0network 45.1.1.0 0.0.0.255 area 457network 46.1.1.0 0.0.0.255 area 46
配置R5:
router ospf 5
router-id 5.5.5.5
network 5.5.5.5 0.0.0.0 area 457
network 45.1.1.0 0.0.0.255 area 457
network 55.1.0.0 0.0.7.255 area 457
network 75.1.1.0 0.0.0.255 area 457
配置R6:router ospf 6router-id 6.6.6.6network 6.6.6.6 0.0.0.0 area 46network 46.1.1.0 0.0.0.255 area 46
配置R7:
router ospf 7
router-id 7.7.7.7
network 7.7.7.7 0.0.0.0 area 0
network 77.1.0.0 0.0.7.255 area 0
network 147.1.1.0 0.0.0.255 area 0
network 73.1.1.0 0.0.0.255 area 73
network 75.1.1.0 0.0.0.255 area 457
2.配置ASBR
配置R2:router ripversion 2network 122.0.0.0 no auto-summaryrouter ospf 2redistribute rip metric-type 1 subnets
配置R6:
access-list 66 permit 66.1.0.0 0.0.7.255
route-map redis-conn permit 10
match ip address 66
router ospf 6
redistribute connected subnets route-map redis-conn
3.配置OSPF路由汇总功能
配置R2:router ospf 2router-id 2.2.2.2summary-address 122.1.16.0 255.255.240.0 tag 12
配置R6:
router ospf 6
summary-address 66.1.0.0 255.255.248.0 tag 46
配置R4:Router ospf 4area 457 range 55.1.0.0 255.255.248.0area 0 range 11.1.0.0 255.255.248.0area 0 range 77.1.0.0 255.255.248.0
Router ospf 7
area 457 range 55.1.0.0 255.255.248.0
area 73 range 33.1.0.0 255.255.248.0
area 0 range 11.1.0.0 255.255.248.0
area 0 range 77.1.0.0 255.255.248.0
配置R1:Router ospf 1area 12 range 22.1.0.0 255.255.248.0
4.配置OSPF特殊区域
配置R4:
Router ospf 4
area 457 stub no-summary
Router ospf 5area 457 stub
Router ospf 7
area 457 stub
area 457 default-cost 10
配置R1:Router ospf 1area 12 nssa no-summary配置R2:Router ospf 2area 12 nssa
5. 配置虚连接
配置R3:
Router ospf 3
area 73 virtual-link 7.7.7.7
area 133 range 133.1.0.0 255.255.248.0
area 73 range 33.1.0.0 255.255.248.0
配置R7:
Router ospf 7
area 73 virtual-link 3.3.3.3
6.配置OSPF动态分发默认路由
配置R6:Router ospf 6default-information originate always
在R1上测试:
R1# ping 100.1.1.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.1.1.6, timeout is 2 seconds:
!!!!!
R3# ping 100.1.1.6Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 100.1.1.6, timeout is 2 seconds:!!!!!
R7# ping 100.1.1.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.1.1.6, timeout is 2 seconds:
!!!!!
7.配置OSPF验证.
配置R4:Interface serial 1/1ip ospf authentication message-digestip ospf message-digest-key 1 md5 cisco配置R6:Interface serial 1/0ip ospf authentication message-digestip ospf message-digest-key 1 md5 cisco
配置R1:
Router ospf 1
area 0 authentication message-digest
Interface f0/0
ip ospf message-digest-key 1 md5 cisco
配置R4:
Router ospf 4
area 0 authentication message-digest
Interface f0/0
ip ospf message-digest-key 1 md5 cisco
配置R7:Router ospf 7area 0 authentication message-digestInterface f0/0ip ospf message-digest-key 1 md5 cisco
配置R7:
Router ospf 7
area 73 virtual-link 3.3.3.3 authentication message-digest
area 73 virtual-link 3.3.3.3 message-digest-key 1 md5 cisco
配置R3:
Router ospf 3
area 73 virtual-link 7.7.7.7 authentication message-digest
area 73 virtual-link 7.7.7.7 message-digest-key 1 md5 cisco
8.调整OSPF链路的花费cost.
interface Serial1/1ip ospf cost 60
联系客服