ospf_manual.pdf

(189 KB) Pobierz
299052226 UNPDF
OSPF
Document revision 1.3 (Mon Sep 06 04:56:42 GMT 2004)
This document applies to MikroTik RouterOS V2.8
Table of Contents
Table of Contents
Summary
Specifications
Related Documents
Description
General Setup
Description
Property Description
Notes
Example
Areas
Description
Property Description
Example
Networks
Description
Property Description
Notes
Example
Interfaces
Description
Property Description
Example
Virtual Links
Description
Property Description
Notes
Example
Neighbours
Description
Property Description
Notes
Example
OSPF backup without using a tunnel
Routing tables with Revised Link Cost
Functioning of the Backup
General Information
Summary
Page 1 of 15
299052226.002.png
MikroTik RouterOS implements OSPF Version 2 (RFC 2328). The OSPF protocol is the link-state
protocol that takes care of the routes in the dynamic network structure that can employ different
paths to its subnetworks. It always chooses shortest path to the subnetwork first.
Specifications
Packages required: routing
License required: level3
Home menu level: /routing ospf
Standards and Technologies: OSPF
Hardware usage: Not significant
Related Documents
Package Management
IP Addresses and ARP
Routes, Equal Cost Multipath Routing, Policy Routing
Log Management
Description
Open Shortest Path First protocol is a link-state routing protocol. It's uses a link-state algorithm to
build and calculate the shortest path to all known destinations. The shortest path is calculated using
the Dijkstra algorithm. OSPF distributes routing information between the routers belonging to a
single autonomous system (AS). An AS is a group of routers exchanging routing information via a
common routing protocol.
In order to deploy the OSPF all routers it will be running on should be configured in a coordinated
manner (note that it also means that the routers should have the same MTU for all the networks
advertized by OSPF protocol).
The OSPF protocol is started after you will add a record to the OSPF network list. The routes
learned by the OSPF protocol are installed in the routes table list with the distance of 110.
General Setup
Home menu level: /routing ospf
Description
In this section you will learn how to configure basic OSPF settings.
Property Description
distribute-default ( never | if-installed-as-type-1 | if-installed-as-type-2 | always-as-type-1 |
always-as-type-2 ; default: never ) - specifies how to distribute default route. Should be used for
ABR (Area Border router) or ASBR (Autonomous System boundary router) settings
never - do not send own default route to other routers
Page 2 of 15
299052226.003.png 299052226.004.png
if-installed-as-type-1 - send the default route with type 1 metric only if it has been installed (a
static default route, or route added by DHCP, PPP, etc.)
if-installed-as-type-2 - send the default route with type 2 metric only if it has been installed (a
static default route, or route added by DHCP, PPP, etc.)
always-as-type-1 - always send the default route with type 1 metric
always-as-type-2 - always send the default route with type 2 metric
metric-bgp ( integer ; default: 20 ) - specifies the cost of the routes learned from BGP protocol
metric-connected ( integer ; default: 20 ) - specifies the cost of the routes to directly connected
networks
metric-default ( integer ; default: 1 ) - specifies the cost of the default route
metric-rip ( integer ; default: 20 ) - specifies the cost of the routes learned from RIP protocol
metric-static ( integer ; default: 20 ) - specifies the cost of the static routes
redistribute-bgp ( as-type-1 | as-type-2 | no ; default: no ) - with this setting enabled the router will
redistribute the information about all routes learned by the BGP protocol
redistribute-connected ( as-type-1 | as-type-2 | no ; default: no ) - if set, the router will redistribute
the information about all connected routes, i.e., routes to directly reachable networks
redistribute-rip ( as-type-1 | as-type-2 | no ; default: no ) - with this setting enabled the router will
redistribute the information about all routes learned by the RIP protocol
redistribute-static ( as-type-1 | as-type-2 | no ; default: no ) - if set, the router will redistribute the
information about all static routes added to its routing database, i.e., routes that have been created
using the /ip route add command
router-id ( IP address ; default: 0.0.0.0 ) - OSPF Router ID. If not specified, OSPF uses the largest
IP address configured on the interfaces as its router ID
Notes
Within one area, only the router that is connected to another area (i.e. Area border router) or to
another AS (i.e. Autonomous System boundary router) should have the propagation of the default
route enabled.
OSPF protocol will try to use the shortest path (path with the smallest total cost) if available.
OSPF protocol supports two types of metrics:
type1 - external metrics are expressed in the same units as OSPF interface cost. In other words
the router expects the cost of a link to a network which is external to AS to be the same order of
magnitude as the cost of the internal links.
type2 - external metrics are an order of magnitude larger; any type2 metric is considered
greater than the cost of any path internal to the AS. Use of type2 external metric assumes that
routing between AS is the major cost of routing a packet, and climinates the need conversion of
external costs to internal link state metrics.
Both Type 1 and Type 2 external metrics can be used in the AS at the same time. In that event,
Type 1 external metrics always take precedence.
In /ip route you can see routes with Io status. Because router receives routers from itself.
The metric cost can be calculated from line speed by using the formula 10e+8/line speed. The table
Page 3 of 15
contains some examples:
network type
cost
ethernet
10
T1
64
64kb/s
1562
Example
To enable the OSPF protocol redisrtibute routes to the connected networks as type1 metrics with
the cost of 1 , you need do the following:
[admin@MikroTik] routing ospf> set redistribute-connected=as-type-1 \
\... metric-connected=1
[admin@MikroTik] routing ospf> print
router-id: 0.0.0.0
distribute-default: never
redistribute-connected: as-type-1
redistribute-static: no
redistribute-rip: no
redistribute-bgp: no
metric-default: 1
metric-connected: 1
metric-static: 20
metric-rip: 20
metric-bgp: 20
[admin@MikroTik] routing ospf>
Areas
Home menu level: /routing ospf area
Description
OSPF allows collections of routers to be grouped together. Such group is called an area. Each area
runs a separate copy of the basic link-state routing algorithm. This means that each area has its own
link-state database and corresponding graph
The structure of an area is invisible from the outside of the area. This isolation of knowledge
enables the protocol to effect a marked reduction in routing traffic as compared to treating the entire
Autonomous System as a single link-state domain
60-80 routers have to be the maximum in one area
Property Description
area-id ( IP address ; default: 0.0.0.0 ) - OSPF area identifier. Default area-id=0.0.0.0 is the
backbone area. The OSPF backbone always contains all area border routers. The backbone is
responsible for distributing routing information between non-backbone areas. The backbone must
be contiguous. However, areas do not need to be physical connected to backbone. It can be done
with virtual link. The name and area-id for this area can not be changed
authetication ( none | simple | md5 ; default: none ) - specifies authentication method for OSPF
protocol messages
Page 4 of 15
299052226.005.png 299052226.001.png
none - do not use authentication
simple - plain text authentication
md5 - keyed Message Digest 5 authentication
default-cost ( integer ; default: 1 ) - specifies the default cost used for stub areas. Applicable only to
area boundary routers
name ( name ; default: "" ) - OSPF area's name
stub (yes | no; default: no ) - a stub area is an area which is out from part with no routers or areas
beyond it. A stub area is configured to avoid AS External Link Advertisements being flooded into
the Stub area. One of the reason to configure a Stub area is that the size of the link state database is
reduced along with the routing table and less CPU cycles are used to process. Any router which is
trying access to a network outside the area sends the packets to the default route
Example
To define additional OSPF area named local_10 with area-id=0.0.10.5 , do the following:
[admin@WiFi] routing ospf area> add area-id=0.0.10.5 name=local_10
[admin@WiFi] routing ospf area> print
Flags: X - disabled, I - invalid
# NAME
AREA-ID
STUB DEFAULT-COST AUTHENTICATION
0 backbone
0.0.0.0
none
1 local_10
0.0.10.5
no 1
none
[admin@WiFi] routing ospf area>
Networks
Home menu level: /routing ospf network
Description
There can be Point-to-Point networks or Multi-Access networks. Multi-Access network can be a
broadcast network (a single message can be sent to all routers)
To start the OSPF protocol, you have to define the networks on which it will run and the area ID for
each of those networks
Property Description
area ( name ; default: backbone ) - the OSPF area to be associated with the specified address range
network ( IP address/mask ; default: 20 ) - the network associated with the area. The network
argument allows defining one or multiple interfaces to be associated with a specific OSPF area.
Only directly connected networks of the router may be specified
Notes
You should set the network address exactly the same as the remote point IP address for
point-to-point links. The right netmask in this case is /32 .
Example
Page 5 of 15
Zgłoś jeśli naruszono regulamin