题目要求
1:R4为ISP,其上只能配置IP地址;
2:R4与其他所有直连设备间均使用公有IP;
3:R3-R5/6/7为MGRE环境,R3为中心站点;
4:整个OSPF环境IP基于192.16.0.0/16划分;
5:所有设备均可访问4的环回;减少LSA的更新量,加快收敛,保障更新安全;
6:全网可达
题目分析
1.将网段192.16.0.0/16进行划分
2.与R4直连的设备配置动态NET
3.R3/5/6/7处于MGRE的环境下进行OSPF的网络搭建,R3为中心节点
4.进行特殊区域的配置
IP地址划分
R1
接口IP:192.16.0.1/30
环回地址:192.16.1.0/24
R2
接口IP:192.16.0.2/30
环回地址:192.16.2.0/24
R3
接口IP:192.16.0.3/30;34.0.0.1/30
虚拟接口IP:192.16.33.1/29
环回地址:192.16.3.0/24
R4
接口IP:34.0.0.2/30;54.0.0.2/30;64.0.0.2/30;74.0.0.2/30
环回地址:4.4.4.4/24
R5
接口IP:54.0.0.1/30
虚拟接口IP:192.16.33.2/29
环回地址:192.16.35.0/24
R6
接口IP:64.0.0.1/30;192.16.64.1/30
虚拟接口IP:192.16.33.3/29
环回地址:192.16.36.0/24
R7
接口IP:74.0.0.1/30;192.16.96.1/30
虚拟接口IP:192.16.33.4/29
环回地址:192.16.37.0/24
R8
接口IP:192.16.96.2/30;192.16.97.1/30
环回地址:192.16.98.0/24
R9
接口IP:192.16.128.1/30;192.16.97.2/30
环回地址:192.16.129.0/24
R10
接口IP:192.16.128.2/30
环回地址:192.16.130.0/24
R11
接口IP:192.16.164.2/30;192.16.65.1/30
环回地址:192.16.66.0/24
R12
接口IP:192.16.65.2/30
环回地址:192.16.160.0/24;192.16.161.0/24
配置内容
R1
interface GigabitEthernet0/0/0
ip address 192.16.0.1 255.255.255.248
#
interface LoopBack0
ip address 192.16.1.1 255.255.255.0
#
ospf 1 router-id 1.1.1.1
area 0.0.0.1
network 192.16.0.1 0.0.0.0
network 192.16.1.1 0.0.0.0
stub ----配置其为stub特殊区域
R2
interface GigabitEthernet0/0/0
ip address 192.16.0.2 255.255.255.248
#
interface LoopBack0
ip address 192.16.2.1 255.255.255.0
#
ospf 1 router-id 2.2.2.2
area 0.0.0.1
network 192.16.0.2 0.0.0.0
network 192.16.2.1 0.0.0.0
stub
R3
acl number 2000
rule 5 permit source 192.16.0.0 0.0.255.255 ----配置其动态NAT允许通过的IP地址
#
interface Serial4/0/0
link-protocol ppp
ip address 34.0.0.1 255.255.255.252
nat outbound 2000 ----在流量出接口调用ACL,启用动态NAT
#
interface GigabitEthernet0/0/0
ip address 192.16.0.3 255.255.255.248
#
interface LoopBack0
ip address 192.16.3.1 255.255.255.0
#
interface Tunnel0/0/0 ----搭建MGRE环境
ip address 192.16.33.1 255.255.255.248
tunnel-protocol gre p2mp ----修改其Tunnel口点到多点的类型
source 34.0.0.1
ospf network-type p2mp ----修改其Tunnel口为p2mp类型,加快收敛速度
nhrp entry multicast dynamic ----开启伪广播功能
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 192.16.33.1 0.0.0.0
area 0.0.0.1
network 192.16.0.3 0.0.0.0
network 192.16.3.1 0.0.0.0
stub no-summary ----配置其区域为完全的非完全末梢区域,此命令只在ABR设备上配置
#
ip route-static 0.0.0.0 0.0.0.0 34.0.0.2 ----手工配置缺省静态路由,从而达到访问公网的目的
R4
interface Serial3/0/0
link-protocol ppp
ip address 34.0.0.2 255.255.255.252
#
interface Serial3/0/1
link-protocol ppp
ip address 54.0.0.2 255.255.255.252
#
interface Serial4/0/0
link-protocol ppp
ip address 64.0.0.2 255.255.255.252
#
interface GigabitEthernet0/0/0
ip address 74.0.0.2 255.255.255.252
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.0
R5
acl number 2000
rule 5 permit source 192.16.0.0 0.0.255.255
interface Serial4/0/0
link-protocol ppp
ip address 54.0.0.1 255.255.255.252
nat outbound 2000
#
interface LoopBack0
ip address 192.16.35.1 255.255.255.0
#
interface Tunnel0/0/0
ip address 192.16.33.2 255.255.255.248
tunnel-protocol gre p2mp
source Serial4/0/0
ospf network-type p2mp
ospf dr-priority 0
nhrp entry 192.16.33.1 34.0.0.1 register ----向中心节点(R3)注册
#
ospf 1 router-id 5.5.5.5
area 0.0.0.0
network 192.16.33.2 0.0.0.0
network 192.16.35.1 0.0.0.0
#
ip route-static 0.0.0.0 0.0.0.0 54.0.0.2
R6
acl number 2000
rule 5 permit source 192.16.0.0 0.0.255.255
interface Serial4/0/0
link-protocol ppp
ip address 64.0.0.1 255.255.255.252
nat outbound 2000
#
interface GigabitEthernet0/0/0
ip address 192.16.64.1 255.255.255.252
ospf network-type p2p
#
interface LoopBack0
ip address 192.16.36.1 255.255.255.0
#
interface Tunnel0/0/0
ip address 192.16.33.3 255.255.255.248
tunnel-protocol gre p2mp
source Serial4/0/0
ospf network-type p2mp
ospf dr-priority 0
nhrp entry 192.16.33.1 34.0.0.1 register
#
ospf 1 router-id 6.6.6.6
area 0.0.0.0
network 192.16.33.3 0.0.0.0
network 192.16.36.1 0.0.0.0
area 0.0.0.2
network 192.16.64.1 0.0.0.0
nssa no-summary
#
ip route-static 0.0.0.0 0.0.0.0 64.0.0.2
R7
acl number 2000
rule 5 permit source 192.16.0.0 0.0.255.255
interface GigabitEthernet0/0/0
ip address 74.0.0.1 255.255.255.252
nat outbound 2000
#
interface GigabitEthernet0/0/1
ip address 192.16.96.1 255.255.255.252
ospf network-type p2p ----修改其接口类型为p2mp,加快收敛速度
#
interface LoopBack0
ip address 192.16.37.1 255.255.255.0
#
interface Tunnel0/0/0
ip address 192.16.33.4 255.255.255.248
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type p2mp
ospf dr-priority 0
nhrp entry 192.16.33.1 34.0.0.1 register
#
ospf 1 router-id 7.7.7.7
default-route-advertise ----下放缺省路由
area 0.0.0.0
network 192.16.33.4 0.0.0.0
network 192.16.37.1 0.0.0.0
area 0.0.0.3
network 192.16.96.1 0.0.0.0
vlink-peer 9.9.9.9
#
ip route-static 0.0.0.0 0.0.0.0 74.0.0.2
R8
interface GigabitEthernet0/0/0
ip address 192.16.96.2 255.255.255.252
ospf network-type p2p
#
interface GigabitEthernet0/0/1
ip address 192.16.97.1 255.255.255.252
ospf network-type p2p
#
interface LoopBack0
ip address 192.16.98.1 255.255.255.0
#
ospf 1 router-id 8.8.8.8
area 0.0.0.3
network 192.16.96.2 0.0.0.0
network 192.16.97.1 0.0.0.0
network 192.16.98.1 0.0.0.0
R9
interface GigabitEthernet0/0/0
ip address 192.16.97.2 255.255.255.252
ospf network-type p2p
#
interface GigabitEthernet0/0/1
ip address 192.16.128.1 255.255.255.252
ospf network-type p2p
#
interface LoopBack0
ip address 192.16.129.1 255.255.255.0
#
ospf 1 router-id 9.9.9.9
area 0.0.0.3
network 192.16.97.2 0.0.0.0
vlink-peer 7.7.7.7
area 0.0.0.4
network 192.16.128.1 0.0.0.0
network 192.16.129.1 0.0.0.0
stub no-summary
R10
interface GigabitEthernet0/0/0
ip address 192.16.128.2 255.255.255.252
ospf network-type p2p
#
interface LoopBack0
ip address 192.16.130.1 255.255.255.252
#
ospf 1 router-id 10.10.10.10
area 0.0.0.4
network 192.16.128.2 0.0.0.0
network 192.16.130.1 0.0.0.0
stub
R11
interface GigabitEthernet0/0/0
ip address 192.16.64.2 255.255.255.252
ospf network-type p2p
#
interface GigabitEthernet0/0/1
ip address 192.16.65.1 255.255.255.252
ospf network-type p2p
#
interface LoopBack0
ip address 192.16.66.1 255.255.255.0
#
ospf 1 router-id 11.11.11.11
area 0.0.0.2
network 192.16.64.2 0.0.0.0
network 192.16.65.1 0.0.0.0
network 192.16.66.1 0.0.0.0
nssa
R12
interface GigabitEthernet0/0/0
ip address 192.16.65.2 255.255.255.252
ospf network-type p2p
#
interface LoopBack0
ip address 192.16.160.1 255.255.255.0
#
interface LoopBack1
ip address 192.16.161.1 255.255.255.0
#
ospf 1 router-id 12.12.12.12
import-route rip 1
area 0.0.0.2
network 192.16.65.2 0.0.0.0
nssa
#
rip 1 ---启用RIP
version 2 ----选择版本2
network 192.16.160.0 ----宣告其网段
network 192.16.161.0
测试结果
R1环回 访问 公网
R1环回 访问 RIP的环回
R1环回 访问 R10的环回
R3为中心节点,查看其邻居表
R5为分支节点,查看其邻居表
设置区域1,4为stub末梢区域,区域2为NSSA特殊区域,减少其LSA信息,区域3内配置了Vlink虚链路,无法配置为特殊区域
R1路由信息(区域1)
R11路由信息(区域2)
R10路由信息(区域4)
将RIP的路由信息引入到OSPF内,其路由开销值为150