前缀列表(ip-prefix)配置

一.

实验简介

本来前缀列表是要和访问控制列表放在一起讲的,但是这里单拎出来是为了更详细的讲解两者的区别

1.前缀列表针对IP比访问控制更加灵活。

2.前缀列表在后面被引用时是无法对数据包进行过滤的

实验拓扑

二.

实验目的

R4路由器中只引入子网LoopBack的最后一位为单数的子网

实验配置

R1:

un ter mo

sys

sys R1

int g0/0/0

ip add 192.168.12.1 24

q

ospf router-id 1.1.1.1

area 0

net 192.168.0.0 0.0.255.255

q

R2:

un ter mo

sys

sys R2

int g0/0/0

ip add 192.168.12.2 24

int g0/0/1

ip add 192.168.23.2 24

q

ospf router-id 2.2.2.2

area 0

net 192.168.12.0 0.0.0.255

area 1

net 192.168.23.0 0.0.0.255

q

R3:

un ter mo

sys

sys R3

int g0/0/1

ip add 192.168.23.3 24

int g0/0/0

ip add 192.168.34.3 24

q

ospf router-id 3.3.3.3

area 1

net 192.168.0.0 0.0.255.255

q

R4:

un ter mo

sys

sys R4

int g0/0/0

ip add 192.168.34.4 24

int loo0

ip add 10.0.4.1 16

int loo1

ip add 10.0.4.2 24

int loo2

ip add 10.0.4.3 28

int loo3

ip add 10.0.4.4 29

q

ospf router-id 4.4.4.4

import-route direct

area 1

net 192.168.34.0 0.0.0.255

q

查看R2的路由表

在R4上配置前缀列表(后续会讲路由策略)

R4:

ip ip--prefix huawei permit 10.0.4.0 24 greater-equal 24 less-equal 29

route-policy ip permit node 10

if-match ip-prefix huawei

q

ospf

import-route direct route-policy ip

q

三.

实验验证

查看R2路由表

发现没有10.0.0.0/16这条路由了,这是因为我们对子网掩码做了过滤

相关推荐
程序员小张丶1 小时前
基于ArkUI-X框架的HarmonyOS 5.0主题应用开发
华为·主题·arkui-x·harmonyos5.0
wu~9702 小时前
计算机网络自定向下:第二章复习
服务器·网络·架构
Mylvzi2 小时前
Linux 性能利器:详解 `top` 命令的使用与输出信息解析
linux·服务器·网络
Dream Algorithm4 小时前
中国移动6周年!
网络·架构·信息与通信
小疆智控5 小时前
农田水利如何「聪明」起来?Modbus转Ethernet IP破解设备互联
网络·网络协议·tcp/ip
木mu升5 小时前
java 局域网 rtsp 取流 WebSocket 推送到前端显示 低延迟
网络·websocket·网络协议
勿念4365 小时前
在鸿蒙HarmonyOS 5中使用DevEco Studio实现指南针功能
华为·harmonyos
在人间耕耘6 小时前
unipp---HarmonyOS 应用开发实战
华为·harmonyos