前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ip prefix-list命令详解和route-map

ip prefix-list命令详解和route-map

作者头像
刘銮奕
发布2019-07-22 17:26:28
4K0
发布2019-07-22 17:26:28
举报
文章被收录于专栏:奕知伴解奕知伴解

目录

ip prefix-list命令详解 route-map

ip prefix-list命令详解

  1. Construct a prefix list that permits only the 192.168.1.0/24 network.
代码语言:javascript
复制
ip prefix-list test1 seq 5 permit 192.168.1.0/24
  1. Construct a prefix list that denies network 119.0.0.0, and permits all other prefixes (including all subnets of 119.0.0.0).
代码语言:javascript
复制
ip prefix-list test2 seq 5 deny 119.0.0.0/8
ip prefix-list test2 seq 10 permit 0.0.0.0/0 le 32
  1. Construct a prefix list that permits only the default route.
代码语言:javascript
复制
ip prefix-list test3 seq 5 permit 0.0.0.0/0
  1. Construct a prefix list the permits everything except the default route.
代码语言:javascript
复制
ip prefix-list test4 seq 5 deny 0.0.0.0/0
ip prefix-list test4 seq 10 permit 0.0.0.0/0 le 32
  1. Construct a prefix list that permits network 172.16.0.0 and any of its subnets, and denies all other prefixes.
代码语言:javascript
复制
ip prefix-list test5 seq 5 permit 172.16.0.0/16 le 32
  1. Construct a prefix list that permits only the following prefixes:

10.2.8.32/27 10.2.8.32/28 10.2.8.32/29 10.2.8.32/30

代码语言:javascript
复制
ip prefix-list test6 seq 5 permit 10.2.8.32/27 le 30
  1. Construct a prefix list that:

Permits 197.25.94.128/25 Denies 197.25.94.192/26 Permits 197.25.94.224/27 Denies 197.25.94.240/28 Permits 197.25.94.248/29 Denies 197.25.94.252/30 Permits all other prefixes, except for 198.82.0.0/16

代码语言:javascript
复制
ip prefix-list test7 seq 5 deny 197.25.94.192/26
ip prefix-list test7 seq 10 deny 197.25.94.240/28
ip prefix-list test7 seq 15 deny 197.25.94.252/30
ip prefix-list test7 seq 20 deny 198.82.0.0/16
ip prefix-list test7 seq 25 permit 0.0.0.0/0 le 32
  1. Construct a prefix list that permits any prefix matching the first 20 bits of 175.29.64.0 which has a mask of at least /26 but not exceeding /29, and denies all other prefixes.
代码语言:javascript
复制
ip prefix-list test8 seq 5 permit 175.29.64.0/20 ge 26 le 29 
  1. Construct a prefix list that denies any prefix matching the first 19 bits of 15.26.96.0 with any mask up to and including /32, and permits any other prefix.
代码语言:javascript
复制
ip prefix-list test9 seq 5 deny 15.26.96.0/19 le 32
ip prefix-list test9 seq 10 permit 0.0.0.0/0 le 32
  1. Construct a prefix list that denies the RFC 1918 private networks and any of their subnets, and permits everything else.
代码语言:javascript
复制
ip prefix-list test10 seq 5 deny 10.0.0.0/8 le 32
ip prefix-list test10 seq 10 deny 172.16.0.0/12 le 32
ip prefix-list test10 seq 15 deny 192.168.0.0/16 le 32
ip prefix-list test10 seq 20 permit 0.0.0.0/0 le 32
  1. Construct a prefix list that permits any subnet of network 15.0.0.0 (but not the network), and denies everything else. Your router lies within AS 65011. Place the prefix list in service in the inbound direction with BGP neighbor 1.2.3.4.
代码语言:javascript
复制
ip prefix-list test11 seq 5 permit 15.0.0.0/8 ge 9

To place it in service: router bgp 65011 neighbor 1.2.3.4 prefix-list test11 in

  1. Construct a prefix list that denies 162.56.0.0/16 and all of its subnets (with the exception of 162.56.209.208/29, which is permitted), and permits all other prefixes. Your router lies within AS 65012. Place the prefix list in service in the outbound direction with its BGP neighbor having address 5.6.7.8.
