文章目录
- 前言
- 一、基础配置(配置各设备的IP地址)
- 二、配置各设备的ospf与isis
- 三、检查ospf与isis邻居是否建立成功
- 1.实现快速重路由
- 2.流量过滤方法
- 3.引入默认路由
- 4.配置等价路由
前言
在下面实验中,蓝色区域运行ospf,为了控制ospf的lsdb数量,划分了两个区域。其中区域1的ASBRR4与分支机构的路由器R5之间运行IS-IS为加快OSPF的收敛速度。
- 在区域0中部署ospf ipfrr(快速重路由)实现主备功能,并与BFD联动
- 在ABRR3上部署流量过滤,限制区域外的路由进入区域0
- 在R4上同时下发ISIS和OSPF的默认路由
- 为R7的loopback 1上的路由在,R5上配置等价路由指定优选路径
一、基础配置(配置各设备的IP地址)
R1
R2
R3
R4
R5
R6
R7
二、配置各设备的ospf与isis
R1
#
ospf 1 router-id 10.0.1.1 area 0.0.0.0 network 10.0.12.1 0.0.0.0 network 10.0.13.1 0.0.0.0 #
R2
#
ospf 2 router-id 10.0.2.2 area 0.0.0.0 network 10.0.12.2 0.0.0.0 network 10.0.23.2 0.0.0.0
#
R3
ospf 3 router-id 10.0.3.3 area 0.0.0.0 network 10.0.3.3 0.0.0.0 network 10.0.13.3 0.0.0.0 network 10.0.23.3 0.0.0.0 area 0.0.0.1 network 10.0.34.3 0.0.0.0
R4
ospf 4 router-id 10.0.4.4 area 0.0.0.1 network 10.0.4.4 0.0.0.0 network 10.0.34.4 0.0.0.0 network 172.16.0.4 0.0.0.0
#
isis 1is-level level-1network-entity 49.0001.0000.0000.4444.00is-name R4
#
interface GigabitEthernet0/0/1ip address 10.0.45.4 255.255.255.0 isis enable 1
R5
#
isis 1is-level level-1network-entity 49.0001.0000.0000.5555.00is-name R5
#
interface GigabitEthernet0/0/1ip address 10.0.45.5 255.255.255.0 isis enable 1
#
interface GigabitEthernet0/0/0ip address 10.0.56.5 255.255.255.0 isis enable 1isis cost 5#
interface GigabitEthernet0/0/2ip address 10.0.57.5 255.255.255.0 isis enable 1isis cost 10
#
R6
#
isis 1is-level level-1network-entity 49.0001.0000.0000.6666.00is-name R6#
interface GigabitEthernet0/0/0ip address 10.0.56.6 255.255.255.0 isis enable 1
#
interface GigabitEthernet0/0/1ip address 10.0.67.6 255.255.255.0 isis enable 1isis cost 5
R7
#
isis 1is-level level-1network-entity 49.0001.0000.0000.7777.00is-name R7
#
interface GigabitEthernet0/0/1ip address 10.0.67.7 255.255.255.0 isis enable 1
#
interface GigabitEthernet0/0/2ip address 10.0.57.7 255.255.255.0 isis enable 1
三、检查ospf与isis邻居是否建立成功
1.实现快速重路由
首先查看R3的loopback0的路由
[R1]display ospf routing 10.0.3.3OSPF Process 1 with Router ID 10.0.1.1Destination : 10.0.3.3/32 AdverRouter : 10.0.3.3 Area : 0.0.0.0 Cost : 1 Type : Stub NextHop : 10.0.13.3 Interface : GigabitEthernet0/0/1 Priority : Medium Age : 00h01m41s
发现这个路由的下一跳是R3的10.0.13.3学到的。
ospf 1 router-id 10.0.1.1 frrloop-free-alternate
再次查看
此时多了一条备份链路到达R3的loopback0
ospf与bfd联动
R1
#
bfd
#
ospf 1 router-id 10.0.1.1 bfd all-interfaces enable
#
interface GigabitEthernet0/0/1ip address 10.0.13.1 255.255.255.0 ospf bfd enable
R3
#
bfd
#
ospf 3 router-id 10.0.3.3 bfd all-interfaces enable
#
interface GigabitEthernet0/0/2
ip address 10.0.13.3 255.255.255.0 ospf bfd enable
看见UP表示R3跟R1的ospf联动BFD建立成功
2.流量过滤方法
正常情况下,R4的loopback1会在R1路由表内
现在我们需要的R3上做限制此路由引入到区域0内
#
acl number 2000 rule 5 deny source 172.16.0.4 0 rule 10 permit
#
ospf 3 router-id 10.0.3.3 filter-policy 2000 import
再返回R1上查看路由是否还存在
<R1>display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 18 Routes : 19 Destination/Mask Proto Pre Cost Flags NextHop Interface0.0.0.0/0 O_ASE 150 1 D 10.0.13.3 GigabitEthernet
0/0/110.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack010.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack010.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack010.0.3.3/32 OSPF 10 1 D 10.0.13.3 GigabitEthernet
0/0/110.0.4.4/32 OSPF 10 2 D 10.0.13.3 GigabitEthernet
0/0/110.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet
0/0/010.0.12.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/010.0.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/010.0.13.0/24 Direct 0 0 D 10.0.13.1 GigabitEthernet
0/0/110.0.13.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/110.0.13.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/110.0.23.0/24 OSPF 10 2 D 10.0.13.3 GigabitEthernet
0/0/1OSPF 10 2 D 10.0.12.2 GigabitEthernet
0/0/010.0.34.0/24 OSPF 10 2 D 10.0.13.3 GigabitEthernet
0/0/1127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
3.引入默认路由
[R4-isis-1]d th
[V200R003C00]
#
isis 1is-level level-1network-entity 49.0001.0000.0000.4444.00is-name R4default-route-advertise always level-1 ##配置默认路由[R4-ospf-4]d th
[V200R003C00]
#
ospf 4 router-id 10.0.4.4 default-route-advertise always ##配置默认路由
此时出现一条全为0的路由信息
尝试是否与R1相通
<R5>ping 10.0.12.1PING 10.0.12.1: 56 data bytes, press CTRL_C to breakReply from 10.0.12.1: bytes=56 Sequence=1 ttl=253 time=60 msReply from 10.0.12.1: bytes=56 Sequence=2 ttl=253 time=50 msReply from 10.0.12.1: bytes=56 Sequence=3 ttl=253 time=40 msReply from 10.0.12.1: bytes=56 Sequence=4 ttl=253 time=60 msReply from 10.0.12.1: bytes=56 Sequence=5 ttl=253 time=70 ms--- 10.0.12.1 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 40/56/70 ms
4.配置等价路由
在R5上查看10.0.7.0/24路由信息发现有两条路径可以到达,默认是走R5–R6–R7路由器。
isis 1is-level level-1network-entity 49.0001.0000.0000.5555.00is-name R5nexthop 10.0.57.7 weight 1nexthop 10.0.56.6 weight 2maximum load-balancing 1
指定了一个下一跳(nexthop)地址为 10.0.57.7,并且为这个下一跳分配了一个权重(weight)值为 1,值越小越优先。
maximum load-balancing 1:这条命令设置了最大负载均衡的数量为 1。
再次查看路由信息,发现10.0.7.0/24路由信息直接走R5–R7。