Routing Prefix Lists

Document revision 1.0 (21-Jan-2003)
This document applies to MikroTik RouterOS v2.7

Table of Contents

Summary

Prefix lists are used to filter routes received from or sent to other routers.

Specifications

Packages required : routing
License required : Any
Home menu level : /routing prefix-list
Protocols utilized : None
Hardware usage: not significant

Related Documents

Software Package Installation and Upgrading
IP Addresses and Address Resolution Protocol (ARP)
Routes, Equal Cost Multipath Routing, Policy Routing
RIP, Router Information Protocol
BGP, Border Gateway Protocol

Description

Filtering by prefix list involves matching the prefixes of routes with those listed in the prefix list. When there is a match, the route is used. The prefix lists are used when specifying the BGP peers under /routing bgp peer or RIP interfaces under /routing rip interface.

To match a prefix-list entry, route should have its prefix (i.e. destination address) matching prefix property of the entry, and it should have the length of its prefix (i.e. mask of destination address) matching prefix-length property of the entry.

Prefix List Setup

Submenu level : /routing prefix-list

Property Description

name (name, default: "") - name for the prefix list
default-action (accept | reject, default: accept) - default action for all members of this list

Notes

An empty prefix list permits or rejects all prefixes.

Exapmle

To add a cybernet list that rejects the routes by default:
[admin@MikroTik] routing prefix-list> add name=cybernet default-action=reject
[admin@MikroTik] routing prefix-list> print
  # NAME                                                         DEFAULT-ACTION
  0 cybernet                                                     reject
[admin@MikroTik] routing prefix-list>

Prefix List Rules

Submenu level : /routing prefix-list list listname

Property Description

prefix (IP address/mask, default: 0.0.0.0/0) - network prefix
prefix-length (integer-integer, default: 0-32) - length (range) of the network prefix in bits
action (accept | reject, default: accept) - action for the list member

Notes

There are two different values to match - prefix (i.e. destination address of the route applying the network mask) and prefix length. Prefix length match network mask of the received route.

For example, if prefix=172.16.0.0/16 and prefix=length=16-24, then received route for 172.16.24.0/24 will match, but route for 172.16.24.0/25 will not.

Example

To accept the routes to the 172.16.0.0/16 network and any of it's subnetworks that has their network mask between 16 and 24.
[admin@MikroTik] routing prefix-list> list cybernet
[admin@MikroTik] routing prefix-list list cybernet> add prefix=172.16.0.0/16 \
\... prefix-length=16-24
[admin@MikroTik] routing prefix-list list cybernet> print
  # PREFIX             PREFIX-LENGTH ACTION
  0 172.16.0.0/16      16-24         accept
[admin@MikroTik] routing prefix-list list cybernet>

© Copyright 1999-2003, MikroTik