拓扑图:
实验要求:
-
R4为ISP,其上只能配置IP地址;R4与其他所有直连设备间均使用公有IP; -
R3~R5/6/7为MGRE环境,R3为中心站点; -
整个OSPF环境IP基于172.16.0.0/16划分;黑线标识环回网段所属区域。 -
所有设备均可访问R4的环回; -
减少LSA的更新量,加快收敛,保障更新安全; -
全网可达。
思路:
数广播域,子网划分,配置路由器接口的IP地址,配置MGRE,配置静态缺省路由,配置OSPF(rip重发布;R3、R6、R7域间汇总;特殊区域,认证,加速收敛),配置RIP,配置nat。
主机广播域:12;链路广播域:10
子网划分:
172.16.0.0/16
172.16.0.0/19 -- area 0
172.16.0.0/24 - P2P链路
172.16.0.0/29 - 无
172.16.1.0/24 - MA链路
172.16.1.0/29 - MGRE
172.16.2.0/24 - R4环回
172.16.3.0/24 - R5环回
172.16.4.0/24 - R6环回
172.16.5.0/24 - R7环回
172.16.32.0/19 -- area 1
172.16.33.0/24 - P2P链路
172.16.33.0/29 - 无
172.16.34.0/24 - MA链路
172.16.34.0/29 - R1~R2~R3
172.16.35.0/24 - R1环回
172.16.36.0/24 - R2环回
172.16.37.0/24 - R3环回
172.16.64.0/19 -- area 2
172.16.65.0/24 - P2P链路
172.16.66.0/24 - MA链路
172.16.66.0/29 - R6~R11
172.16.66.8/29 - R11~R12
172.16.67.0/24 - R11环回
172.16.96.0/19 -- area 3
172.16.95.0/24 - P2P链路
172.16.96.0/24 - MA链路
172.16.96.0/29 - R7~R8
172.16.96.8/29 - R8~R9
172.16.97.0/24 - R8环回
172.16.128.0/19 -- area 4
172.16.129.0/24 - P2P链路
172.16.130.0/24 - MA链路
172.16.130.0/29 - R9~R10
172.16.131.0/24 - R9环回
172.16.132.0/24 - R10环回
172.16.160.0/19 -- rip
172.16.160.0/20 - R12环回
172.16.176.0/20 - R12环回
34.0.0.0/24 --R3~R4链路
54.0.0.0/24 --R5~R4链路
64.0.0.0/24 --R6~R4链路
74.0.0.0/24 --R7~R4链路
1.1.1.1/24 -- R4环回(外网地址)
每个区域预留出给不同链路类型的网段,方便后期增加设备,每个路由器的主机分配24网段就足够了。
配置命令:
R1:
sys
sys r1
//配置路由器接口IP地址
int g0/0/0
ip add 172.16.34.1 29
int lo0
ip add 172.16.35.1 24
//配置OSPF
ospf 1 router-id 1.1.1.1
area 1
net 172.16.34.0 0.0.255.255
net 172.16.35.0 0.0.255.255
authentication-mode md5 1 cipher 123456
stub
R2:
sys
sys r2
//配置接口IP地址
int g0/0/0
ip add 172.16.34.2 29
int lo0
ip add 172.16.36.1 24
//配置OSPF
ospf 1 router-id 2.2.2.2
area 1
net 172.16.34.0 0.0.255.255
net 172.16.36.0 0.0.255.255
authentication-mode md5 1 cipher 123456
stub
R3:
sys
sys r3
//acl抓取内网流量
acl 2000
rule permit source 172.16.32.0 0.0.63.255
//配置接口ip地址
int g0/0/0
ip add 172.16.34.3 29
int lo0
ip add 172.16.37.1 24
int s4/0/0
ip add 34.0.0.2 24
nat outbound 2000
//静态缺省路由
ip route-s 0.0.0.0 0 34.0.0.1
//配置MGRE中心站点信息
int t0/0/0
ip add 172.16.1.1 29
ospf network-type broadcast
ospf dr-priority 2
tunnel-protocol gre p2mp
source 34.0.0.2
nhrp network-id 100
int t0/0/0
nhrp entry multicast dynamic
//配置OSPF
ospf 1 router-id 3.3.3.3
area 0
net 172.16.1.1 0.0.0.7
authentication-mode md5 0 cipher 123456
area 1
net 172.16.34.0 0.0.255.255
net 172.16.37.0 0.0.255.255
authentication-mode md5 1 cipher 123456
stub no-summary
//OSPF汇总
abr-summary 172.16.32.0 255.255.224.0
R4(ISP):
sys
sys ISP
//配置接口ip地址
int s4/0/0
ip add 34.0.0.1 24
int s3/0/0
ip add 54.0.0.1 24
int s4/0/1
ip add 64.0.0.1 24
int g0/0/0
ip add 74.0.0.1 24
int lo0
ip add 1.1.1.1 24
R5:
sys
sys r5
//acl抓取内网流量
acl 2000
rule permit source 172.16.3.0 0.0.0.255
//配置接口ip地址
int s4/0/0
ip add 54.0.0.2 24
nat outbound 2000
int lo0
ip add 172.16.3.1 24
//静态缺省路由
ip route-s 0.0.0.0 0 54.0.0.1
//配置MGRE分站点,向R3注册
int t0/0/0
ip add 172.16.1.2 29
ospf network-type broadcast
tunnel-protocol gre p2mp
source s4/0/0
nhrp network-id 100
nhrp entry 172.16.1.1 34.0.0.2 register
//配置OSPF
ospf 1 router-id 5.5.5.5
area 0
net 172.16.3.1 0.0.255.255
net 172.16.1.2 0.0.0.7
authentication-mode md5 0 cipher 123456
R6:
sys
sys R6
//acl抓取内网流量
acl 2000
rule permit source 172.16.64.0 0.0.63.255
//配置接口ip地址
int s4/0/0
ip add 64.0.0.2 24
nat outbound 2000
int g0/0/0
ip add 172.16.66.1 29
int lo0
ip add 172.16.4.1 24
//配置MGRE分站点,向R3注册
int t0/0/0
ip add 172.16.1.3 29
ospf network-type broadcast
tunnel-protocol gre p2mp
source s4/0/0
nhrp network-id 100
nhrp entry 172.16.1.1 34.0.0.2 register
//静态缺省路由
ip route-s 0.0.0.0 0 64.0.0.1
//配置OSPF
ospf 1 router-id 6.6.6.6
area 0
net 172.16.4.1 0.0.255.255
net 172.16.1.3 0.0.0.7
authentication-mode md5 0 cipher 123456
area 2
net 172.16.66.1 0.0.0.7
authentication-mode md5 2 cipher 123456
//OSPF汇总
abr-summary 172.16.64.0 255.255.224.0
nssa no-summary
R7:
sys
sys R7
//acl抓取内网流量
acl 2000
rule permit source 172.16.96.0 0.0.63.255
//配置接口ip地址
int g0/0/0
ip add 74.0.0.2 24
nat outbound 2000
int g0/0/1
ip add 172.16.96.1 29
int lo0
ip add 172.16.5.1 24
//配置MGRE分站点,向R3注册
int t0/0/0
ip add 172.16.1.4 29
ospf network-type broadcast
tunnel-protocol gre p2mp
source g0/0/0
nhrp network-id 100
nhrp entry 172.16.1.1 34.0.0.2 register
//静态缺省路由
ip route-s 0.0.0.0 0 74.0.0.1
//配置OSPF
ospf 1 router-id 7.7.7.7
area 0
net 172.16.5.1 0.0.255.255
net 172.16.1.4 0.0.0.7
authentication-mode md5 0 cipher 123456
area 3
net 172.16.96.1 0.0.0.7
authentication-mode md5 3 cipher 123456
nssa
//OSPF汇总
abr-summary 172.16.96.0 255.255.224.0
R8:
sys
sys R8
//配置接口ip地址
int g0/0/0
ip add 172.16.96.2 29
int g0/0/1
ip add 172.16.96.9 29
int lo0
ip add 172.16.97.1 24
//配置OSPF
ospf 1 router-id 8.8.8.8
area 3
net 172.16.96.2 0.0.0.7
net 172.16.96.9 0.0.0.7
net 172.16.97.1 0.0.255.255
authentication-mode md5 3 cipher 123456
nssa
R9:
sys
sys R9
//配置接口ip地址
int g0/0/0
ip add 172.16.96.10 29
int g0/0/1
ip add 172.16.130.1 29
int lo0
ip add 172.16.131.1 24
//配置OSPF
ospf 1 router-id 9.9.9.9
area 3
net 172.16.96.10 0.0.0.7
authentication-mode md5 3 cipher 123456
asbr-summary 172.16.128.0 255.255.224.0
nssa no-summary
ospf 2 router-id 9.9.9.9
area 4
net 172.16.131.0 0.0.255.255
net 172.16.130.1 0.0.0.7
authentication-mode md5 4 cipher 123456
default-route-advertise always
//重发布
ospf 1
area 3
import-route ospf 2
R10:
sys
sys R10
//配置接口ip地址
int g0/0/0
ip add 172.16.130.2 29
int lo0
ip add 172.16.132.1 24
//配置OSPF
ospf 1 router-id 10.10.10.10
area 4
net 172.16.130.2 0.0.0.7
net 172.16.132.1 0.0.255.255
authentication-mode md5 4 cipher 123456
R11:
sys
sys R11
//配置接口ip地址
int g0/0/0
ip add 172.16.66.2 29
int g0/0/1
ip add 172.16.66.9 29
int lo0
ip add 172.16.67.1 24
//配置OSPF
ospf 1 router-id 11.11.11.11
area 2
net 172.16.66.9 0.0.0.7
net 172.16.66.2 0.0.0.7
net 172.16.67.1 0.0.255.255
authentication-mode md5 2 cipher 123456
nssa
R12:
sys
sys R12
//acl抓取内网流量
acl 2000
rule permit source 172.16.160.0 0.0.64.255
//配置接口ip地址
int g0/0/0
ip add 172.16.66.10 29
nat outbound 2000
int lo0
ip add 172.16.160.1 20
int lo1
ip add 172.16.176.1 20
//静态缺省
ip route-s 0.0.0.0 0 172.16.66.9
//配置OSPF
ospf 1 router-id 12.12.12.12
area 2
net 172.16.66.10 0.0.0.7
authentication-mode md5 2 cipher 123456
nssa no-summary
asbr-summary 172.16.160.0 255.255.224.0
//配置RIP
rip 1
v 2
network 172.16.0.0
//重发布
ospf 1
area 2
import-route rip 1
验证:
R1pingISP
R5的OSPF路由表
R5pingR10
|