ospf选路

问题描述
  • R6通过主备份路径访问LSP(R1),主为R2, 备为R3
解决方案
  1. 路由器1看作LSP,配置loopback 0 ,地址为1.1.1.1 供测试使用;
  2. 路由器 236, LSW4和LSW5, 运行ospf处于相同区域,建立邻居关系。其中2, 3 对应的ISP接口在ospf下配置静默silent-interface g0/0/0
  3. 在LSW4和LSW5上配置三层链路,划分vlan,中间采用聚合,终端使用access。
  4. R2和R3需要连接LSP(外网),配静态路由ip route-static 0.0.0.0 0 10.0.12.1 ,pre 60, 指向ISP。
  5. LSW4 和 LSW5 需要访问LSP, 在R2和R3下将缺省路由传递出去,在ospf进程下配置default-route-advertise type x R2 type = 1 , R3 type = 2
  6. 在LSW4和LSW5、R6中dis ip routing-table , dis ospf lsdbtracert 1.1.1.1 可以查看external router,发现type1 路由 优于 type2 路由, 即直接通过R2访问
  • 追踪路径,发现R5通过R2直接进行访问。—》发现问题!!!

解决问题:

  1. 在R3上修改静态缺省路由的优先级为200,再次到R6踪到ISP路径,发现路径没有切换,还在R3,(写出没有切换的原因) dis ospf lsdb

  2. 在R3上ospf进程下配置default-router-advertise type 2 permit-calculate-other,再次追踪ISP路径,发现路径切换到R2(写出切换的原因)

  3. 由于lsp是私网地址,需要在接口处做地址转换操作 nat outbount xxx

在这里插入图片描述

配置命令如下所示
# R1, R2, R3, R6的接口ip地址要配好
R1: 
int lo0
ip add 1.1.1.1
# R2, R3, R6, LSW4, LSW5 开启ospf
ospf r x.x.x.x 
a 0
net 0.0.0.0 0.0.0.0  # 实际需要配置点对点的
# 在R2R3ISP的接口处配置静默
ospf 1
silent-int gx/x/x

# 三层链路配置
LSW4LSW 5 类似,以4为例子:
vlan b 24 45
int g0/0/1
port link-type access
port default vlan 24
int vlan 24
ip add 10.0.24.4 24
int e1
trunk-port g 0/0/8 0/0/9
port link-type trunk
port trunk allow-pass vlan 45
int vlan 45
ip add 10.0.45.4 24

# 在R2R3上配置静态路由
ip route-static 0.0.0.0 0.0.0.0 10.0.12.1
ip route-static 0.0.0.0 0.0.0.0 10.0.13.1

# 在R2R3将缺省广播出去
ospf 1
default-router-advertise type 1  # R2default-router-advertise type 2  # R3 备
# 在R6上查看路由表 dis ip routing-table 0.0.0.0, 发现走R3

# 修改R3
ip route-static 0.0.0.0 0 10.0.13.1 pre 200
ospf 1
default-router-advertise type 2 permit-other

# 在R6上查看路由表 dis ip routing-table 0.0.0.0, 发现走R2!!!! 成功

# 在R2R3ISP的接口出配置nat
acl 2000
rule p
int xxx
nat outboutn 2000

# 在R6上ping 1.1.1.1, 在R2上使用dis nat session all 可看到nat转换

# 测试:默认走R2R2对应的接口shutdown后走R3

  • 8
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值