目录
9、加快收敛(更改hello时间),保障更新安全(手工认证)
1、IP地址划分
172.16.0.0/16
172.16.0.0/19
172.16.32.0/19
172.16.64.0/19
172.16.96.0/19
172.16.128.0/19
172.16.160.0/19
172.16.192.0/19
172.16.224.0/19
area 1
172.16.0.0/19
172.16.0.0/21
172.16.8.0/21
172.16.16.0/21
172.16.24.0/21
area 0
172.16.32.0/19
172.16.32.0/21
172.16.40.0/21
172.16.48.0/21
172.16.56.0/21
area 2
172.16.64.0/19
172.16.64.0/21
172.16.72.0/21
172.16.80.0/21
172.16.88.0/21
area 3
172.16.96.0/19
172.16.96.0/21
172.16.104.0/21
172.16.112.0/21
172.16.120.0/21
area 4
172.16.128.0/19
172.16.128.0/21
172.16.136.0/21
172.16.144.0/21
172.16.152.0/21
RIP
172.16.160.0/19
172.16.160.0/21
172.16.168.0/21
172.16.176.0/21
172.16.184.0/21
2、配置IP地址
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
3、配置缺省路由
[R1]ip route-static 0.0.0.0 0 172.16.0.3
[R2]ip route-static 0.0.0.0 0 172.16.0.3
[R3]ip route-static 0.0.0.0 0 12.1.1.1
[R5]ip route-static 0.0.0.0 0 13.1.1.1
[R6]ip route-static 0.0.0.0 0 14.1.1.1
[R7]ip route-static 0.0.0.0 0 16.1.1.1
[R8]ip route-static 0.0.0.0 0 172.16.96.1
[R9]ip route-static 0.0.0.0 0 172.16.104.1
[R10]ip route-static 0.0.0.0 0 172.16.128.1
[R11]ip route-static 0.0.0.0 0 172.16.64.1
[R12]ip route-static 0.0.0.0 0 172.16.80.1
4、访问R4的环回需要配置NAT
[R3]acl 2000
[R3-acl-basic-2000]rule 1 permit source any
[R3]interface s4/0/0
[R3-Serial4/0/0]nat outbound 2000
[R5]acl 2000
[R5-acl-basic-2000]rule 1 permit source any
[R5]interface s4/0/0
[R5-Serial4/0/0]nat outbound 2000
[R6]acl 2000
[R6-acl-basic-2000]rule 1 permit source any
[R6]in s4/0/0
[R6-Serial4/0/0]nat outbound 2000
[R7]acl 2000
[R7-acl-basic-2000]rule 1 permit source any
[R7]in s4/0/0
[R7-Serial4/0/0]nat outbound 2000
5、MGRE环境配置
R3中心站点配置
[R3]interface Tunnel 0/0/0
[R3-Tunnel0/0/0]ip ad 172.16.32.1 21
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 12.1.1.2
[R3-Tunnel0/0/0]nhrp entry multicast dynamic
[R3-Tunnel0/0/0]nhrp network-id 100
分支站点配置
R5
[R5]interface Tunnel 0/0/0
[R5-Tunnel0/0/0]ip address 172.16.32.2 21
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source s4/0/0
[R5-Tunnel0/0/0]nhrp network-id 100
[R5-Tunnel0/0/0]nhrp entry 172.16.32.1 12.1.1.2 register
R6
[R6]in t0/0/0
[R6-Tunnel0/0/0]ip ad 172.16.32.3 21
[R6-Tunnel0/0/0]tunnel-protocol gre p2mp
[R6-Tunnel0/0/0]source Serial 4/0/0
[R6-Tunnel0/0/0]nhrp network-id 100
[R6-Tunnel0/0/0]nhrp entry 172.16.32.1 12.1.1.2 register
R7
[R7]in t0/0/0
[R7-Tunnel0/0/0]ip ad 172.16.32.4 21
[R7-Tunnel0/0/0]tunnel-protocol gre p2mp
[R7-Tunnel0/0/0]source Serial 4/0/0
[R7-Tunnel0/0/0]nhrp network-id 100
[R7-Tunnel0/0/0]nhrp entry 172.16.32.1 12.1.1.2 register
R3上注册结果
6、配置OSPF,重发布
R1
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.7.255
[R1-ospf-1-area-0.0.0.1]network 172.16.8.0 0.0.7.255
R2
[R2]ospf router-id 2.2.2.2
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.7.255
[R2-ospf-1-area-0.0.0.1]network 172.16.16.0 0.0.7.255
R3
[R3]ospf router-id 3.3.3.3
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.7.255
[R3-ospf-1-area-0.0.0.1]network 172.16.24.0 0.0.7.255
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 172.16.32.0 0.0.7.255
R5
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 172.16.32.0 0.0.7.255
[R5-ospf-1-area-0.0.0.0]network 172.16.40.0 0.0.7.255
R6
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]area 0
[R6-ospf-1-area-0.0.0.0]network 172.16.32.0 0.0.7.255
[R6-ospf-1-area-0.0.0.0]network 172.16.48.0 0.0.7.255
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]network 172.16.64.0 0.0.7.255
R7
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]network 172.16.32.0 0.0.7.255
[R7-ospf-1-area-0.0.0.0]network 172.16.56.0 0.0.7.255
[R7-ospf-1]area 3
[R7-ospf-1-area-0.0.0.3]network 172.16.96.0 0.0.7.255
R8
[R8]ospf 1 router-id 8.8.8.8
[R8-ospf-1]area 3
[R8-ospf-1-area-0.0.0.3]network 172.16.96.0 0.0.7.255
[R8-ospf-1-area-0.0.0.3]network 172.16.112.0 0.0.7.255
[R8-ospf-1-area-0.0.0.3]network 172.16.104.0 0.0.7.255
R9
[R9]ospf 1 router-id 9.9.9.9
[R9-ospf-1]area 3
[R9-ospf-1-area-0.0.0.3]network 172.16.104.0 0.0.7.255
因为area 4 区域为不规则区域,要进行双向重发布
[R9]ospf 2 router-id 9.9.9.9
[R9-ospf-2]area 0
[R9-ospf-2-area-0.0.0.0]network 172.16.128.0 0.0.7.255
[R9-ospf-2-area-0.0.0.0]network 172.16.136.0 0.0.7.255
[R9]ospf 1
[R9-ospf-1]import-route ospf 2
[R9]ospf 2
[R9-ospf-2]import-route ospf 1
R10
[R10]ospf 2 router-id 10.10.10.10
[R10-ospf-2]area 0
[R10-ospf-2-area-0.0.0.0]network 172.16.128.0 0.0.7.255
[R10-ospf-2-area-0.0.0.0]network 172.16.144.0 0.0.7.255
R11
[R11]ospf 1 router-id 11.11.11.11
[R11-ospf-1]area 2
[R11-ospf-1-area-0.0.0.2]network 172.16.64.0 0.0.7.255
[R11-ospf-1-area-0.0.0.2]network 172.16.72.0 0.0.7.255
[R11-ospf-1-area-0.0.0.2]network 172.16.80.0 0.0.7.255
R12
[R12]ospf 1 router-id 12.12.12.12
[R12-ospf-1]area 2
[R12-ospf-1-area-0.0.0.2]network 172.16.80.0 0.0.7.255
环回用RIP
[R12]rip 1
[R12-rip-1]version 2
[R12-rip-1]network 172.16.0.0
再进行双向重发布
[R12]ospf 1
[R12-ospf-1]import-route rip 1
[R12]rip 1
[R12-rip-1]import-route ospf 1
修改R3-R5-R6-R7的Tunnel接口类型为Broadcast
[R3-Tunnel0/0/0]ospf network-type broadcast
[R5-Tunnel0/0/0]ospf network-type broadcast
[R6-Tunnel0/0/0]ospf network-type broadcast
[R7-Tunnel0/0/0]ospf network-type broadcast
修改R5-R6-R7的接口优先级,不让其参与DR/BDR选举
[R5-Tunnel0/0/0]ospf dr-priority 0
[R6-Tunnel0/0/0]ospf dr-priority 0
[R7-Tunnel0/0/0]ospf dr-priority 0
在R3可以看到其学到了去所有网段的路
7、汇总、空接口防环路由
域间路由汇总
[R3-ospf-1-area-0.0.0.1]abr-summary 172.16.0.0 255.255.224.0
[R3]ip route-static 172.16.0.0 19 NULL 0
[R6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
[R6]ip route-static 172.16.64.0 19 NULL 0
[R7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
[R7]ip route-static 172.16.96.0 19 NULL 0
域外路由汇总
[R9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
[R9]ip route-static 172.16.128.0 19 NULL 0
[R12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
[R12]ip route-static 172.16.160.0 19 NULL 0
8、特殊区域
末梢区域/完全末梢区域
[R1]ospf 1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]stub
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]stub
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]stub
[R3-ospf-1-area-0.0.0.1]stub no-summary
NSSA/完全NSSA
[R6-ospf-1-area-0.0.0.2]nssa
[R6-ospf-1-area-0.0.0.2]nssa no-summary
[R11-ospf-1-area-0.0.0.2]nssa
[R12-ospf-1-area-0.0.0.2]nssa
[R7-ospf-1-area-0.0.0.3]nssa
[R7-ospf-1-area-0.0.0.3]nssa no-summary
[R8-ospf-1-area-0.0.0.3]nssa
[R9-ospf-1-area-0.0.0.3]nssa
9、加快收敛(更改hello时间),保障更新安全(手工认证)
[R1-GigabitEthernet0/0/0]ospf timer hello 5
[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[R2-GigabitEthernet0/0/0]ospf timer hello 5
[R2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[R3-GigabitEthernet0/0/0]ospf timer hello 5
[R3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[R3-Tunnel0/0/0]ospf timer hello 5
[R3-Tunnel0/0/0]ospf authentication-mode md5 1 cipher 123456
[R5-Tunnel0/0/0]ospf timer hello 5
[R5-Tunnel0/0/0]ospf authentication-mode md5 1 cipher 123456
[R6-Tunnel0/0/0]ospf timer hello 5
[R6-Tunnel0/0/0]ospf authentication-mode md5 1 cipher 123456
[R6-Serial4/0/1]ospf timer hello 5
[R6-Serial4/0/1]ospf authentication-mode md5 1 cipher 123456
[R11-Serial4/0/0]ospf timer hello 5
[R11-Serial4/0/0]ospf authentication-mode md5 1 cipher 123456
[R11-Serial4/0/1]ospf timer hello 5
[R11-Serial4/0/1]ospf authentication-mode md5 1 cipher 123456
[R12-Serial4/0/0]ospf timer hello 5
[R12-Serial4/0/0]ospf authentication-mode md5 1 cipher 123456
[R7-Tunnel0/0/0]ospf timer hello 5
[R7-Tunnel0/0/0]ospf authentication-mode md5 1 cipher 123456
[R7-Serial4/0/1]ospf timer hello 5
[R7-Serial4/0/1]ospf authentication-mode md5 1 cipher 123456
[R8-Serial4/0/0]ospf timer hello 5
[R8-Serial4/0/0]ospf authentication-mode md5 1 cipher 123456
[R8-Serial4/0/1]ospf timer hello 5
[R8-Serial4/0/1]ospf authentication-mode md5 1 cipher 123456
[R9-Serial4/0/0]ospf timer hello 5
[R9-Serial4/0/0]ospf authentication-mode md5 1 cipher 123456
[R9-Serial4/0/1]ospf timer hello 5
[R9-Serial4/0/1]ospf authentication-mode md5 1 cipher 123456
[R10-Serial4/0/0]ospf timer hello 5
[R10-Serial4/0/0]ospf authentication-mode md5 1 cipher 123456
10、实验结果
R1的环回ping R12的环回
R1的环回ping R5的环回
R1的环回ping R10的环回
R1的环回ping R4的环回