实验要求
1,R4为ISP,其上只能配置IP地址;R4与其他所有直连设备间均使用公有Ip
R3-R5/6/7为MGRE环境,R3为中心站点;
整个OsPF环境IP基于172.16.0.0/16划分
所有设备均可访向R4的环回;
5,减少L5A的更新量,加快收敛,保障更新安全;
6,全网可达
实验步骤
1.规划网段
给定网段:172.16.0.0/16
共计五个区域
area0
总网段:172.16.0.0/19
子网:172.16.4.0/22
172.16.8.0/22
172.12.0/22
172.16.16.0/22
tunnel隧道网址:172.16.20.0/22
area 1区域
总网段:172.16.32.0/19
子网:172.16.32.0/21
172.16.40.0/21
172.16.48.0/21
172.16.56.0/21
area 2区域
总网段:172.16.64.0/19
子网:172.16.72.0/21
172.16.80.0/21
172.16.88.0/21
area 3区域
总网段:172.16.96.0/19
子网:172.16.104.0/21
172.16.112.0/21
172.16.120.0/21
area 4 区域
总网段:172.16.128.0/19
子网:172.16.136.0/21
172.16.144.0/21
172.16.152.0/21
RIP区域
总网段:172.16.160.0/19
子网:172.16.160.0/20
172.16.172.0/20
对接口以及环回口配置IP地址
注:R4上的地址为公网地址(非172.16.0.0/16网段)其他均为私网地址
例:R4
interface Serial3/0/0
link-protocol ppp
ip address 45.1.1.4 255.255.255.0
#
interface Serial3/0/1
link-protocol ppp
#
interface Serial4/0/0
link-protocol ppp
ip address 34.1.1.4 255.255.255.0
#
interface Serial4/0/1
link-protocol ppp
ip address 46.1.1.4 255.255.255.0
#
interface GigabitEthernet0/0/0
ip address 47.1.1.4 255.255.255.0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 172.16.4.1 255.255.252.0
MGRE配置
注:1.R3为中心站点因此其余设备要放弃DR BDR选举2.因为存在多个设备所以需要将接口类型修改为broadcast类型防止选举混乱
R3
interface Tunnel0/0/0
ip address 172.16.20.3 255.255.252.0
tunnel-protocol gre p2mp
source 34.1.1.3
ospf network-type broadcast
nhrp entry multicast dynamic
nhrp network-id 100
R5
#
interface Tunnel0/0/0
ip address 172.16.20.5 255.255.252.0
tunnel-protocol gre p2mp
source 45.1.1.5
ospf network-type broadcast
ospf dr-priority 0
nhrp network-id 100
nhrp entry 172.16.20.3 34.1.1.3 register
#
R6
interface Tunnel0/0/0
ip address 172.16.20.6 255.255.252.0
tunnel-protocol gre p2mp
source 46.1.1.6
ospf network-type broadcast
ospf dr-priority 0
nhrp network-id 100
nhrp entry 172.16.20.3 34.1.1.3 register
R7
interface Tunnel0/0/0
ip address 172.16.20.7 255.255.252.0
tunnel-protocol gre p2mp
source 47.1.1.7
ospf network-type broadcast
ospf dr-priority 0
nhrp network-id 100
nhrp entry 172.16.20.3 34.1.1.3 register
OSPF配置
area 0区域
例:
R3
ospf 1
area 0.0.0.0
network 172.16.20.0 0.0.3.255
area 0.0.0.1
abr-summary 172.16.32.0 255.255.224.0
network 172.16.48.3 0.0.0.0
network 172.16.56.1 0.0.0.0
stub no-summary
#
area 1区域
例:
R1
ospf 1
area 0.0.0.1
network 172.16.32.1 0.0.0.0
network 172.16.48.1 0.0.0.0
stub no-summary
#
area 2区域
例
R11
#
ospf 1
area 0.0.0.2
network 172.16.72.0 0.0.7.255
network 172.16.80.0 0.0.7.255
network 172.16.88.0 0.0.7.255
nssa no-summary
#
area 3 区域
例
R8
#
ospf 1
area 0.0.0.3
network 172.16.104.0 0.0.7.255
network 172.16.112.0 0.0.7.255
network 172.16.120.0 0.0.7.255
nssa no-summary
#
area 4区域
注:远离骨干的区域需要另外起一个ospf进程不与骨干区域相同
例
R9
ospf 1
asbr-summary 172.16.128.0 255.255.224.0
default-route-advertise
import-route ospf 2
area 0.0.0.2
area 0.0.0.3
network 172.16.120.0 0.0.7.255
nssa no-summary
area 0.0.0.4
#
ospf 2
default-route-advertise
import-route ospf 1
area 0.0.0.4
network 172.16.136.0 0.0.7.255
network 172.16.144.0 0.0.7.255
#
减少LSA更新量
1.路由汇总
ABR设备
R3
abr-summary 172.16.32.0 255.255.224.0
R6
abr-summary 172.16.64.0 255.255.224.0
R7
abr-summary 172.16.96.0 255.255.224.0
ASBR设备
R9
asbr-summary 172.16.128.0 255.255.224.0
R12
asbr-summary 172.16.160.0 255.255.224.0
2.特殊区域
末梢区域(非骨干,不存在ASBR设备,不存在虚链路)
因为要减少LSA条目所以这里配置成完全末梢区域
例
R1
stub no-summary
非完全末梢区域(非骨干,存在ASBR设备,不存在虚链路)
因为要减少LSA条目所以这里配置成完全的非完全末梢区域
例
R7
nssa no-summary
下放缺省路由
因为将R9配置及成完全的非完全末梢区域,R9将不再学习三类,四类和五类LSA只生成一条三类缺省路由因此要对area 4区域下放一条缺省保障网络畅通
R9:
default-route-advertise
加快收敛
1.修改接口类型
2.修改hello时间
例
area 1区域
R1
[r1-GigabitEthernet0/0/0]ospf timer hello 1
R2
[r2-GigabitEthernet0/0/0]ospf timer hello 1
R3
[r3-GigabitEthernet0/0/0]ospf timer hello 1
NAT地址转换
例
R3
acl number 2000
rule 1 permit anyinterface Serial4/0/0
link-protocol ppp
ip address 34.1.1.3 255.255.255.0
nat outbound 2000
测试
例
R1
全网可达
访问公网