一、实验要求
1,R4为ISP,其上只能配置IP地址;R4与其他所有直连设备间均使用公有IP
2,R3-R5/6/7为MGRE环境,R3为中心站点;
3,整个OSPF环境IP基于172.16.0.0/16划分;
4,所有设备均可访问R4的环回;
5,减少LSA的更新量,加快收敛,保障更新安全;
6,全网可达
二、实验拓扑图
三、实验IP地址的划分
由于规划这个OSPF网络需要在172.16.00网段下,所以我们在实验之前对IP地址的划分如下:
area 0
172.16.000 00011.00000000 24
172.16.0.0 24--骨干链路(P2P骨干)/30
172.16.00000000.000001 00
172.16.0.0 30
172.16.0.4 30
172.16.0.8 30
172.16.1.0 24--骨干链路(MA骨干)/29
172.16.1.00000 000
172.16.1.0 29
172.16.1.8 29
172.16.1.16 29
172.16.2.0 24
172.16.3.0 24
172.16.4.0 24
172.16.5.0 24
172.16.001 00000.00000000 --19
172.16.32.0 19--区域1
172.16.32.0 24--P2P
172.16.32.0 30
172.16.32.4 30
172.16.32.8 30
172.16.33.0 24 --MA
172.16.33.0 29
172.16.33.8 29
172.16.33.16 29
172.16.33.24 29
172.16.34.0 24--用户
172.16.35.0 24
172.16.64.0 19--区域2
172.16.64.0 24 P2P
172.16.64.0 30
172.16.64.4 30
172.16.64.8 30
172.16.64.12 30
172.16.65.0 24--MA
172.16.65.0 29
172.16.65.8 29
172.16.65.16 29
172.16.66.0 24
172.16.67.0 24
172.16.96.0 19--区域3
172.16.96.0 24-P2P
172.16.96.0 30
172.16.96.4 30
172.16.97.0 24-MA
172.16.97.0 29
172.16.97.8 29
172.16.97.16 29
172.16.98.0 24
172.16.99.0 24
172.16.128.0 19--区域4
172.16.128.0 24 -P2P
172.16.128.0 30
172.16.128.4 30
172.16.129.0 24-MA
172.16.129.0 29
172.16.129.8 29
172.16.130.0 24
172.16.131.0 24
172.16.160.0 19--RIP
172.16.160.0 24
172.16.161.0 24
172.16.192.0 19
172.16.224.0 19
三、相关配置
3.1对AERA0区域的设备进行公网IP地址及环回地址和缺省路由的配置
对R3的配置:
[r3]int s 4/0/0
[r3-Serial4/0/0]ip a 34.0.0.1 24
[r3]ip route-static 0.0.0.0 24 34.0.0.2
对R4的配置:
[isp]int s 4/0/0
[isp-Serial4/0/0]ip a 34.0.0.2 24
[isp-Serial4/0/0]int s 3/0/0
[isp-Serial3/0/0]ip a 46.0.0.2 24
[isp-Serial3/0/0]int s 4/0/1
[isp-Serial4/0/1]ip a 45.0.0.2 24
[isp-Serial4/0/1]int g0/0/0
[isp-GigabitEthernet0/0/0]ip a 47.0.0.2 24
[isp-GigabitEthernet0/0/0]int lo0
[isp-LoopBack0]ip a 4.4.4.4 24
对R5的配置:
[r5]int s 4/0/0
[r5-Serial4/0/0]ip a 45.0.0.1 24
[r5-Serial4/0/0]int lo0
[r5-LoopBack0]ip a 172.16.2.1 24
[r5]ip route-static 0.0.0.0 0 45.0.0.2
查看route表,静态路由是否配置成功
对R6的配置
[r6]int s 4/0/0
[r6-Serial4/0/0]ip a 46.0.0.1 24
[r6-Serial4/0/0]int lo0
[r6-LoopBack0]ip a 172.16.3.1 24
[r6]ip route-static 0.0.0.0 0 46.0.0.2
对R7的配置:
[r7]int g0/0/0
[r7-GigabitEthernet0/0/0]ip a 47.0.0.1 24
[r7-GigabitEthernet0/0/0]int lo0
[r7-LoopBack0]ip a 172.16.4.1 24
[r7]ip route-static 0.0.0.0 0 47.0.0.2
3.2 以R3为中心站点,对R3,R5,R6,R7配置MGRE配置
R3的配置:
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip a 172.16.1.1 29
[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
R5的配置:
[r5]int t0/0/0
[r5-Tunnel0/0/0]ip a 172.16.1.2 29
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source Serial 4/0/0
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register
R6的配置:
r6]int t0/0/0
[r6-Tunnel0/0/0]ip a 172.16.1.3 29
[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.1.1 34.0.0.1 register
R7的配置:
[r7]int t0/0/0
[r7-Tunnel0/0/0]ip a 172.16.1.4 29
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp
[r7-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r7-Tunnel0/0/0]nhrp network-id 100
[r7-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register
3.3 配置各个区域的IP地址以及环回接口
R1的配置:
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip a 172.16.33.1 29
[r1-GigabitEthernet0/0/0]int lo0
[r1-LoopBack0]ip a 172.16.34.1 24
R2的配置:
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip a 172.16.33.2 29
[r2-GigabitEthernet0/0/0]int lo0
[r2-LoopBack0]ip a 172.16.35.1 24
R3的配置:
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip a 172.16.33.3 29
[r3-GigabitEthernet0/0/0]int lo0
[r3-LoopBack0]ip a 172.16.36.1 24
R6的配置:
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip a 172.16.65.1 29
R7的配置:
[r7]int g 0/0/1
[r7-GigabitEthernet0/0/1]ip a 172.16.97.1 29
R8的配置:
[r8]int g0/0/0
[r8-GigabitEthernet0/0/0]ip a 172.16.97.2 29
[r8-GigabitEthernet0/0/0]int lo0
[r8-LoopBack0]ip a 172.16.98.1 24
[r8-LoopBack0]int g 0/0/1
[r8-GigabitEthernet0/0/1]ip a 172.16.97.9 29
R9的配置:
[r9]int g0/0/0
[r9-GigabitEthernet0/0/0]ip a 172.16.97.10 29
[r9-GigabitEthernet0/0/0]int g0/0/1
[r9-GigabitEthernet0/0/1]ip a 172.16.129.1 29
[r9-GigabitEthernet0/0/1]int lo0
[r9-LoopBack0]ip a 172.16.130.1 24
R10的配置:
[r10]int g0/0/0
[r10-GigabitEthernet0/0/0]ip a 172.16.129.2 29
[r10-GigabitEthernet0/0/0]int lo0
[r10-LoopBack0]ip a 172.16.131.1 24
R11的配置:
[r11]int g 0/0/0
[r11-GigabitEthernet0/0/0]ip a 172.16.65.2 29
[r11-GigabitEthernet0/0/0]int lo0
[r11-LoopBack0]ip a 172.16.66.1 24
[r11-GigabitEthernet0/0/1]ip a 172.16.65.9 29
R12的配置:
[r12]int g0/0/0
[r12-GigabitEthernet0/0/0]ip a 172.16.65.10 29
[r12]int lo0
[r12-LoopBack0]ip a 172.16.160.1 20
[r12-LoopBack0]int lo1
[r12-LoopBack1]ip a 172.16.176.1 20
3.3 每台设备都启动OSPF的配置:
例如:R1
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255
其他都如R1所示
3.4 对R3、R5、R6、R7将tunnle接口改为p2mp
以R3为例:
[r3]int t0/0/0
[r3-Tunnel0/0/0]ospf network-type p2mp
其他设备都如R3所示
3.5 对R12进行重发步
[r12]ospf 1
[r12-ospf-1]import-route rip 1
3.6 在ABR设备进行路由汇总
在R3上:
[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上:
[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上:
[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
在R9上:
[r9]ospf 1
[r9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
在R12上:
[r12]ospf 1
[r12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
3.5 将区域1、2、3改为stub区域
以R1为例,命令如下:
[r1]ospf 1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]stub
R2、R3同上
其他区域改为nass区域,命令如下:
[r7]ospf 1
[r7-ospf-1]a 3
[r7-ospf-1-area-0.0.0.3]nssa no-summary
其他路由如上