HCIP-DATACOM核心网络技术(OSPF综合实验)

HCIP-DATACOM核心网络技术(OSPF综合实验)_第1张图片

 1.规划地址

HCIP-DATACOM核心网络技术(OSPF综合实验)_第2张图片

 HCIP-DATACOM核心网络技术(OSPF综合实验)_第3张图片

2.配置IP地址及环回地址

 (1)首先给区域0配置

R3:

[R3]int s4/0/0  
[R3-Serial4/0/0]ip address 34.1.1.3 24

R4:

[R4]int s4/0/0
[R4-Serial4/0/0]ip address 34.1.1.4 24
[R4-Serial4/0/0]int s4/0/1  
[R4-Serial4/0/1]ip address 45.1.1.4 24
[R4-Serial4/0/1]int s3/0/0   
[R4-Serial3/0/0]ip address 46.1.1.4 24
[R4-Serial3/0/0]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 47.1.1.4 24

[R4]int LoopBack 0
[R4-LoopBack0]ip address 4.4.4.4 24

R5:

[R5]int s4/0/0
[R5-Serial4/0/0]ip address 45.1.1.5 24

[R5-LoopBack0]ip ad    
[R5-LoopBack0]ip address 172.16.2.1 24

R6:

[R6]int s4/0/0
[R6-Serial4/0/0]ip address 46.1.1.6 24

[R6]interface LoopBack 0
[R6-LoopBack0]ip address 172.16.3.1 24

R7:

[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]ip address 47.1.1.7 24

[R7]interface LoopBack 0
[R7-LoopBack0]ip address 172.16.4.1 24

(2)再给区域1配置

R1:

[R1]int g0/0/0    
[R1-GigabitEthernet0/0/0]ip address 172.16.33.1 29
[R1-GigabitEthernet0/0/0]q
[R1]int LoopBack 0
[R1-LoopBack0]ip address 172.16.34.1 24

R2:

