一.实验拓扑
二.实验要求
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、全网可达;
三.实验思路R
1.路由规划(基于172.16.0.0/16划分)并配置内外网IP地址
2.在R3-R5-R6-R7上配置缺省指向公网R4
3.配置MGRE R3作为中心站点 R5-R6-R7作为分支站点
(1).查看中心站点和分支站点nhrp配置 dis nhrp peer all
4.在MGRE和内网启用OSPF协议进行宣告
(1).查看邻居关系 在R8-R9-R11上 dis ospf peer
(2).OSPF下的MGRE环境需要更改接口模式和邻居关系(DR和BDR选举)
5.查看路由表 路由不全缺少area4 和rip的路由
(1).将rip重发布到OSPF中
(2).考虑优化选择多进程双向重发布——在R9上删除area4的宣告进入OSPF进程2,将进程1和进程2互相发布到对方的OSPF进程中
6.路由优化——减少路由条目
(1).非骨干区域
特殊区域:
area 0 R2,R1末梢 R3完全末梢
area 2 R11,R12nssa R6完全nssa
area 3 R8,R9nssa R7完全nssa
发缺省:
area 4 进入R9进程2 删掉进程1 发一条缺省给R10
(2).骨干区域
域间路由汇总ABR R3-R6-R7
域外路由向内部汇总ASBR R12-R9
注意:配置汇总后记得配空接口防环
7.更改收敛时间
8.OSPF区域认证
9.R3-R6-R7在公网接口加nat
四.配置步骤
1.在R3-R5-R6-R7上配置缺省指向公网R4
ip route-static 0.0.0.0 0.0.0.0 34.0.0.2
ip route-static 0.0.0.0 0.0.0.0 45.0.0.1
ip route-static 0.0.0.0 0.0.0.0 46.0.0.1
ip route-static 0.0.0.0 0.0.0.0 47.0.0.1
2..配置MGRE R3作为中心站点 R5-R6-R7作为分支站点
中心站点:
R3
interface Tunnel0/0/0
ip address 172.16.6.1 255.255.255.0
tunnel-protocol gre p2mp
source 34.0.0.1
ospf network-type broadcast
nhrp entry multicast dynamic
nhrp network-id 100
分支站点:
R5
interface Tunnel0/0/0
ip address 172.16.6.2 255.255.255.0
tunnel-protocol gre p2mp
source Serial4/0/0
ospf network-type broadcast
ospf dr-priority 0
nhrp network-id 100
nhrp entry 172.16.6.1 34.0.0.1 register
R6
interface Tunnel0/0/0
ip address 172.16.6.3 255.255.255.0
tunnel-protocol gre p2mp
source Serial4/0/0
ospf network-type broadcast
ospf dr-priority 0
nhrp network-id 100
nhrp entry 172.16.6.1 34.0.0.1 register
R7
interface Tunnel0/0/0
ip address 172.16.6.4 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type broadcast
ospf dr-priority 0
nhrp network-id 100
nhrp entry 172.16.6.1 34.0.0.1 register
3.启用OSPF协议并优化路由
R1
ospf 1 router-id 1.1.1.1
area 0.0.0.1
network 172.16.0.0 0.0.255.255
stub
R2
ospf 1 router-id 2.2.2.2
area 0.0.0.1
network 172.16.0.0 0.0.255.255
stub
R3
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 172.16.6.0 0.0.0.255
area 0.0.0.1
abr-summary 172.16.32.0 255.255.224.0
network 172.16.33.0 0.0.0.7
network 172.16.36.0 0.0.0.255
stub no-summary
R5
ospf 1 router-id 5.5.5.5
area 0.0.0.0
network 172.16.0.0 0.0.255.255
R6
ospf 1 router-id 6.6.6.6
area 0.0.0.0
network 172.16.4.0 0.0.0.255
network 172.16.6.0 0.0.0.255
area 0.0.0.2
abr-summary 172.16.64.0 255.255.224.0
network 172.16.65.0 0.0.0.3
nssa no-summary
R7
ospf 1 router-id 7.7.7.7
area 0.0.0.0
network 172.16.5.0 0.0.0.255
network 172.16.6.0 0.0.0.255
area 0.0.0.3
abr-summary 172.16.96.0 255.255.224.0
network 172.16.97.0 0.0.0.3
nssa no-summary
R8
ospf 1 router-id 8.8.8.8
area 0.0.0.3
network 172.16.0.0 0.0.255.255
nssa
R9
ospf 1 router-id 9.9.9.9
asbr-summary 172.16.128.0 255.255.224.0
import-route ospf 2
area 0.0.0.3
network 172.16.97.4 0.0.0.3
nssa
area 0.0.0.4
ospf 2 default-route-advertise
area 0.0.0.4
network 172.16.129.0 0.0.0.3
network 172.16.130.0 0.0.0.255
R10
ospf 1 router-id 10.10.10.10
area 0.0.0.4
network 172.16.0.0 0.0.255.255
R11
ospf 1 router-id 11.11.11.11
area 0.0.0.2
network 172.16.0.0 0.0.255.255
nssa
R12
ospf 1 router-id 12.12.12.12
asbr-summary 172.16.160.0 255.255.224.0
import-route rip 1
area 0.0.0.2
network 172.16.65.4 0.0.0.3
nssa
更改接口模式和邻居关系(R-3-5-6-7都更改)
interface Serial4/0/0
link-protocol ppp
[R3-Serial4/0/0]ospf dr-priority 0
4.R3-R6-R7在公网接口加nat
R3
interface Serial4/0/0
link-protocol ppp
ip address 46.0.0.2 255.255.255.0
nat outbound 2000
[R3-Serial4/0/0]dis acl 2000
Basic ACL 2000, 1 rule
Acl's step is 5
rule 5 permit source 172.16.0.0 0.0.255.255
R5
interface Serial4/0/0
link-protocol ppp
ip address 46.0.0.2 255.255.255.0
nat outbound 2000
[R5-Serial4/0/0]dis acl 2000
Basic ACL 2000, 1 rule
Acl's step is 5
rule 5 permit source 172.16.0.0 0.0.255.255
R6
interface Serial4/0/0
link-protocol ppp
ip address 46.0.0.2 255.255.255.0
nat outbound 2000
[R6-Serial4/0/0]dis acl 2000
Basic ACL 2000, 1 rule
Acl's step is 5
rule 5 permit source 172.16.0.0 0.0.255.255
R7
interface GigabitEthernet0/0/0
ip address 47.0.0.2 255.255.255.0
nat outbound 2000
[R7]dis acl 2000
Basic ACL 2000, 1 rule
Acl's step is 5
rule 5 permit source 172.16.0.0 0.0.255.255
5.配置汇总后空接口防环(R-3-6-7-9-12都配)
ip route-static 172.16.96.0 255.255.224.0 NULL0
五.测试全网通以及路由优化
1.全网通(R1 ping R4环回 R1 ping R5环回 R1 ping R10环回 R1 ping R12环回)
2.路由优化
R1-R5-R10-R12