OSPF综合实验

一、实验拓扑

 二、实验要求

1、R4为ISP,其上只能配置IP地址;R4与其他所有直连设备间均使用公有Ip
2、R3-R5/6/7为MGRE环境,R3为中心站点;
3、整个OSPF环境IP基于172.16.0.0/16划分;
4、所有设备均可访问R4的环回;
5、减少LSA的更新量,加快收敛,保障更新安全;
6,全网可达

三、实验配置

1、R4为ISP,其上只能配置IP地址;R4与其他所有直连设备间均使用公有Ip

r1:

#
interface GigabitEthernet0/0/0
 ip address 172.16.33.1 255.255.255.248 
#
interface LoopBack0
 ip address 172.16.34.1 255.255.255.0 
#

r2:

#
interface GigabitEthernet0/0/0
 ip address 172.16.33.2 255.255.255.248 
#
interface LoopBack0
 ip address 172.16.35.1 255.255.255.0 
#

r3:

#
interface Serial4/0/0
 link-protocol ppp
 ip address 43.0.0.1 255.255.255.0 
#
interface GigabitEthernet0/0/0
 ip address 172.16.33.3 255.255.255.248 
#
interface LoopBack0
 ip address 172.16.36.1 255.255.255.0 
#

r4:

#
interface Serial2/0/1
 link-protocol ppp
 ip address 45.0.0.2 255.255.255.0 
#
interface Serial3/0/0
 link-protocol ppp
 ip address 43.0.0.2 255.255.255.0 
#
interface Serial3/0/1
 link-protocol ppp
 ip address 46.0.0.2 255.255.255.0 
#
interface GigabitEthernet0/0/0
 ip address 47.0.0.2 255.255.255.0 
#
interface LoopBack0
 ip address 4.4.4.4 255.255.255.0 
#

r5:

#
interface Serial3/0/0
 link-protocol ppp
 ip address 45.0.0.1 255.255.255.0 
#
interface LoopBack0
 ip address 172.16.2.1 255.255.255.0 
#

r6:

#
interface Serial4/0/0
 link-protocol ppp
 ip address 46.0.0.1 255.255.255.0 
 nat outbound 2000
#
interface GigabitEthernet0/0/0
 ip address 172.16.65.1 255.255.255.248 
#
interface LoopBack0
 ip address 172.16.3.1 255.255.255.0 
#

r7:

#
interface GigabitEthernet0/0/0
 ip address 47.0.0.1 255.255.255.0 
 nat outbound 2000
#
interface GigabitEthernet0/0/1
 ip address 172.16.97.1 255.255.255.248 
#
interface LoopBack0
 ip address 172.16.4.1 255.255.255.0 
#

r8:

#
interface GigabitEthernet0/0/0
 ip address 172.16.97.2 255.255.255.248 
#
interface GigabitEthernet0/0/1
 ip address 172.16.97.9 255.255.255.248 
#
interface LoopBack0
 ip address 172.16.98.1 255.255.255.0 
#

r9:

#
interface GigabitEthernet0/0/0
 ip address 172.16.97.10 255.255.255.248 
#
interface GigabitEthernet0/0/1
 ip address 172.16.129.1 255.255.255.248 
#
interface LoopBack0
 ip address 172.16.130.1 255.255.255.0 
#

r10:

#
interface GigabitEthernet0/0/0
 ip address 172.16.129.2 255.255.255.248 
#
interface LoopBack0
 ip address 172.16.131.1 255.255.255.0 
#

r11:

#
interface GigabitEthernet0/0/0
 ip address 172.16.65.2 255.255.255.248 
#
interface GigabitEthernet0/0/1
 ip address 172.16.65.9 255.255.255.248 
#
interface LoopBack0
 ip address 172.16.66.1 255.255.255.0 
#

r12:

#
interface LoopBack0
 ip address 172.16.160.1 255.255.240.0 
#
interface LoopBack1
 ip address 172.16.176.1 255.255.240.0 
#
interface GigabitEthernet0/0/0
 ip address 172.16.65.10 255.255.255.248 
#

2、R3-R5/6/7为MGRE环境,R3为中心站点;
r3:

#
interface Tunnel0/0/0
 ip address 172.16.1.1 255.255.255.248 
 tunnel-protocol gre p2mp
 source 43.0.0.1
 ospf network-type p2mp
 nhrp entry multicast dynamic
 nhrp network-id 10
#

r5:

#
interface Tunnel0/0/0
 ip address 172.16.1.2 255.255.255.248 
 tunnel-protocol gre p2mp
 source Serial3/0/0
 ospf network-type p2mp
 nhrp network-id 10
 nhrp entry 172.16.1.1 43.0.0.1 register
#

r6:

#
interface Tunnel0/0/0
 ip address 172.16.1.3 255.255.255.248 
 tunnel-protocol gre p2mp
 source Serial4/0/0
 ospf network-type p2mp
 nhrp network-id 10
 nhrp entry 172.16.1.1 43.0.0.1 register
#

r7:

#
interface Tunnel0/0/0
 ip address 172.16.1.4 255.255.255.248 
 tunnel-protocol gre p2mp
 source GigabitEthernet0/0/0
 ospf network-type p2mp
 nhrp network-id 10
 nhrp entry 172.16.1.1 43.0.0.1 register
