实验拓扑
实验目的
- R4为ISP,其上只配置IP地址;R4与其他所直连设备间均使用公有IP;
- R3-R5、R6、R7为MGRE环境,R3为中心站点;
- 整个OSPF环境IP基于172.16.0.0/16划分;除了R12有两个环回,其他路由器均有一个环回IP
- 所有设备均可访问R4的环回;
- 减少LSA的更新量,加快收敛,保障更新安全;
- 全网可达;
实验思路
划分IP地址
我的划分思路是将172.16.0.0单独拿出来做主干路IP,采用29掩码来节约IP资源,然后环回全部采用24掩码具体如下:
- 主干路IP
172.16.0.0/29
172.16.0.8/29
172.16.0.16/29
172.16.0.24/29
172.16.0.32/29
172.16.0.40/29 - 环回地址:
r1:172.16.1.0/24
r2:172.16.2.0/24
r3:172.16.3.0/24
r4:172.16.4.0/24
r5:172.16.5.0/24
r6:172.16.6.0/24
r7:172.16.7.0/24
r8:172.16.8.0/24
r9:172.16.9.0/24
r10:172.16.10.0/24
r11:172.16.11.0/24
r12:172.16.12.0/24;172.16.13.0/24 - 隧道地址
172.16.14.0/24
后续
- 配置每个接口的IP,确保私网内能通
- 公网配置静态路由缺省,确保公网能通
- 开始搭建隧道,配置区域0的ospf,让三个区域间用vpn连接
- 分别在其他区域上配置ospf,区域2和3采用引入的方式
- 全部基础ospf配置完成后检验全网通
- 全网通后开始减少路由条目(采用特殊区域和路由汇总)
- 确保全网通的情况下实施快速收敛
- 最后采用接口认证
实验过程
-
r3路由器上的配置:
ip route-static 0.0.0.0 0.0.0.0 34.0.0.4
interface GigabitEthernet0/0/0
ip address 172.16.0.3 255.255.255.248
ospf authentication-mode md5 1 cipher 123
ospf timer hello 1
interface Tunnel0/0/0
ip address 172.16.14.3 255.255.255.0
tunnel-protocol gre p2mp
source 34.0.0.3
ospf authentication-mode md5 1 cipher 123
ospf network-type broadcast
ospf timer hello 1
nhrp entry multicast dynamic
nhrp network-id 100
interface Serial4/0/0
link-protocol ppp
ip address 34.0.0.3 255.255.255.0
nat outbound 2000
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 172.16.14.0 0.0.0.255
area 0.0.0.1
network 172.16.0.0 0.0.0.255
network 172.16.3.0 0.0.0.255
stub no-summary -
r5路由器上配置:
ip route-static 0.0.0.0 0.0.0.0 45.0.0.4
interface Tunnel0/0/0
ip address 172.16.14.5 255.255.255.0
tunnel-protocol gre p2mp
source 45.0.0.5
ospf authentication-mode md5 1 cipher 123
ospf network-type broadcast
ospf dr-priority 0
ospf timer hello 1
nhrp network-id 100
nhrp entry 172.16.14.3 34.0.0.3 register
interface Serial4/0/0
link-protocol ppp
ip address 45.0.0.5 255.255.255.0
ospf 1 router-id 5.5.5.5
area 0.0.0.0
network 172.16.5.0 0.0.0.255
network 172.16.14.0 0.0.0.255 -
r6路由器的配置
ip route-static 0.0.0.0 0.0.0.0 46.0.0.4
interface Tunnel0/0/0
ip address 172.16.14.6 255.255.255.0
tunnel-protocol gre p2mp
source 46.0.0.6
ospf authentication-mode md5 1 cipher 123
ospf network-type broadcast
ospf dr-priority 0
ospf timer hello 1
nhrp network-id 100
nhrp entry 172.16.14.3 34.0.0.3 register
interface Serial4/0/0
link-protocol ppp
ip address 46.0.0.6 255.255.255.0
nat outbound 2000
interface GigabitEthernet0/0/0
ip address 172.16.0.33 255.255.255.248
ospf authentication-mode md5 1 cipher 123
ospf timer hello 1
ospf 1 router-id 6.6.6.6
area 0.0.0.0
network 172.16.14.0 0.0.0.255
area 0.0.0.2
network 172.16.0.0 0.0.0.255
network 172.16.6.0 0.0.0.255
nssa no-summary -
r7路由器配置
ip route-static 0.0.0.0 0.0.0.0 47.0.0.4
interface Tunnel0/0/0
ip address 172.16.14.7 255.255.255.0
tunnel-protocol gre p2mp
source 47.0.0.7
ospf authentication-mode md5 1 cipher 123
ospf network-type broadcast
ospf dr-priority 0
ospf timer hello 1
nhrp network-id 100
nhrp entry 172.16.14.3 34.0.0.3 register
interface GigabitEthernet0/0/0
ip address 47.0.0.7 255.255.255.0
nat outbound 2000
interface GigabitEthernet0/0/1
ip address 172.16.0.9 255.255.255.248
ospf authentication-mode md5 1 cipher % % SQI3-gwZ%Q;EpAINgTY.`6M’% %
ospf timer hello 1
ospf 1 router-id 7.7.7.7
area 0.0.0.0
network 172.16.14.0 0.0.0.255
area 0.0.0.3
network 172.16.0.0 0.0.0.255
network 172.16.7.0 0.0.0.255
nssa no-summary -
r9路由器配置
ospf 1 router-id 9.9.9.9
import-route ospf 2
area 0.0.0.3
network 172.16.0.16 0.0.0.7
network 172.16.9.0 0.0.0.255
nssa no-summary
ospf 2 router-id 9.9.9.9
default-route-advertise
import-route ospf 1
area 0.0.0.4
network 172.16.0.24 0.0.0.7 -
r12路由器配置
ospf 1 router-id 12.12.12.12
import-route rip 1
area 0.0.0.2
network 172.16.0.0 0.0.0.255
nssa no-summary -
结果
总结
这次实验IP划分得不好,导致我汇总失败(汇总后全网不通了),所以以上我做了特殊区域的配置来减少路由和LSA;划分IP只考虑了划分,没想过汇总着东西