代码语言:javascript
复制
ip prefix-list test12 seq 5 permit 162.56.209.208/29
ip prefix-list test12 seq 10 deny 162.56.0.0/16 le 32
ip prefix-list test12 seq 15 permit 0.0.0.0/0 le 32

To place it in service: router bgp 65012 neighbor 5.6.7.8 prefix-list test12 out

  1. Construct a prefix list that permits the CIDR block containing the thirty-two class C networks beginning with 200.202.160.0/24, and denies everything else. Your router is within AS 65013. Place the prefix list in service in the inbound direction with BGP peer-group "Lucky_13".
代码语言:javascript
复制
ip prefix-list test13 seq 5 permit 200.202.160.0/19

To place it in service: router bgp 65013 neighbor Lucky_13 prefix-list test13 in

  1. Construct a prefix list that denies any prefix for which the most-significant four bits are "0110", and permits everything else.
代码语言:javascript
复制
ip prefix-list test14 seq 5 deny 96.0.0.0/4 le 32
ip prefix-list test14 seq 10 permit 0.0.0.0/0 le 32
  1. Construct a prefix list that permits the host address of "CatSpace", and denies everything else.
代码语言:javascript
复制
ip prefix-list test15 seq 5 permit 64.82.100.67/32
  1. Construct a prefix list that permits only classful networks, and denies everything else.
代码语言:javascript
复制
ip prefix-list test16 seq 5 permit 0.0.0.0/1 ge 8 le 32
ip prefix-list test16 seq 10 permit 128.0.0.0/2 ge 16 le 32
ip prefix-list test16 seq 15 permit 192.0.0.0/3 ge 24 le 32
  1. Construct a prefix list that denies only supernets, and permits everything else.
代码语言:javascript
复制
ip prefix-list test17 seq 5 deny 0.0.0.0/1 le 7
ip prefix-list test17 seq 10 deny 128.0.0.0/2 le 15
ip prefix-list test17 seq 15 deny 192.0.0.0/3 le 23
ip prefix-list test17 seq 20 permit 0.0.0.0/0 le 32
  1. Construct a prefix list that permits only subnets, and denies everything else.
代码语言:javascript
复制
ip prefix-list test18 seq 5 permit 0.0.0.0/1 ge 9
ip prefix-list test18 seq 10 permit 128.0.0.0/2 ge 17
ip prefix-list test18 seq 15 permit 192.0.0.0/3 ge 25
  1. Construct a prefix list that permits only CIDR blocks encompassing at least 32 class-C equivalents.
代码语言:javascript
复制
ip prefix-list test19 seq 5 deny 0.0.0.0/0
ip prefix-list test19 seq 10 permit 0.0.0.0/0 le 19
  1. Construct a prefix list that permits only the RFC 1918 private networks and their subnets, and configure RIP to use this prefix list for outbound routing advertisements.
代码语言:javascript
复制
ip prefix-list test20 seq 5 permit 10.0.0.0/8 le 32
ip prefix-list test20 seq 10 permit 172.16.0.0/12 le 32
ip prefix-list test20 seq 15 permit 192.168.0.0/16 le 32

To place it in effect for outbound RIP updates: router rip distribute-list prefix test20 out

Route-Map

<Route-Map> 也叫路由图或者路由映射表,是对路由进行加工处理的工具。

1、route-map可以调用ACL或prefix抓出一部分路由进行加工处理 2、每一个route-map可以有多条语句,每条语句都有一个序号 3、每条语句都有两种动作:match 和 set 4、每条语句对抓出来的路由都有两种处理方式:permit 或 deny

route-map的使用分三步操作:

1、定义ACL或prefix抓出路由(定义感兴趣流量) 2、定义route-map说明对匹配的路由所采取的处理方式 3、调用route-map //route-map只是一个策略的工具,不调用是没有作用的.

代码语言:javascript
复制
route-map的匹配逻辑:
route-map NAME permit 10
match ip address x y z
——-> OR
match ip address a  ¦
match ip address b  ¦ AND
match ip address c  ↓
如不写match/set,默认:  match any
set nothing
本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2019-04-06,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 奕知伴解 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • ip prefix-list命令详解
  • Route-Map
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档