OSPF综合实验

目录

一、实验要求:

二、搭建实验拓扑规划IP 地址

1)实验拓扑搭建

2)IP地址规划

三、配置IP地址

四、搭建MGRE环境

五、OSPF配置

六、 双向重发布

七、NAT配置

八、路由聚合(汇总)

 防环

九、配置特殊区域 

十:保证更新安全、加快收敛

测试:


一、实验要求:

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、全网可达;

二、搭建实验拓扑规划IP 地址

1)实验拓扑搭建

 根据题目中图纸搭建拓扑

2)IP地址规划

        根据题目要求可知,整个OSPF环境IP基于172.16.0.0/16划分;除了R12有两个环回,其他路由器均有一个环回IP。则我们可以试着将其划分出八个子网。

区域/作用范围划分过程IP地址
area0172.16.0000 0000.0/19172.16.0.0/19
area1172.16.0010 0000.0/19172.16.32.0/19
area2172.16.0100 0000.0/19172.16.64.0/19
area3172.16.0110 0000.0/19172.16.96.0/19
area4172.16.1000 0000.0/19172.16.128.0/19
环回172.16.1010 0000.0/19172.16.160.0/19
保留地址172.16.1100 0000.0/19172.16.192.0/19
172.16.1110 0000.0/19172.16.224.0/19

三、配置IP地址

# R1
interface GigabitEthernet0/0/0
 ip address 172.16.33.1 255.255.255.0 
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.0 
interface LoopBack0
 ip address 172.16.35.2 255.255.255.0 

# R3
interface Serial4/0/0
 ip address 34.0.0.3 255.255.255.0 
interface GigabitEthernet0/0/0
 ip address 172.16.33.3 255.255.255.0 
interface LoopBack0
 ip address 172.16.36.3 255.255.255.0 

# R4
interface Serial3/0/0
 ip address 46.0.0.4 255.255.255.0 
interface Serial4/0/0
 ip address 34.0.0.4 255.255.255.0 
interface Serial4/0/1
 ip address 45.0.0.4 255.255.255.0 
interface GigabitEthernet0/0/0
 ip address 47.0.0.4 255.255.255.0 
interface LoopBack0
 ip address 172.16.2.4 255.255.255.0 

# R5
interface Serial4/0/0
 ip address 45.0.0.5 255.255.255.0 
interface LoopBack0
 ip address 172.16.3.5 255.255.255.0 

# R6
interface Serial4/0/0
 ip address 46.0.0.6 255.255.255.0 
interface GigabitEthernet0/0/0
 ip address 172.16.65.1 255.255.255.252 
interface LoopBack0
 ip address 172.16.4.6 255.255.255.0 

# R7
interface GigabitEthernet0/0/0
 ip address 47.0.0.7 255.255.255.0 
interface GigabitEthernet0/0/1
 ip address 172.16.97.1 255.255.255.252 
interface LoopBack0
 ip address 172.16.5.7 255.255.255.0 

# R8

interface GigabitEthernet0/0/0
 ip address 172.16.97.2 255.255.255.252 
interface GigabitEthernet0/0/1
 ip address 172.16.97.5 255.255.255.252 
interface LoopBack0
 ip address 172.16.98.8 255.255.255.0 

# R9
interface GigabitEthernet0/0/0
 ip address 172.16.97.6 255.255.255.252 
interface GigabitEthernet0/0/1
 ip address 172.16.129.1 255.255.255.252 
interface LoopBack0
 ip address 172.16.130.9 255.255.255.0 

# R10
interface GigabitEthernet0/0/0
 ip address 172.16.129.2 255.255.255.252 
interface LoopBack0
 ip address 172.16.131.10 255.255.255.0 

# R11
interface GigabitEthernet0/0/0
 ip address 172.16.65.2 255.255.255.252 
interface GigabitEthernet0/0/1
 ip address 172.16.65.5 255.255.255.252 
interface GigabitEthernet0/0/2
interface LoopBack0
 ip address 172.16.66.11 255.255.255.0 

# R12
interface GigabitEthernet0/0/0
 ip address 172.16.65.6 255.255.255.252 
interface LoopBack0
 ip address 172.16.160.12 255.255.255.0 
interface LoopBack1
 ip address 172.16.161.12 255.255.255.0 

四、搭建MGRE环境

中心站点R3

[R3]ip route-static 0.0.0.0 0 34.0.0.4    # 保证公网通

interface Tunnel0/0/0
 ip address 172.16.6.3 255.255.255.0 
 tunnel-protocol gre p2mp
 source 34.0.0.3
 ospf network-type broadcast
 nhrp entry multicast dynamic
 nhrp network-id 100

分支站点R5.R6.R7:     

# R5
[R5]ip route-static 0.0.0.0 0 45.0.0.4
interface Tunnel0/0/0
 ip address 172.16.6.5 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.3 34.0.0.3 register
# R6
[R6]ip route-static 0.0.0.0 0 46.0.0.4
interface Tunnel0/0/0
 ip address 172.16.6.6 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.3 34.0.0.3 register
