实验要求:
实验预览图:
实验分析:
1、对R4仅仅配置端口IP和环回,使用共有IP
2、对R3-R7配置MGRE环境,以R3为hub,R5、R7、R6为spoke。
3、对172.16.0.0/16 IP进行子网划分,使得全网IP基于该网段划分
4、对边界路由配置NAT
5、做汇总以及特殊区域
实验过程:
子网划分:
整个OSPF环境基于172.16.0.0/16划分,有六个区域:
-
172.16.000 00000.0——172.16.0.0/19-骨干网段
-
172.16.000 0000 0.0——172.16.0.0/23-R1/R2/R3
-
172.16.000 0001 0.0——172.16.2.0/23-R3/R4
-
172.16.000 0010 0.0——172.16.4.0/23-R4/R5
-
172.16.000 0011 0.0——172.16.6.0/23-R4/R6
-
172.16.000 0100 0.0——172.16.8.0/23-R6/R11
-
172.16.000 0101 0.0——172.16.10.0/23-R11/R12
-
172.16.000 0110 0.0——172.16.12.0/23-R4/R7
-
172.16.000 0111 0.0——172.16.14.0/23-R7/R8
-
172.16.000 1000 0.0——172.16.16.0/23-R8/R9
-
172.16.000 1001 0.0——172.16.18.0/23-R9/R10
-
172.16.000 1010 0.0——172.16.20.0/23-保留网段
-
172.16.000 1011 0.0——172.16.22.0/23-保留网段
-
172.16.000 1100 0.0——172.16.24.0/23-保留网段
-
172.16.000 1101 0.0——172.16.26.0/23-保留网段
-
172.16.000 1110 0.0——172.16.28.0/23-保留网段
-
172.16.000 1111 0.0——172.16.30.0/23-保留网段
-
-
172.16.001 00000.0——172.16.32.0/19-area 0
-
172.16.001 00 000.0——172.16.32.0/21-R4环回
-
172.16.001 01 000.0——172.16.40.0/21-R5环回
-
172.16.001 10 000.0——172.16.48.0/21-R6环回
-
172.16.001 11 000.0——172.16.56.0/21-R7环回
-
-
172.16.010 00000.0——172.16.64.0/19-area 1
-
172.16.010 00 000.0——172.16.64.0/21-R1环回
-
172.16.010 01 000.0——172.16.72.0/21-R2环回
-
172.16.010 10 000.0——172.16.80.0/21-R3环回
-
172.16.010 11 000.0——172.16.88.0/21-保留网段
-
-
172.16.011 00000.0——172.16.96.0/19-area 2
-
172.16.96.0/19-R11环回
-
-
172.16.100 00000.0——172.16.128.0/19-area 3
-
172.16.128.0/19--R8环回
-
-
172.16.101 00000.0——172.16.160.0/19-area 4
-
172.16.101 0 0000.0——172.16.160.0/20-R9环回
-
172.16.101 1 0000.0——172.16.176.0/20-R10环回
-
-
172.16.110 00000.0——172.16.192.0/19-rip
-
172.16.110 0 0000.0——172.16.192.0/20-R12环回
-
172.16.110 1 0000.0——172.16.208.0/20-R12环回
-
-
172.16.111 00000.0——172.16.224.0/19-隧道
配置IP:
R1:
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 172.16.0.2 23[r1]interface LoopBack 0
[r1-LoopBack0]ip address 172.16.64.1 20
检查配置:
[r1]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.0.2/23 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 172.16.64.1/20 up up(s)
NULL0 unassigned up up(s)
R2:
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 172.16.0.3 23[r2]interface LoopBack 0
[r2-LoopBack0]ip address 172.16.72.1 21
检查配置:
[r2]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.0.3/23 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 172.16.72.1/21 up up(s)
NULL0 unassigned up up(s)
R3:
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 172.16.0.1 23
[r3]interface LoopBack 0
[r3-LoopBack0]ip address 172.16.80.1 21
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]ip address 172.16.2.1 23
检查配置:
[r3]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.0.1/23 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 172.16.80.1/21 up up(s)
NULL0 unassigned up up(s)
Serial4/0/0 172.16.2.1/23 up up
Serial4/0/1 unassigned down down
R4:
[r4]interface Serial 4/0/0
[r4-Serial4/0/0]ip address 172.16.2.2 23
[r4]interface Serial 4/0/1
[r4-Serial4/0/1]ip address 172.16.4.2 23
[r4]interface Serial 3/0/0
[r4-Serial3/0/0]ip address 172.16.6.2 23
[r4]interface GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]ip address 172.16.12.2 23
[r4]interface LoopBack 0
[r4-LoopBack0]ip address 172.16.32.1 21
检查配置:
[r4]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.12.2/23 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 172.16.32.1/21 up up(s)
NULL0 unassigned up up(s)
Serial3/0/0 172.16.6.2/23 up up
Serial3/0/1 unassigned down down
Serial4/0/0 172.16.2.2/23 up up
Serial4/0/1 172.16.4.2/23 up up
R5:
[r5]interface Serial 4/0/0
[r5-Serial4/0/0]ip address 172.16.4.1 23
[r5]interface LoopBack 0
[r5-LoopBack0]ip address 172.16.40.1 21
检查配置:
[r5]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 unassigned down down
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 172.16.40.1/21 up up(s)
NULL0 unassigned up up(s)
Serial4/0/0 172.16.4.1/23 up up
Serial4/0/1 unassigned down down
R6:
[r6]interface Serial 4/0/0
[r6-Serial4/0/0]ip address 172.16.6.1 23
[r6]interface GigabitEthernet 0/0/0
[r6-GigabitEthernet0/0/0]ip address 172.16.8.1 23
[r6]interface LoopBack 0
[r6-LoopBack0]ip address 172.16.48.1 21
检查配置:
[r6]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.8.1/23 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 172.16.48.1/21 up up(s)
NULL0 unassigned up up(s)
Serial4/0/0 172.16.6.1/23 up up
Serial4/0/1 unassigned down down
R7:
[r7]interface GigabitEthernet 0/0/0
[r7-GigabitEthernet0/0/0]ip address 172.16.12.1 23
[r7]interface GigabitEthernet 0/0/1
[r7-GigabitEthernet0/0/1]ip address 172.16.14.1 23
[r7]interface LoopBack 0
[r7-LoopBack0]ip address 172.16.56.1 21
检查配置:
[r7]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.12.1/23 up up
GigabitEthernet0/0/1 172.16.14.1/23 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 172.16.56.1/21 up up(s)
NULL0 unassigned up up(s)
R8:
[r8]interface GigabitEthernet 0/0/0
[r8-GigabitEthernet0/0/0]ip address 172.16.14.2 23
[r8]interface GigabitEthernet 0/0/1
[r8-GigabitEthernet0/0/1]ip address 172.16.16.1 23
[r8]interface LoopBack 0
[r8-LoopBack0]ip address 172.16.128.1 19
检查配置:
[r8]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.14.2/23 up up
GigabitEthernet0/0/1 172.16.16.1/23 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 172.16.128.1/19 up up(s)
NULL0 unassigned up up(s)
R9:
[r9]interface GigabitEthernet 0/0/0
[r9-GigabitEthernet0/0/0]ip address 172.16.16.2 23
[r9]interface GigabitEthernet 0/0/1
[r9-GigabitEthernet0/0/1]ip address 172.16.18.1 23
[r9]interface LoopBack 0
[r9-LoopBack0]ip address 172.16.160.1 20
检查配置:
[r9]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.16.2/23 up up
GigabitEthernet0/0/1 172.16.18.1/23 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 172.16.160.1/20 up up(s)
NULL0 unassigned up up(s)
R10:
[r10]interface GigabitEthernet 0/0/0
[r10-GigabitEthernet0/0/0]ip address 172.16.18.2 23
[r10]interface LoopBack 0
[r10-LoopBack0]ip address 172.16.176.1 20
检查配置:
[r10]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.18.2/23 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 172.16.176.1/20 up up(s)
NULL0 unassigned up up(s)
R11:
[r11]interface GigabitEthernet 0/0/0
[r11-GigabitEthernet0/0/0]ip address 172.16.8.2 23
[r11]interface GigabitEthernet 0/0/1
[r11-GigabitEthernet0/0/1]ip address 172.16.10.1 23
[r11]interface LoopBack 0
[r11-LoopBack0]ip address 172.16.96.1 19
检查配置:
[r11]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.8.2/23 up up
GigabitEthernet0/0/1 172.16.10.1/23 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 172.16.96.1/19 up up(s)
NULL0 unassigned up up(s)
R12:
[r12]interface GigabitEthernet 0/0/0
[r12-GigabitEthernet0/0/0]ip address 172.16.10.2 23
[r12]interface LoopBack 0
[r12-LoopBack0]ip address 172.16.192.1 20
[r12]interface LoopBack 1
[r12-LoopBack1]ip address 172.16.208.1 20
检查配置:
[r12]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.10.2/23 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 172.16.192.1/20 up up(s)
LoopBack1 172.16.208.1/20 up up(s)
NULL0 unassigned up up(s)
配置完成图:
搭建R3、R4、R5、R6、R7MGRE环境:
R3:
[r3]ip route-static 0.0.0.0 0 172.16.2.2
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 172.16.224.1 19
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 172.16.2.1
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
R5:
[r5]ip route-static 0.0.0.0 0 172.16.4.2
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ip address 172.16.224.2 19
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source Serial 4/0/0
[r5-Tunnel0/0/0]nhrp entry 172.16.224.1 172.16.2.1 register
R6:
[r6]ip route-static 0.0.0.0 0 172.16.6.2
[r6]interface Tunnel 0/0/0
[r6-Tunnel0/0/0]ip address 172.16.224.3 19
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source Serial 4/0/0
[r6-Tunnel0/0/0]nhrp entry 172.16.224.1 172.16.2.1 register
R7:
[r7]ip route-static 0.0.0.0 0 172.16.12.2
[r7]interface Tunnel 0/0/0
[r7-Tunnel0/0/0]ip address 172.16.224.4 19
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp
[r7-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r7-Tunnel0/0/0]nhrp entry 172.16.224.1 172.16.2.1 register
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.0.1 0.0.0.0[r3-ospf-1-area-0.0.0.1]network 172.16.80.1 0.0.0.0
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 172.16.224.1 0.0.0.0
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ospf network-type p2mp[r3-Tunnel0/0/0]undo rip split-horizon
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.224.2 0.0.0.0[r5-ospf-1-area-0.0.0.0]network 172.16.40.1 0.0.0.0
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ospf network-type p2mp
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.224.3 0.0.0.0[r6-ospf-1-area-0.0.0.0]network 172.16.48.0 0.0.0.0
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]network 172.16.8.1 0.0.0.0
[r6]interface Tunnel 0/0/0
[r6-Tunnel0/0/0]ospf network-type p2mp
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.224.4 0.0.0.0[r7-ospf-1-area-0.0.0.0]network 172.16.56.0 0.0.0.0
[r7]interface Tunnel 0/0/0
[r7-Tunnel0/0/0]ospf network-type p2mp
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]network 172.16.14.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.14.2 0.0.0.0[r8-ospf-1-area-0.0.0.3]network 172.16.16.1 0.0.0.0
[r8-ospf-1-area-0.0.0.3]network 172.16.128.1 0.0.0.0
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.16.2 0.0.0.0
[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.18.2 0.0.0.0
[r9-ospf-2-area-0.0.0.4]network 172.16.160.1 0.0.0.0
R10:
[r10]ospf 2 router-id 10.10.10.10
[r10-ospf-2]area 4
[r10-ospf-2-area-0.0.0.4]network 172.16.18.2 0.0.0.0
[r10-ospf-2-area-0.0.0.4]network 172.16.176.1 0.0.0.0
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.8.2 0.0.0.0
[r11-ospf-1-area-0.0.0.2]network 172.16.10.1 0.0.0.0
[r11-ospf-1-area-0.0.0.2]network 172.16.96.1 0.0.0.0
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.10.2 0.0.0.0
将area4的路由引入area3中,将rip的路由引进area2中
[r9-ospf-1]import-route ospf 2
[r12-ospf-1]import-route rip
NAT:
R3:
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.0.0 0.0.0.255
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]nat outbound 2000[r3-ospf-1]default-route-advertise
R6:
[r6]acl 2000
[r6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r6]interface Serial 4/0/0
[r6-Serial4/0/0]nat outbound 2000
R7:
[r7]acl 2000
[r7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r7]interface GigabitEthernet 0/0/0
[r7-GigabitEthernet0/0/0]nat outbound 2000
减少ACL更新:
area0:
[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 no-summary
area2:
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]nssa no-summary[r11]ospf 1
[r11-ospf-1]area 2
[r11-ospf-1-area-0.0.0.2]nssa[r12]ospf 1
[r12-ospf-1]area 2
[r12-ospf-1-area-0.0.0.2]nssa
area3:
[r7]ospf 1
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]nssa no-summary[r8]ospf 1
[r8-ospf-1]area 3
[r8-ospf-1-area-0.0.0.3]nssa[r9]ospf 1
[r9-ospf-1]area 3
[r9-ospf-1-area-0.0.0.3]nssa