OSPF 路由汇总配置

网络 专栏收录该内容
35 篇文章 1 订阅

1.拓扑图

链接:https://pan.baidu.com/s/1IQ4gL0ZbKqQ88NW55sRT3Q
提取码:8888
eNSP
链接:https://pan.baidu.com/s/1wP0vHim4yqVV0bc0wmzhFw
提取码:8888
在这里插入图片描述

2、网络需求
a. SW、R1及R2运行OSPF,区域的规划如图所示;
b. SW使用network命令在各个用户VLAN上激活OSPF,使得OSPF路由器能够学习到用户VLAN的相关路由;
c. R2的Loopback接口都不直接通告到OSPF中,而是采用重发布直连的方式注入OSPF;
d. 在网络中部署OSPF路由汇总。
3.配置
R1的配置增加如下:
[R1] ospf 1
[R1-ospf-1] area 1
[R1-ospf-1-area-0.0.0.1] abr-summary 192.168.0.0 255.255.248.0

R2的配置修改如下:
[R2 ] ospf 1
[R2-ospf-1] asbr-summary 192.168.16.0 255.255.248.0

OSPF的路由汇总有两种方式,一种是在ABR上执行的,这种方式是在ABR上将某个区域内的路由进行汇总;另一种是在ASBR上执行的,将该ASBR重发布到OSPF的路由进行汇总。因此在本网络中,我们可以在R1(ABR)上执行路由汇总,将area1里SW下挂的vlan路由汇总后再通告到area0。另外还可以在R2(ASBR)上执行路由汇总,将R2重发布进OSPF的直连路由进行汇总。

3.1、SW1的配置
[SW1]display current-configuration

sysname SW1

vlan batch 11 to 17 200

cluster enable
ntdp enable
ndp enable

drop illegal-mac alarm

diffserv domain default

drop-profile default

aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http

interface Vlanif1

interface Vlanif11
ip address 192.168.1.254 255.255.255.0

interface Vlanif12
ip address 192.168.2.254 255.255.255.0

interface Vlanif13
ip address 192.168.3.254 255.255.255.0

interface Vlanif14
ip address 192.168.4.254 255.255.255.0

interface Vlanif15
ip address 192.168.5.254 255.255.255.0

interface Vlanif16
ip address 192.168.6.254 255.255.255.0

interface Vlanif17
ip address 192.168.7.254 255.255.255.0

interface Vlanif200
ip address 192.168.200.1 255.255.255.252

interface MEth0/0/1

interface GigabitEthernet0/0/1
port link-type access
port default vlan 11

interface GigabitEthernet0/0/2
port link-type access
port default vlan 12

interface GigabitEthernet0/0/3
port link-type access
port default vlan 13

interface GigabitEthernet0/0/4
port link-type access
port default vlan 14

interface GigabitEthernet0/0/5
port link-type access
port default vlan 15

interface GigabitEthernet0/0/6
port link-type access
port default vlan 16

interface GigabitEthernet0/0/7
port link-type access
port default vlan 17

interface GigabitEthernet0/0/8

interface GigabitEthernet0/0/9

interface GigabitEthernet0/0/10

interface GigabitEthernet0/0/11

interface GigabitEthernet0/0/12

interface GigabitEthernet0/0/13

interface GigabitEthernet0/0/14

interface GigabitEthernet0/0/15

interface GigabitEthernet0/0/16

interface GigabitEthernet0/0/17

interface GigabitEthernet0/0/18

interface GigabitEthernet0/0/19

interface GigabitEthernet0/0/20

interface GigabitEthernet0/0/21

interface GigabitEthernet0/0/22

interface GigabitEthernet0/0/23

interface GigabitEthernet0/0/24
port link-type access
port default vlan 200

interface NULL0

ospf 1
area 0.0.0.1
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
network 192.168.3.0 0.0.0.255
network 192.168.4.0 0.0.0.255
network 192.168.5.0 0.0.0.255
network 192.168.6.0 0.0.0.255
network 192.168.7.0 0.0.0.255
network 192.168.200.0 0.0.0.3

user-interface con 0
user-interface vty 0 4

return

3.2、R1的配置
[R1]display current-configuration

sysname R1

aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#
local-user admin service-type http

firewall zone Local
priority 16

interface Ethernet0/0/0

interface Ethernet0/0/1

interface Serial0/0/0
link-protocol ppp

interface Serial0/0/1
link-protocol ppp

interface Serial0/0/2
link-protocol ppp

interface Serial0/0/3
link-protocol ppp

interface GigabitEthernet0/0/0
ip address 192.168.12.1 255.255.255.252

interface GigabitEthernet0/0/1
ip address 192.168.200.2 255.255.255.252

interface GigabitEthernet0/0/2

interface GigabitEthernet0/0/3

wlan

interface NULL0

ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 192.168.12.0 0.0.0.3
area 0.0.0.1
abr-summary 192.168.0.0 255.255.248.0
network 192.168.200.0 0.0.0.3

user-interface con 0
user-interface vty 0 4
user-interface vty 16 20

return

[R1]
3.3、R2的配置
[R2]display current-configuration

sysname R2

aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#
local-user admin service-type http

firewall zone Local
priority 16

interface Ethernet0/0/0

interface Ethernet0/0/1

interface Serial0/0/0
link-protocol ppp

interface Serial0/0/1
link-protocol ppp

interface Serial0/0/2
link-protocol ppp

interface Serial0/0/3
link-protocol ppp

interface GigabitEthernet0/0/0
ip address 192.168.12.2 255.255.255.252

interface GigabitEthernet0/0/1

interface GigabitEthernet0/0/2

interface GigabitEthernet0/0/3

wlan

interface NULL0

interface LoopBack1
ip address 192.168.16.1 255.255.255.0

interface LoopBack2
ip address 192.168.17.1 255.255.255.0

interface LoopBack3
ip address 192.168.18.1 255.255.255.0

interface LoopBack4
ip address 192.168.19.1 255.255.255.0

interface LoopBack5
ip address 192.168.20.1 255.255.255.0

interface LoopBack6
ip address 192.168.21.1 255.255.255.0

interface LoopBack7
ip address 192.168.22.1 255.255.255.0

ospf 1 router-id 2.2.2.2
asbr-summary 192.168.16.0 255.255.248.0
import-route direct
area 0.0.0.0
network 192.168.12.0 0.0.0.3

user-interface con 0
user-interface vty 0 4
user-interface vty 16 20

return
3.4、查看SW1的路由表R2(ASBR)上汇总路由192.168.15.0
在这里插入图片描述
3.5、查看R2的路由表发现R1(ABR)汇总路由192.168.0.0
在这里插入图片描述
4全网络通讯
在这里插入图片描述
在这里插入图片描述

  • 4
    点赞
  • 1
    评论
  • 18
    收藏
  • 打赏
    打赏
  • 扫一扫,分享海报

评论 1 您还未登录,请先 登录 后发表或查看评论
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页

打赏作者

liudeke

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

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

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

打赏作者

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

抵扣说明:

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

余额充值