[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 172.16.33.2 29
[R2-GigabitEthernet0/0/0]q  
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 172.16.35.1 24

R3:

[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip address 172.16.33.3 29
[R3-GigabitEthernet0/0/0]q
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 172.16.36.1 24

 (3)给区域2配置

R6:

[R6]interface g0/0/0
[R6-GigabitEthernet0/0/0]ip address 172.16.65.1 29

R11:

[R11]interface g0/0/0
[R11-GigabitEthernet0/0/0]ip address 172.16.65.2 29
[R11-GigabitEthernet0/0/0]q
[R11]interface g0/0/1
[R11-GigabitEthernet0/0/1]ip address 172.16.65.9 29
[R11-GigabitEthernet0/0/1]q
[R11]interface LoopBack 0
[R11-LoopBack0]ip address 172.16.66.1 24

R12:

[R12]interface g0/0/0
[R12-GigabitEthernet0/0/0]ip address 172.16.65.10 29
[R12]interface LoopBack 0
[R12-LoopBack0]ip address 172.16.160.1 20
[R12]interface LoopBack 1
[R12-LoopBack1]ip address 172.16.176.1 20

 (4)给区域3配置

R7:

[R7]interface g0/0/1 
[R7-GigabitEthernet0/0/1]ip address 172.16.97.1 29

R8:

[R8]interface g0/0/0
[R8-GigabitEthernet0/0/0]ip address 172.16.97.2 29
[R8-GigabitEthernet0/0/0]q 
[R8]interface g0/0/1
[R8-GigabitEthernet0/0/1]ip address 172.16.97.9 29
[R8-GigabitEthernet0/0/1]q
[R8]interface LoopBack 0
[R8-LoopBack0]ip address 172.16.98.1 24

R9:

[R9]interface g0/0/0
[R9-GigabitEthernet0/0/0]ip address 172.16.97.10 29

 (5)给区域4配置

R9:

[R9]interface g0/0/1
[R9-GigabitEthernet0/0/1]ip address 172.16.129.1 29
[R9-GigabitEthernet0/0/1]q
[R9]interface LoopBack 0
[R9-LoopBack0]ip address 172.16.130.1 24

R10:

[R10]interface g0/0/0
[R10-GigabitEthernet0/0/0]ip address 172.16.129.2 29
[R10-GigabitEthernet0/0/0]q
[R10]interface LoopBack 0
[R10-LoopBack0]ip address 172.16.131.1 24

3.配置区域0的缺省路由

R3:

[R3]ip route-static 0.0.0.0 0 34.1.1.4

R5:

[R5]ip route-static 0.0.0.0 0 45.1.1.4

R6:

[R6]ip route-static 0.0.0.0 0 46.1.1.4

R7:

[R7]ip route-static 0.0.0.0 0 47.1.1.4

4.给R3-R5/6/7配置为MGRE环境,R3为中心站点;

R3中心站点:(注意:开启伪广播)

[R3]interface Tunnel 0/0/0
[R3-Tunnel0/0/0]ip address 172.16.1.1 29
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R3-Tunnel0/0/0]source 34.1.1.3
[R3-Tunnel0/0/0]nhrp network-id 100

[R3-Tunnel0/0/0]nhrp entry multicast dynamic 

R5分支站点:

[R5]interface Tunnel 0/0/0

[R5-Tunnel0/0/0]ip address 172.16.1.2 29
[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.1.1 34.1.1.3 register 

R6分支站点:

[R6]interface Tunnel 0/0/0
[R6-Tunnel0/0/0]ip address 172.16.1.3 29
[R6-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R6-Tunnel0/0/0]source s4/0/0
[R6-Tunnel0/0/0]nhrp network-id 100
[R6-Tunnel0/0/0]nhrp entry 172.16.1.1 34.1.1.3 register 

R7分支站点:

[R7]interface Tunnel 0/0/0
[R7-Tunnel0/0/0]ip address 172.16.1.4 29
[R7-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R7-Tunnel0/0/0]source g0/0/0
[R7-Tunnel0/0/0]nhrp network-id 100
[R7-Tunnel0/0/0]nhrp entry 172.16.1.1 34.1.1.3 register 

5.配置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.255.255

R2:

[R2]ospf 1 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.255.255

R3:

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.255

[R3-ospf-1-area-0.0.0.1]q
[R3-ospf-1]area 0

[R3-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0

R5:

[R5]ospf 1 rou    
[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.0.0 0.0.255.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.0.0 0.0.3.255
[R6-ospf-1-area-0.0.0.0]q
[R6-ospf-1]area 2 
[R6-ospf-1-area-0.0.0.2]network 172.16.65.1 0.0.0.0

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.0.0 0.0.7.255
[R7-ospf-1-area-0.0.0.0]q
[R7-ospf-1]area 3
[R7-ospf-1-area-0.0.0.3]network 172.16.97.1 0.0.0.0

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.0.0 0.0.255.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.97.10 0.0.0.0

[R9-ospf-1-area-0.0.0.3]q
[R9-ospf-1]area 4
[R9-ospf-1-area-0.0.0.4]network 172.16.128.0 0.0.3.255

R10:

[R10]ospf 1 router-id 10.10.10.10
[R10-ospf-1]area 4
[R10-ospf-1-area-0.0.0.4]network 172.16.0.0 0.0.255.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.0.0 0.0.255.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.65.10 0.0.0.0

6.在R12上配置RIP路由

[R12]rip 1
[R12-rip-1]version 2
[R12-rip-1]network 172.16.0.0

7. 在MGRE环境下更改Tunnel 接口的ospf类型

R3:

[R3]interface Tunnel 0/0/0
[R3-Tunnel0/0/0]ospf network-type p2mp

R5:

[R5]interface Tunnel 0/0/0
[R5-Tunnel0/0/0]ospf network-type p2mp

R6:

[R6]interface Tunnel 0/0/0
[R6-Tunnel0/0/0]ospf network-type p2mp 

R7:

[R7]interface Tunnel 0/0/0
[R7-Tunnel0/0/0]ospf network-type p2mp 

 8.在R12上重发布,把rip路由引入到ospf上

[R12]ospf 1
[R12-ospf-1]import-route rip 1

 9.区域4远离骨干区域的非骨干区域,骨干区域无法获取到区域4的路由信息,因为要做特殊区域来减少拓扑信息,所以不用虚链路和tunnel隧道,最终采用双向重发布

R9:

[R9]ospf 1
[R9-ospf-1]area 4
[R9-ospf-1-area-0.0.0.4]undo network 172.16.128.0 0.0.3.255
[R9-ospf-1-area-0.0.0.4]q
[R9-ospf-1]undo a 4
[R9]ospf 2 router-id 9.9.9.9
[R9-ospf-2]area 4
[R9-ospf-2-area-0.0.0.4]network 172.16.128.0 0.0.3.255

[R9]ospf 1
[R9-ospf-1]import-route ospf 2  //把ospf进程2导入到ospf进程1
[R9-ospf-1]q

 [R10]ip route-static 0.0.0.0 0 172.16.129.1

 10.优化整个ospf网络

一、汇总:

  (1)域内汇总(ABR设备上)

R3:(汇总区域1)

[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0

R6:(汇总区域2)

[R6]ospf 1
[R6-ospf-1]area 2 
[R6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0

R7:(汇总区域3) 

[R7]ospf 1
[R7-ospf-1]area 3  
[R7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0

 (2)域外汇总(ASBR设备上)

R12:

[R12]ospf 1  
[R12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0

R9:

[R9]ospf 1
[R9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0

二、做特殊区域 

(1)给area 1做特殊区域(stub区域)

R1:

[R1]os    
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]stub 

 R2:

[R2]ospf 1
[R2-ospf-1]area 1 
[R2-ospf-1-area-0.0.0.1]stub 

R3:

[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]stub  no-summary

 (2)给area 2做特殊区域(NSSA区域) 

R6:

[R6]ospf 1
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]nssa no-summary

R11:

[R11]ospf 1
[R11-ospf-1]area 2
[R11-ospf-1-area-0.0.0.2]nssa 

R12:

[R12]ospf 1
[R12-ospf-1]area 2
[R12-ospf-1-area-0.0.0.2]nssa 

(3)给area 3做特殊区域(NSSA区域)  

R7: 

[R7]ospf 1
[R7-ospf-1]area 3
[R7-ospf-1-area-0.0.0.3]nssa

R8: 

[R8]ospf 1
[R8-ospf-1]area 3
[R8-ospf-1-area-0.0.0.3]nssa

R9: 

[R9]ospf 1
[R9-ospf-1]area 3
[R9-ospf-1-area-0.0.0.3]nssa

 11.加快收敛

R3: 

[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ospf timer hello 10

R5: 

[R5]int Tunnel 0/0/0
[R5-Tunnel0/0/0]ospf timer hello 10

R6: 

[R6]int Tunnel 0/0/0
[R6-Tunnel0/0/0]ospf timer hello 10

R7: 

[R7]int Tunnel 0/0/0
[R7-Tunnel0/0/0]ospf timer hello 10

 12.对area 1进行区域认证的配置,保障更新安全

R3: 

[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123

R2: 

[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123

R1: 

[R1]ospf 1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123

13.做过子网汇总的设备需要做空接口来进行防环 

[R3]ip route-static 172.16.32.0 19 NULL 0

[R6]ip route-static 172.16.64.0 19 NULL 0

[R7]ip route-static 172.16.96.0 19 NULL 0

[R12]ip route-static 172.16.160.0 19 NULL 0

[R9]ip route-static 172.16.128.0 19 NULL 0

 14.做NAT技术访问公网

R3:

[R3]acl 2000
[R3-acl-basic-2000]rule permit source any
[R3-acl-basic-2000]q
[R3]int s4/0/0 
[R3-Serial4/0/0]nat outbound 2000

R5:

[R5]acl 2000
[R5-acl-basic-2000]rule permit source any
[R5-acl-basic-2000]q
[R5]int s4/0/0 
[R5-Serial4/0/0]nat outbound 2000

R6:

[R6]acl 2000
[R6-acl-basic-2000]rule permit source any
[R6-acl-basic-2000]q
[R6]int s4/0/0 
[R6-Serial4/0/0]nat outbound 2000

R7: 

[R7]acl 2000
[R7-acl-basic-2000]rule permit source any
[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]nat outbound 2000

15.测试 

R1:

HCIP-DATACOM核心网络技术(OSPF综合实验)_第4张图片

R2: 

HCIP-DATACOM核心网络技术(OSPF综合实验)_第5张图片

R12:

HCIP-DATACOM核心网络技术(OSPF综合实验)_第6张图片

R10:

HCIP-DATACOM核心网络技术(OSPF综合实验)_第7张图片

 

你可能感兴趣的:(服务器,网络,运维)