一、实验拓扑
二、实验要求
1、R4为ISP,其上只配置IP地址;R4与其他所直连设备间均使用公有IP;
2、R3-R5、R6、R7为MGRE环境,R3为中心站点;
3、整个OSPF环境IP基于172.16.0.0/16划分;除了R12有两个环回,其他路由器均有一个环回IP
4、所有设备均可访问R4的环回;
5、减少LSA的更新量,加快收敛,保障更新安全;
6、全网可达;
三、实验划分
(一)共有网段划分
R3 - R4之间划分的共有网段为 --- 34.0.0.0/24
R4 - R5之间划分的共有网段为 --- 45.0.0.0/24
R4 - R6之间划分的共有网段为 --- 46.0.0.0/24
R4 - R7之间划分的共有网段为 --- 47.0.0.0/24
R4的环回网段为 --- 4.4.4.0/24
(二)私有网段划分
由于现在了解到网络中可能含有P2P网络,所以我们在划分私网时要预留一部分P2P网络的网段。
分析:已知现在实验网络中有5个区域以及一个RIP区域,所以我们将所给的网段划分成至少6个主网段,然后进行进一步划分。
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 ------- 这8各网点选出6个作为私网网段其余两个作为备份网段。
(1)area0的主网划分
172.16.0.0/19
可划分为172.16.0.0/24 --- 作为P2P网络的网段
可划分为172.16.1.0/24 --- MA
可划分为172.16.2.0/24 --- R4的环回网段
可划分为172.16.3.0/24 --- R5的环回网段
可划分为172.16.4.0/24 --- R6的环回网段
可划分为172.16.5.0/24--- R7的环回网段
可划分为172.16.6.0/24 --- 隧道
(2)area1的主网段划分
172.16.32.0/19
可划分为172.16.32.0/24 --- 作为P2P网络的网段
可划分为172.16.33.0/24 ---MA
可划分为172.16.34.0 --- R1的环回网段
可划分为172.16.35.0 --- R2的环回网段
可划分为172.16.36.0 --- R3的环回网段
(3)area2的主网段划分
172.16.64.0/19
可划分为172.16.64.0/24 --- 作为P2P网络的网段
可划分为172.16.65.0/24 --- MA
172.16.97.0/30
172.16.97.4/30
可划分为172.16.66.0/24 --- R11的环回网段
(4)area3的主网段划分
172.16.96.0/19
可划分为172.16.96.0/24 --- 作为P2P网络的网段
可划分为172.16.97.0/24 ---PA
172.16.97.0/30
172.16.97.4/30
可划分为172.16.98.0/24 --- R8的环回网段
(5)area4的主网段划分
172.16.128.0/19
可划分为172.16.128.0/24 --- 作为P2P网络的网段
可划分为172.16.129.0/24 --- MA
172.16.129.0/30
可划分为172.16.130.0/24 --- R9的环回网段
可划分为172.16.131.0/24 --- R10的环回网段
(6)RIP的主网段划分
172.16.160.0/19
可划分为172.16.160.0/24 --- R12上的RIP环回L0
可划分为172.16.161.0/24 --- R12上的RIP环回L1
四、实验结果
1、进行具体网段地址配置
R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 172.16.33.1 24
[R1-GigabitEthernet0/0/0]int l0
[R1-LoopBack0]ip ad 172.16.34.1 24
R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip ad 172.16.33.2 24
[R2-GigabitEthernet0/0/0]int l0
[R2-LoopBack0]ip ad 172.16.35.1 24
R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip ad 172.16.33.3 24
[R3-GigabitEthernet0/0/0]int l0
[R3-LoopBack0]ip ad 172.16.36.1 24
[R3-LoopBack0]int s4/0/0
[R3-Serial4/0/0]ip ad 34.0.0.1 24
R4
[ISP-R4]int s4/0/0
[ISP-R4-Serial4/0/0]ip ad 34.0.0.2 24
[ISP-R4-Serial4/0/0]int s4/0/1
[ISP-R4-Serial4/0/1]ip ad 45.0.0.1 24
[ISP-R4-Serial4/0/1]int s3/0/0
[ISP-R4-Serial3/0/0]ip ad 46.0.0.1 24
[ISP-R4-Serial3/0/0]int g0/0/0
[ISP-R4-GigabitEthernet0/0/0]ip ad 47.0.0.1 24
[ISP-R4-GigabitEthernet0/0/0]int l0
[ISP-R4-LoopBack0]ip ad 172.16.2.1 24
R5
[R5]int s4/0/0
[R5-Serial4/0/0]ip ad 45.0.0.2 24
[R5-Serial4/0/0]int l0
[R5-LoopBack0]ip ad 172.16.3.1 24
R6
[R6]int s4/0/0
[R6-Serial4/0/0]ip ad 46.0.0.2 24
[R6-Serial4/0/0]int g0/0/0
[R6-GigabitEthernet0/0/0]ip ad 172.16.65.1 30
[R6-GigabitEthernet0/0/0]int l0
[R6-LoopBack0]ip ad 172.16.4.1 24
R7
[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]ip ad 47.0.0.2 24
[R7-GigabitEthernet0/0/0]int g0/0/1
[R7-GigabitEthernet0/0/1]ip ad 172.16.97.1 30
[R7-GigabitEthernet0/0/1]int l0
[R7-LoopBack0]ip ad 172.16.5.1 24
R8
[R8]int g0/0/0
[R8-GigabitEthernet0/0/0]ip ad 172.16.97.2 30
[R8-GigabitEthernet0/0/0]int g0/0/1
[R8-GigabitEthernet0/0/1]ip ad 172.16.97.5 30
[R8-GigabitEthernet0/0/1]int l0
[R8-LoopBack0]ip ad 172.16.98.1 24
R9
[R9]int g0/0/0
[R9-GigabitEthernet0/0/0]ip ad 172.16.97.6 30
[R9-GigabitEthernet0/0/0]int g0/0/1
[R9-GigabitEthernet0/0/1]ip ad 172.16.129.1 30
[R9-GigabitEthernet0/0/1]int l0
[R9-LoopBack0]ip ad 172.16.130.1 24
R10
[R10]int g0/0/0
[R10-GigabitEthernet0/0/0]ip ad 172.16.129.2 30
[R10-GigabitEthernet0/0/0]int l0
[R10-LoopBack0]ip ad 172.16.131.1 24
R11
[R11]int g0/0/0
[R11-GigabitEthernet0/0/0]ip ad 172.16.65.2 30
[R11-GigabitEthernet0/0/0]int g0/0/1
[R11-GigabitEthernet0/0/1]ip ad 172.16.65.9 30
[R11-GigabitEthernet0/0/1]int l0
[R11-LoopBack0]ip ad 172.16.66.1 24
R12
[R12]int g0/0/0
[R12-GigabitEthernet0/0/0]ip ad 172.16.65.6 30
[R12-GigabitEthernet0/0/0]int l0
[R12-LoopBack0]ip ad 172.16.160.1 24
[R12-LoopBack0]int l1
[R12-LoopBack1]ip ad 172.16.161.1 24
2、配置R3到R5/6/7为MGRE环境
(1)、中心站点R3的配置
[R3]int t0/0/0
[R3-Tunnel0/0/0]ip ad 172.16.6.1 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 34.0.0.1
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry multicast dynamic
(2)、分支站点R5/6/7的配置
[R5]int t0/0/0
[R5-Tunnel0/0/0]ip ad 172.16.6.2 24
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source g0/0/0
[R5-Tunnel0/0/0]nhrp network-id 100
[R5-Tunnel0/0/0]nhrp entry 172.16.6.1 34.0.0.1 register
[R6]int t0/0/0
[R6-Tunnel0/0/0]ip ad 172.16.6.3 24
[R6-Tunnel0/0/0]tunnel-protocol gre p2mp
[R6-Tunnel0/0/0]source g0/0/0
[R6-Tunnel0/0/0]nhrp network-id 100
[R6-Tunnel0/0/0]nhrp entry 172.16.6.1 34.0.0.1 register
[R7]int t0/0/0
[R7-Tunnel0/0/0]ip ad 172.16.6.4 24
[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.168.6.1 34.0.0.1 register
(3)、R3的配置
[R3]int t0/0/1
[R3-Tunnel0/0/1]ospf network-type p2mp
3、手动配置一条到达ISP的路由
R3
[R3]ip route-static 0.0.0.0 0 34.0.0.2
R5
[R5]ip route-static 0.0.0.0 0 45.0.0.1
R6
[R6]ip route-static 0.0.0.0 0 46.0.0.1
R7
[R7]ip route-static 0.0.0.0 0 47.0.0.1
4、路由器的宣告
(1)area1
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]int g0/0/0
[R1-GigabitEthernet0/0/0]ospf enable area 1
[R1-GigabitEthernet0/0/0]int l0
[R1-LoopBack0]ospf enable area 1
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]int g0/0/0
[R2-GigabitEthernet0/0/0]ospf enable area 1
[R2-GigabitEthernet0/0/0]int l0
[R2-LoopBack0]ospf enable area 1
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]int g0/0/0
[R3-GigabitEthernet0/0/0]ospf enable area 1
[R3-GigabitEthernet0/0/0]int l0
[R3-LoopBack0]ospf enable area 1
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.1]int l0
[R5-LoopBack0]ospf enable area 0
(2)area0
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]int l0
[R6-LoopBack0]ospf enable area 0
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]int l0
[R7-LoopBack0]ospf enable area 0
(2)area2
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]int g0/0/0
[R6-GigabitEthernet0/0/0]ospf enable area 2
[R11]ospf 1 router-id 11.11.11.11
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]int g0/0/0
[R11-GigabitEthernet0/0/0]ospf enable area 2
[R11-GigabitEthernet0/0/0]int g0/0/1
[R11-GigabitEthernet0/0/1]ospf enable area 2
[R11-GigabitEthernet0/0/1]int l0
[R11-LoopBack0]ospf enable area 2
[R12]ospf 1 router-id 12.12.12.12
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]int g0/0/0
[R12-GigabitEthernet0/0/0]ospf enable area 2
[R12-GigabitEthernet0/0/0]rip 1
[R12-rip-1]v 2
[R12-rip-1]undo summary
[R12-rip-1]net 172.16.0.0
[R12-rip-1]q
[R12]ospf 1
[R12-ospf-1]import-route rip
(4)area3
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]int g0/0/1
[R7-GigabitEthernet0/0/1]ospf enable area 3
[R8]ospf 1 router-id 8.8.8.8
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]int g0/0/0
[R8-GigabitEthernet0/0/0]ospf enable area 3
[R8-GigabitEthernet0/0/0]int g0/0/1
[R8-GigabitEthernet0/0/1]ospf enable area 3
[R8-GigabitEthernet0/0/1]int l0
[R8-LoopBack0]ospf enable area 3
[R9]ospf 1 router-id 9.9.9.9
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]int g 0/0/0
[R9-GigabitEthernet0/0/0]ospf enable a 3
(5)area4
[R9]ospf 2 router-id 9.9.9.9
[R9-ospf-2]a 4
[R9-ospf-2-area-0.0.0.4]int g 0/0/1
[R9-GigabitEthernet0/0/1]ospf enable a 4
[R9-GigabitEthernet0/0/1]int l0
[R9-LoopBack0]ospf enable area 4
[R9-LoopBack0]ospf 1
[R9-ospf-1]import-route ospf 2
[R10]ospf 2 router-id 10.10.10.10
[R10-ospf-2]a 4
[R10-ospf-2-area-0.0.0.4]int g0/0/0
[R10-GigabitEthernet0/0/0]ospf enable a 4
[R10-GigabitEthernet0/0/0]int l0
[R10-LoopBack0]ospf enable area 4
传递私网路由
[R3]ospf 1
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]net 172.16.6.0 0.0.0.255
[R5]ospf 1
[R5-ospf-1]a 0
[R5-ospf-1-area-0.0.0.0]net 172.16.6.0 0.0.0.255
[R6]ospf 1
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]net 172.16.6.0 0.0.0.255
[R7-Tunnel0/0/0]ospf 1
[R7-ospf-1]a 0
[R7-ospf-1-area-0.0.0.0]net 172.16.6.0 0.0.0.255
更改接口
[R3]int t0/0/0
[R3-Tunnel0/0/0]ospf network-type broadcast
[R5]int t0/0/0
[R5-Tunnel0/0/0]ospf network-type broadcast
[R5-Tunnel0/0/0]ospf dr-priority 0
[R6]int t0/0/0
[R6-Tunnel0/0/0]ospf network-type broadcast
[R6-Tunnel0/0/0]ospf dr-priority 0
[R7]int t0/0/0
[R7-Tunnel0/0/0]ospf network-type broadcast
[R7-Tunnel0/0/0]ospf dr-priority 0
5、配置NAT实验公网访问
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R3]int s4/0/0
[R3-Serial4/0/0]nat outbound 2000
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R5]int s4/0/0
[R5-Serial4/0/0]nat outbound 2000
[R6]acl 2000
[R6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R6-acl-basic-2000]int s4/0/0
[R6-Serial4/0/0]nat outbound 2000
[R7]acl 2000
[R7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R7-acl-basic-2000]int g0/0/0
[R7-GigabitEthernet0/0/0]nat outbound 2000
[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]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
[R7]ospf 1
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
[R12]ospf 1
[R12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
[R9]ospf 1
[R9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
汇总
[R2]ospf 1
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]stub no-summary
[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]stub no-summary
[R1]ospf 1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]stub no-summary
[R12]ospf 1
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]nssa no-summary
[R11]ospf 1
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]nssa no-summary
[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]nssa no-summary
[R7]ospf 1
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]nssa no-summary
[R8]ospf 1
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]nssa no-summary
[R9]ospf 1
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]nssa no-summary
[R9]ospf 2
[R9-ospf-2]default-route-advertise
6、加快收敛
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ospf timer hello 5
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ospf timer hello 5
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ospf timer hello 5
[R4-ISP]int s4/0/0
[R4-ISP-Serial4/0/0]ospf timer hello 5
[R4-ISP-Serial4/0/0]int s4/0/1
[R4-ISP-Serial4/0/1]ospf timer hello 5
[R4-ISP-Serial4/0/1]int s3/0/0
[R4-ISP-Serial3/0/0]ospf timer hello 5
[R4-ISP-Serial3/0/0]int g0/0/0
[R4-ISP-GigabitEthernet0/0/0]ospf timer hello 5
[R5]int s4/0/0
[R5-Serial4/0/0]ospf timer hello 5
[R6]int s4/0/0
[R6-Serial4/0/0]ospf timer hello 5
[R6-Serial4/0/0]int g0/0/0
[R6-GigabitEthernet0/0/0]ospf timer hello 5
[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]ospf timer hello 5
[R7-GigabitEthernet0/0/0]int g0/0/1
[R7-GigabitEthernet0/0/1]ospf timer hello 5
[R8]int g0/0/0
[R8-GigabitEthernet0/0/0]ospf timer hello 5
[R8-GigabitEthernet0/0/0]int g0/0/1
[R8-GigabitEthernet0/0/1]ospf timer hello 5
[R9]int g0/0/0
[R9-GigabitEthernet0/0/0]ospf timer hello 5
[R9-GigabitEthernet0/0/0]int g0/0/1
[R9-GigabitEthernet0/0/1]ospf timer hello 5
[R10]int g0/0/0
[R10-GigabitEthernet0/0/0]ospf timer hello 5
[R11]int g0/0/0
[R11-GigabitEthernet0/0/0]ospf timer hello 5
[R11-GigabitEthernet0/0/0]int g0/0/1
[R11-GigabitEthernet0/0/1]ospf timer hello 5
[R12]int g0/0/0
[R12-GigabitEthernet0/0/0]ospf timer hello 5
[R1]ospf 1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]authentication-mode md5 2 cipher 123
[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]authentication-mode md5 2 cipher 123
[R5]ospf 1
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]authentication-mode md5 2 cipher 123
[R6]ospf 1
[R6-ospf-1]area 0
[R6-ospf-1-area-0.0.0.0]authentication-mode md5 2 cipher 123
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]authentication-mode md5 3 cipher 123
[R7]ospf 1
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]authentication-mode md5 2 cipher 123
[R7-ospf-1]area 3
[R7-ospf-1-area-0.0.0.3]authentication-mode md5 4 cipher 123
[R8]ospf 1
[R8-ospf-1]area 3
[R8-ospf-1-area-0.0.0.3]authentication-mode md5 4 cipher 123
[R9]ospf 1
[R9-ospf-1]area 3
[R9-ospf-1-area-0.0.0.3]authentication-mode md5 4 cipher 123
[R9]ospf 2
[R9-ospf-2]area 4
[R9-ospf-2-area-0.0.0.4]authentication-mode md5 5 cipher 123
[R10]ospf 2
[R10-ospf-2]area 4
[R10-ospf-2-area-0.0.0.4]authentication-mode md5 5 cipher 123
[R11]ospf 1
[R11-ospf-1]area 2
[R11-ospf-1-area-0.0.0.2]authentication-mode md5 3 cipher 123
[R12]ospf 1
[R12-ospf-1]area 2
[R12-ospf-1-area-0.0.0.2]authentication-mode md5 3 cipher 123
尝试一下,看能否ping通