# R7
[R7]ip route-static 0.0.0.0 0 47.0.0.4
interface Tunnel0/0/0
 ip address 172.16.6.7 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.3 34.0.0.3 register

五、OSPF配置

 R1

ospf 1 router-id 1.1.1.1 
 area 0.0.0.1 
  network 172.16.33.0 0.0.0.255 
  network 172.16.34.0 0.0.0.255 

R2

ospf 1 router-id 2.2.2.2 
 area 0.0.0.1 
  network 172.16.33.0 0.0.0.255 
  network 172.16.35.0 0.0.0.255 

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 
  network 172.16.33.0 0.0.0.255 
  network 172.16.36.0 0.0.0.255 

R5

ospf 1 router-id 5.5.5.5 
 area 0.0.0.0 
  network 172.16.3.0 0.0.0.255 
  network 172.16.6.0 0.0.0.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 
  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.5.0 0.0.0.255 
  network 172.16.6.0 0.0.0.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.97.2 0.0.0.0 
  network 172.16.97.5 0.0.0.0 
  network 172.16.98.0 0.0.0.255 

R9

ospf 1 router-id 9.9.9.9 
 area 0.0.0.3 
  network 172.16.97.6 0.0.0.0 
ospf 2 router-id 9.9.9.9 
 area 0.0.0.4 
  network 172.16.129.1 0.0.0.0 
  network 172.16.130.0 0.0.0.255 

R10

ospf 2 router-id 10.10.10.10 
 area 0.0.0.4 
  network 172.16.129.2 0.0.0.0 
  network 172.16.131.0 0.0.0.255 

R11

ospf 1 router-id 11.11.11.11 
 area 0.0.0.2 
  network 172.16.65.2 0.0.0.0 
  network 172.16.65.5 0.0.0.0 
  network 172.16.66.0 0.0.0.0 

R12

ospf 1 router-id 12.12.12.12 
 area 0.0.0.2 
  network 172.16.65.6 0.0.0.0 
rip 1
 version 2
 network 172.16.0.0

六、 双向重发布

 R9:

[R9]ospf 1	
[R9-ospf-1]import-route ospf 2
[R9]ospf 2	
[R9-ospf-2]import-route ospf 1

R12:

[R12-ospf-1]import-route rip 1
[R12]rip 1
[R12-rip-1]import-route ospf 1

七、NAT配置

# R3
acl 2000
rule 1 permit source any 	
int Serial 4/0/0
nat outbound 2000

# R5
acl 2000	
rule 1 permit source any 
int Serial 4/0/0
nat outbound 2000

# R6
acl 2000
rule 1 permit source any 
int s 4/0/0
nat  outbound 2000

# R7
acl 2000
rule 1 permit source any 	
int g 0/0/0
nat outbound 2000

八、路由聚合(汇总)

# 路由聚合
# R3
[R3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
# 6
[R6-ospf-1-area-0.0.0.2]abr summary 172.16.64.0 255.255.224.0
# 7
[R7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
# R9
[R9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
# R12
[R12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0

 防环

[R3]ip route-static 172.16.32.0 19  NULL 0
[R6]ip route-static 172.16.64.0 19 NULL  0
[R7]ip route-static 172.16.96.0 19 NULL  0
[R12]ip route-static 172.16.160.0 19 NULL  0
[R9]ip route-static 172.16.128.0 19 NULL O

九、配置特殊区域 

区域1:totally stub

        进入区域1对其内的所有路由器的对应区域视图内输入stub no-summary

       例如: [R1-ospf-1-area-0.0.0.1]stub no-summary(R1、R2、R3)

                   [R2-ospf-1-area-0.0.0.1]stub no-summary

                   [R3-ospf-1-area-0.0.0.1] stub no-summary    

区域2、3:totally nssa

        进入区域2、3对其内的所有路由器的对应区域视图内输入nssa no-summary

       例如: [R6-ospf-1-area-0.0.0.2]nssa no-summary

                   [R11-ospf-1-area-0.0.0.2]nssa no-summary

                   [R12-ospf-1-area-0.0.0.2]nssa no-summary 

                   [R7-ospf-1-area-0.0.0.3]nssa  no-summary

                   [R8-ospf-1-area-0.0.0.3]nssa no-summary

                   [R9-ospf-1-area-0.0.0.3]nssa no-summary(R6、R11、R12、R7、R8、R9)           

为使R10可以访问R4所以需要对R10下发缺省,由于R9本身存在缺省则使用以下命令:

        [R9-ospf-2]default-route-advertise 

十:保证更新安全、加快收敛

保证更新安全

给区域内每个路由器配置:authentication-mode md5  1 cipher 123456

例如:[R6-ospf-1-area-0.0.0.2]authentication-mode md5  1 cipher 123456

加快收敛

修改hello时间:每个使用OSPF协议的路由器接口均需要修改:ospf timer hello  5

例如:[R1-GigabitEthernet0/0/0]ospf timer hello 5

测试:

随机抽取路由器ping任何一个接口地址 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱玩网络的小石

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值