#

查看邻居表

3、整个OSPF环境IP基于172.16.0.0/16划分;

r1:

#
ospf 1 router-id 1.1.1.1 
 area 0.0.0.1 
  network 172.16.0.0 0.0.255.255 
#

r2:

#
ospf 1 router-id 2.2.2.2 
 area 0.0.0.1 
  network 172.16.0.0 0.0.255.255 
#

r3:

#
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 172.16.1.0 0.0.0.255 
  network 172.16.1.1 0.0.0.0 
 area 0.0.0.1 
  network 172.16.32.0 0.0.7.255 
#

r5:

#
ospf 1 router-id 5.5.5.5 
 area 0.0.0.0 
  network 172.16.0.0 0.0.255.255 
  network 172.16.2.0 0.0.0.255 
#

r6:

#
ospf 1 router-id 6.6.6.6 
 area 0.0.0.0 
  network 172.16.0.0 0.0.3.255 
  network 172.16.3.0 0.0.0.255 
 area 0.0.0.2 
  network 172.16.65.1 0.0.0.0 
#

r7:

#
ospf 1 router-id 7.7.7.7 
 area 0.0.0.0 
  network 172.16.0.0 0.0.7.255 
 area 0.0.0.3 
  network 172.16.97.1 0.0.0.0 
#

r8:

#
ospf 1 router-id 8.8.8.8 
 area 0.0.0.3 
  network 172.16.0.0 0.0.255.255 
#

r9:

#
ospf 1 router-id 9.9.9.9 
 import-route ospf 2
 area 0.0.0.3 
  network 172.16.97.10 0.0.0.0 
#
ospf 2 router-id 9.9.9.9 
 default-route-advertise //下发缺省路由
 area 0.0.0.4 
  network 172.16.128.0 0.0.3.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 
#

r12:

#
ospf 1 router-id 12.12.12.12 
 import-route rip 1
 area 0.0.0.2 
  network 172.16.65.10 0.0.0.0 
#
rip 1
 version 2
 network 172.16.0.0
#

4、所有设备均可访问R4的环回;

R3/5/6/7配置easy nat 以R3为例

#
acl number 2000  
 rule 5 permit source 172.16.0.0 0.0.255.255 
#
#
interface Serial4/0/0
 nat outbound 2000
#

5、减少LSA的更新量,加快收敛,保障更新安全;

配置路由聚合、特殊区域以及区域验证

r1

#
ospf 1 router-id 1.1.1.1 
 area 0.0.0.1 
  authentication-mode md5 1 cipher 12345
  stub 
#

r2

#
ospf 1 router-id 2.2.2.2 
 area 0.0.0.1 
  authentication-mode md5 1 cipher 12345
  stub 
#

r3

#
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  authentication-mode md5 1 cipher 12345
 area 0.0.0.1 
  abr-summary 172.16.32.0 255.255.224.0
  authentication-mode md5 1 cipher 12345
  stub no-summary
#

r5

#
ospf 1 router-id 5.5.5.5 
 area 0.0.0.0
  authentication-mode md5 1 cipher 12345
#

r6

#
ospf 1 router-id 6.6.6.6 
 area 0.0.0.0 
  authentication-mode md5 1 cipher 12345
 area 0.0.0.2 
  abr-summary 172.16.64.0 255.255.224.0
  authentication-mode md5 1 cipher 12345
  nssa no-summary
#

r7

#
ospf 1 router-id 7.7.7.7 
 area 0.0.0.0 
  authentication-mode md5 1 cipher 12345
 area 0.0.0.3 
  abr-summary 172.16.96.0 255.255.224.0
  authentication-mode md5 1 cipher 12345
  nssa no-summary
#

r8

#
ospf 1 router-id 8.8.8.8 
 area 0.0.0.3 
  authentication-mode md5 1 cipher 12345
  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 
  authentication-mode md5 1 cipher 12345
  nssa
#
ospf 2 router-id 9.9.9.9 
 default-route-advertise
 area 0.0.0.4 
  authentication-mode md5 1 cipher 12345
#

r10

#
ospf 1 router-id 10.10.10.10 
 area 0.0.0.4 
  authentication-mode md5 1 cipher 12345 
#

r11

#
ospf 1 router-id 11.11.11.11 
 area 0.0.0.2 
  authentication-mode md5 1 cipher 12345
  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 
  authentication-mode md5 1 cipher 12345 
  nssa
#

 配置空接口以及缺省路由

r3

#
ip route-static 0.0.0.0 0.0.0.0 43.0.0.2
ip route-static 172.16.32.0 255.255.224.0 NULL0
#

r5

#
ip route-static 0.0.0.0 0.0.0.0 45.0.0.2
#

r6

#
ip route-static 0.0.0.0 0.0.0.0 46.0.0.2
ip route-static 172.16.64.0 255.255.224.0 NULL0
#

r7

#
ip route-static 0.0.0.0 0.0.0.0 47.0.0.2
ip route-static 172.16.96.0 255.255.224.0 NULL0
#

加快收敛以R1为例

r1

#
interface GigabitEthernet0/0/0
 ospf timer hello 5
#

6,全网可达

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值