Learn Mikrotik RouterOS
Learn Mikrotik RouterOS
Learn Mikrotik RouterOS
\
~
1
I
,f
Learn RouterOS
I
I
,
I
l
I
,
I ntrod uction
-
I
,
I
.
,
We are going to give you code examples, screen shots and real world
application designs that you can do right on your own RouterOS system.
These items will enable you to do RouterOS work for your business, or
company. You will have the knowledge to use RouterOS as a router, wireless
access point, client premise device, web cach ing system, and even a VPN
(Virtual Private Network) server.
Table of Contents
Introduction..... .3
Who should use this book. .4
About the Author 5
Link Technologies, Inc ... 6
What is RouterOS? 18
How this Book is organized. 19
RouterOS Hardware 20
RouterBoard Devices 20
Solar Power and RouterBoards 23
X86 Based RouterOS Systems 24
26
27
29
Installation
30
. .....31
..40
.. .41
Accessing RouterOS
43
What are all of the methods of accessing a RouterOS System? ...44
Default User and Password
44
Using Neighborhood Viewer
.44
Using Telnet
46
Routing
54
System Options 54
Basic Firewall
55
Simple Queues
56
PPPoE Client
57
Access List.. .. .. 57
DHCP Server 58
Upgrades 59
Using WinBox 60
.64
WinBox Menus
Managing RouterOS
User Defaults
User Management
70
70
70
71
72
Active Users 73
SSH Keys
. 73
AAA Settings- Radius RouterOS Users 74
RouterOS Services 75
FTP Service 76
API Service 76
SSH / Te/net Serv ices
. 76
WWW Service / WWW-SS L Service 76
WinBox Service 77
. 77
. 79
. 79
Importing Scripts
Loggi ng
Setting Logging Rules
. 81
. 82
. 83
Basic Route rOS Setup 84
Configuring I P Addresses
84
Co m mon IP Inform ation 85
24 bit Bl ock or a /8 Prefix
85
20 bit Block or a /12 Prefix
85
16 bit Block or a / 16 Prefix
85
86
Default Routes
DNS Caching / Service
87
DHCP-Client
88
DHCP-Server
. 90
DH CP Server Wizard 90
. 96
Ma squ erad ing - NAT 98
Configuration of basic Masquerad ing
. .. 98
Home Router
100
Home Router Walkthrough
101
IP Pools
Bridged Client
105
How to Use Pseudobridge Mode 106
Routed / NAT ePE
106
RouterOS Features 108
IP Features 108
Interface ARP - Address Resolution Protocol Settings 109
ARP List / Table
110
Static Routing 111
Routing and Routes
. 114
Ch ecking Gateways 114
Using Distances 115
ECM P - Equal Cost M ultiple Path
. 115
Poli cy Based Routing
. 116
Routing Policies 117
Using Mangle to Route Traffic
119
Firewall Features
121
Traffic Identification 121
Understanding Connection States 122
Pa cket Flow in RouterOS
124
Chains... 125
In put Chain
. 125
Out put Chain 125
Forwa rd Chain 125
Other Chains ...... 126
Jumping to Chains 126
Returning from Chains 128
Address Lists 129
How to Match Data 131
Connection Bytes 132
Built-In Peer t o Peer Filtering
.133
Layer 7 Filters 134
Connecti on Limiting 135
Port Scan Detection
. 136
Ingress Priorit y / TOS / DSCP 137
Random 137
Limit / DST Limit 138
Nth
138
Time 139
Firewall Actions 139
Protecting Your Router 142
Protecting Networks .... 143
. . . .. ... ... .
157
161
Bridge Interfaces
Bridge Ports
170
171
Bonding
174
175
176
177
MESH 180
Switches and MESH 182
VRRP 182
Tunnels
10
185
EolP 185
Bridging an EolP Tunnel 187
IPIP 188
ppp System
. 189
ppp Secrets
. 189
PPP Profiles. 191
PPP Active Connections 191
PPP Server 192
PPP Client 195
L2TP/PPTP Servers 197
Win dows PTPP VPN Users 198
L2TP/PPTP Server Interfaces 198
L2TP/PPTP Client
199
Bridging PPTP 200
PPPo EServer
201
PPPoEServer Interfaces 201
PPPoEServer, Dynamic Routing and /32 Subnets! 202
PPPoE Client 203
OpenVPN
. 205
OpenVPN Server
. 205
OpenVPN Server Interface 206
OpenVPN Cli ent
206
208
IPSec
IKE Dom ain 209
Ch oosing a Tunn el Type
212
214
Wireless and RouterOS
WIC - Wireless Interface Cards 214
Basic Configuration of Wireless Interface Cards
216
Wireless Tools
218
Air/Data Rates and Performance 220
Access Point Time 221
Bands
. 221
Wireless Operat ional M odes 222
AP- Bridge (P2MP Access Point) Mode 222
W DS-Sl ave M ode
. 222
Bridge (P2P Access Point) Mode 222
. 223
Station (Wireless Cli ent) Modes
Security Profiles (Securing your Wireless Connection)
. 224
MAC Authentication
. 224
WEP (Wired Equival ent Privacy) 225
WPA / WPA2
. 226
Access Lists
Registration Table
Connection Lists
Area / Area Prefixes ....
Virtual Access Points
o o o
0.0.0.0.0 0
0.0 0
227
229
230
231
232
N-Streme 233
N-Streme Dual 234
Using WDS (Wireless Distribution System)
. 235
WDS Bridged Wireless Link
. 236
Static WDS Bridges
. 236
WDS Bridged Access Points
. 237
WDS Bridged Access Points - Dual Radios
. 238
WDS and 802.11n 238
Wireless Link Optimization / Best Practices 239
Keep it Simple First 239
Hardware Selection
. 239
Antenna coax and selection 239
Antenna Alignment
. 240
Find Possible Interference 240
Signal Issues
. 240
. 241
249
251
252
RED Queues
SFQ Queues.
PCQQueues
Using PCQ....
Queue Trees
Simple Queues.
253
254
254
256
258
259
12
I
. 259
Bursting
. 260
Creating Queue Priorities with Parents
. 261
. 262
Ensuring Bandwidth Allocations - VoIP
Creating Advanced Queues
. 264
Double Queuing
. 264
Large Transfer Queues 264
Setting Multiple PCQ Rates 265
Using Multiple Data Packages and peQ
. 268
Controlling P2P (Peer-to-Peer) Traffic 269
Limiting / Changing P2P and the Consequences
.. 270
Hotspots 272
Wireless and Hotspots 272
Paid Hotspots
. 273
Free Hotspots
. 273
RouterOS and Hotspots 274
Definitions
. 274
Setup of a Hotspot Interface in RouterOS 276
Configuration of Servers and Server Profiles 278
Hotspots with Radius
. 282
Internal Hotspot User Management
. 282
Using IP Bindings
. 284
Creating Walled Garden Entries
. 284
Viewing Hotspot Hosts and Active Users 286
Running multiple-subnets behind a hotspot interface 287
Running Dynamic Routing (RIP/OSPF) Behind a Hotspot Interface 288
Radius Client
. 290
Multiple Radius Servers 291
Troubleshooting Radius Client Issues 292
Nuts and Bolts 294
Accounting
DHCP Relaying
Neighbors
294
295
295
296
Pools
296
Socks 297
Clock 297
NTP .. 298
Client 298
Server ...... 298
System Identity 299
. 299
. 300
. 301
. 301
. 302
Logging
Reset Configuration
Scripting
Scheduler
Auto Upgrades
Watchdog 303
Bandwidth Test Server 303
Bandwidth Test Client 304
E-Mail System
Using Fetch Commands
Graphing
305
305
306
TFTP Server
308
Traffic-Flow 308
UPnP
. 309
IP Scan 310
Web Proxy 311
312
313
313
Store System
MetaRouters
Dynamic Routing
If Installed vs. Always
RiP
315
316
318
318
318
OSPF. 320
Changing Path Costs..... 321
OSPF Full Duplex Links 321
BG P
. 322
Instances 323
Peers 323
Networks 324
Aggregates 325
Routing Filters
The Dude NMS
325
328
Installation
.. 329
Windows Installation 329
RouterOS Installation 330
Dude Agents 330
Installation of a Dude Agent
14
330
Dude Layout
Running a Server
331
332
Resetting Configuration
333
333
334
336
Dude Agents
337
337
, 338
339
Charts .. 339
Devices 340
Device Options 342
Device Appearance
.345
Files
. 345
Transferring Files within Dude 345
Links 347
Link Speed Setting
. 348
Logs
.349
Network Maps 350
Map Settings
352
353
354
Upgrades
354
Creating Links
. 355
.. 355
Notifications
Outages
Probes
. 356
. 359
. 359
Tools 361
User Manager
. 364
.366
User Sign-U ps
User Sign-In Page
373
374
Active Sessions
374
Vouchers
374
16
377
380
380
381
381
382
382
383
384
386
386
388
,
I.
I
,I
,
,I
I,
,
I,
,
II
,
I
17
18
There are two sections to this book. The first section will teach you all about
the features that RouterOS offers, and how they relate to different types of
networks. You will learn about the feature, what it does and how it can help
your network. The second track is a quick configuration guide. This lets you
understand the components of the features, and puts the m into an exa mple
for you.
I,,
I
1
1,
I
!
,
j
I
I
,I,
I
I
I
I
j
I,,
,
I
\,
\,
19
I,
I
RouterBoard Devices
To the right is a RouterBoard 433AH. This board includes a 680 MHz
processor, three 10/100 Ethernet Interfaces and three M-PCI Slots. This unit
also includes a Micro-SD slot for Web Caching and other storage functions,
as well as Power-Over-Ethernet support, and a 9-pin Serial connection for
console access.
MikroTik is constantly developing new
products, so be sure to ask your
MikroTik distributor, or sales channel
about the latest products and where to
use them. Experienced Engineers will
know what board to use for what
purpose. A big mistake many make is
using underpowered equipment.
At the time of this writing, there are a
number of board series in production.
The RouterBoard Crossroads platform is
a micro Access-Point or CPE, Client
Premise Equipment. These units are low
cost, and include a built in 400mw
802.11 big wireless radio card. This
radio also is FCC certified with a number
of antennas. This board works great as
20
R84HAH
680MHz
expansion.
The RouterBoard 600 is considered an Extreme Performance Access -Point,
providing three Gigabit Ethernet ports as well as four M-PCI slots for wireless
connectivity.
This unit runs a network processor that is much faster than
the Atheros CPU on the 400 series boards. This unit also contains two
compact flash slots for storage needs. One could be used for Web Caching
data, and another could be used to store Dude or User Manager Data. If you
are looking to run 802.11N you will typically need to use this type of board
as the 802.11N protocol allows for greater than 100 Megabit UDP
throughput. Without the GigE interfaces, you will have a hardware limit at
your Ethernet port.
For core routing, with four Gigabit Ethernet interfaces as well as a rackmountable case, you can purchase a RouterBoard 1000 or 1000U. The U
version is a rack-mountable model. This system is also based on a high
performance network CPU running at 1333MHz. You can also use compact
flash storage cards, plus you have the ability to add more RAM via a
SODIMM slot. This unit also comes with a level 6 RouterOS license, included
with the cost of the hardware.
21
22
I have had quite a few requests on how to use RouterBoards with Solar
systems. So I wanted to give you a few pointers. The key is power
consumption, the newer RouterBoards, specifically the 400 series, is the
most common boards used for solar powered sites. Most sites are powered
by battery arrays at ether 12, 24, or 48 volt. The 400 series of devices run
from 10V to 28V DC power. When you install your RouterBoards with a long
Ethernet run you will assume there is some voltage drop, you can do a web
search on how to calculate this. If you are not doing a long Ethernet run,
then 12 volt may work out for you. MikroTik also has an ultra-low wattage
board the 411R. This board only requires 5.6 watts of power and has an
integrated big radio card.
If I had my choice, I would like to run 18-20V. The reason is that as the
batteries drain, the voltage drops, and if you are running 12 volt source, you
will quickly drop below 10Volts and the RouterBoards will stop running. If
you wanted to use 48v, the RouterBoard will not take that voltage so that
won't work either.
Some people have asked about using 24 volt solar systems. On a long
Ethernet run this will work, but on a short run you have to take into
consideration one other fact. Most of the solar charging controllers will
output 26.5 volts or higher, so when you are running on the 24 volt
batteries, and then the solar array is charging them, the voltage is higher and
we have seen the voltage spike higher than what the RouterBoards are
designed for so they power off to prevent overvoltage. So I like to run a bit
lower than 24 volt and a bit higher than the 12 volt systems as well. If your
only choices are 12 and 24 volt, then run 12 volt!
Regardless, RouterBoards can run great on solar setups, consuming only 35
watts at max. A single car 12 volt battery can run a single board for several
days without issues! Design the system correctly, and it can run for a long
time! We have some solar deployed and have never had to mess with it
other than to change batteries every few years.
24
~ Learn RouterOS
by Dennis Burgess
as USB Memory sticks, as well as Cellular data cards . They offer this model
in both AC and DC versions
They also create an ultra high-end system, called the PowerRouter 2200
series. These systems can run up to Dual Quad Core Xeon processors, and
can deliver up to 22 GigE Interfaces, including SFP interfaces that you can
These also sport dual hot-swappable power
use Fiber modules with.
supplies as well.
l
I
I
i
,
"
I,,
I,
,
!I
i
,,
I,
25
,
I
26
why they tend to last longer. Same with your RouterOS x86 device.
skimp when you have to rely on it.
Don't
RouterOS Licensing
RouterOS has five different licensing levels. Several are designed for
evaluation of the RouterOS software. License levels 3 through 6 are the
m ost common li censes. These are paid licenses. Most level 3 and 4 licenses
come with Rou t erBoard Product s and other products designed to run
RouterOS. The levelS and 6 are extended licenses designed for high end
applications.
License Level
Price/Cost
Upgradable
Wireless AP
W ireless CPE/Bridge
Dynamic Routing
EolP Tunnels
PPPoE Sessions
PPTP Tunnels
L2TP Tunnels
OVPN Tunnels
VLAN Interfaces
P2P Firewall Rules
NAT Rules
Hotspot Clients
Radius Client
Web Proxy
User Manager Sessions
$45
ROS v4.x
Yes
Yes
Yes
No Limit
200
200
200
200
No Li mit
No Limit
No Li mit
200
Yes
Yes
20
$95
ROS v5.x
Yes
Yes
Yes
No Limit
500
No Limit
No Li mit
No Limit
No Limit
No Limit
No Li mit
500
Yes
Yes
50
$250
ROS vs.x
Yes
Yes
Yes
No Limit
No Limit
No Limit
No Limit
No Limit
No Limit
No Limit
No Li mit
No Limit
Yes
Yes
No Limit
The level 3 Licenses are designed f or Client or CPE devices. These are for
wireless CPEs, or customer equipment. Typically you would purchase a Level
4 license or a WISP license. This license is included with many of the 400
series RouterBoard products, as well as other x86 RouterOS products. There
are no upgrades between licenses, so keep in mind the final usages. You can
purchase another license and place it on-top of an existing license. An
DaM or Disk on Module is a Flash disk that plugs into either a SATA or IDE
port.
28
provided the Netlnstall Utility. The next section will cover the Installation of
RouterOS on many different devices.
30
~
~
Before you start, you will have to download the right file, depending on the
model of your RouterBoard . There are several CPU versions of RouterOS,
and what RouterBoard you have will determine what CPU version of
RouterOS you need. For instance; if you have a RouterBoard 400 series
device, you will need the RouterOS version that supports the M IPSBE CPU. If
you have a RouterBoard 1000, you will need the PowerPC Processor Version .
So let's get started:
First, make sure you can use a term inal program to connect to the serial port
of your RouterBoard product. You should be able to power on the
RouterBoard, and see the boot process in your terminal program. Some
common programs that you can use, would be Windows HyperTerminal, or
Putty.
You
can
download
putty
at
http://www.chiark.greenend.org.uk/~sgtatham/puttyL You can also do a
web search as well to find download locations for Putty.
Second, you will need to configure a PC with a network cable running to
etherl of your RouterBoard product. You don't need a cross-over cable as
RouterBoards are created with auto MDI-X ports to automatically cross over
if necessary. It is possible to run through a switch, but this sometimes is
problematic, so I suggest running a cable directly between your computer
and the RouterBoard .
The screen above is an example of the RouterBOOT BIOS. Note that you
have the option to "Press any key within 2 seconds to enter setup". You will
need to enter the BIOS setup.
32
~eco nd.s
'Rout erBC'OT- 2 .7
~hat do you t'Jan t. 1:.0 ca n 't 1.!;f11r e ?
d
boot d el"y
bo ot k ey
k
s - ser 1al co nsole
o
hoo t d e v i c e
cpu mode
u
c - re3 e~ co n flgura tion
t orn'\e;t n '3nd
e
g
up gc tde f. 1 rravtace
board l nfo
boot pr ot o c o l
do we mo r y te" "i ng
p
t
x - eX1 t se tup
~"OUl:" c n o tce e
)nce you enter the RouterBOOT or BIOS of the RouterBoard, now you will
reed to finish setting up your Pc. Start your Netlnstall Utility.
.dD.l1!..l
Routen/O".. .es
\,.~
=.I E.\
Hell>
Rer-oveble mede
l3{f".'~~
>
N.....
V"'.....
....._
'his Utility will allow you to install via Netbooting of your RouterBoard. It
viII use your Ethernet cable to boot your RouterBoard, and enter an
There yOu can set tk'famelers tor P}(E IPTe-boot eXecutIOn Environmentl
and Ethetboot server that can boot your router 0 v 01 network
P'
Soot S ef V C1 enabled
OK
u.nce!
Here, enter the IP address that you wish to give your RouterBoards
Ethernetl Interface upon Netbooting. Remember, before we entered
192.168.0.1 as our IP on our Pc. Just like any other IP based device, we need
to make sure the IP that we give our RouterBoard is in the same subnet as
our Netlnstall Pc. My suggestion would be to use 192.168.0.2 and press OK.
Once we have the Installation server ready by using the Netlnstall Utility, we
need to tell our RouterBoard to boot from the Ethernet interface. From
where we left the terminal window, In the BIOS there is an option for Boot
Device. The option to select this is o.
34
vou should see the RouterBoard trying bootp protocol to boot as shown
above. Within a few seconds you should see the IP you put into your
Netlnstall Booter program, it should transfer the installation software, and
come up with the MikroTik Router Software Remote Installer.
\Je lco m~
Pr e ~ ~
t.o lll k r o T i k
Pout e r
Software r e n ,o t e
c o abort
:'tddt-e3S :
00 : DC : 42 : 0 1' : 66 : 69
00 : OC : 4 i:: OD : 66: 6A
00 : OC : 42 : or. . 66 : e.s
roe e - a d dr e s s:
m& c - a d d r ~ s 3 :
wa C' - ':'t dd r e 3 ~ :
l n 2 t a l l fttlo
l,rg1
qj."TRE - -
\.Tal t i ng .tor
l.T..I:::'t.,3I
1 lett io n servet: . .
It is now waiting for the installation server, next we go back to our Netlnstall
Utility as the RouterBoard is waiting for input.
36
Get key...
: ;:..
~::::;
.I.:::c:::;
,.::..
d.:..
1 P",.::::ck:::;'..,
Qo",{':!...
l
i
I.
i
M.k~ floppy
P~ck..,ge&
. SO,"
.I
No' booing
--- --
--
"
I~all
Cancel
::J
S~e set I
:7:':"'""'----:-""'-;'::""::---;:;..::=.~::=.~:-"~='~
::,1
~ erne
o rout eloNnipslt:'
o rocaeros-miosle
iii
o
lout ~IO'$" 'lbSOO
I
I
I
---= Selec t ~n
v ersion
D~ SCt~,?n
,,
3.6
3.6
AQUl:e,OS for Aoute,BOARD PB5)!)! &. ASl )()(. inclu des ell 'Supported Ie e twes
AoulerOS tOf AoulelB OARD RB5)()( $. RS1 )(Jo(, includes all supported featulBS
2.9.51
Note that we now have a device, typically labeled nstreme, along with its
MAC Address. This is the RouterBoard, and it's waiting for installation. We
then use the browse button under the packages section and find the
location where our NPK installation file is at. Upon selecting the folder, we
can then check the box with the proper installation file and version. You
may only have one file in this box, as it's the only one you may have
downloaded.
Once you have the package selected, you have a few other options. In the
upper right corner, you can select to keep old configuration, this will keep
the existing configuration, but write over the RouterOS Operating System. It
WILL NOT remove any passwords on your system. You also have the option
of specifying the default baud rate for the serial port, or including a
configuration script.
Once you are ready to do the installation, simply press the Install button!
37
Ihe Netlnstall Utility will then format the disk, in this case it will be the
NAND of the RouterBoard, perform the initial installation of the RouterOS
inst allat ion package. Once this is complete, you can press any key and the
RouterBoard will reboot. If you selected to boot from Ethernet once, and
then the NAND, upon rebooting, it will finish the load of RouterOS. If you
selected Ethernet only, it will come back to the installation server, unless
you go into the BIOS and set it to boot from the NAND
Above the system has restarted, booted from the NAND, generates the SSH
38
,i
!
II
I
I
I
1
j
1
I
I
I
1
!
1
I
,
I,
I,
,
II
L_I
13 .\
S f
I3 G"
SH \
M~o Ito,,,,.
, Softwau~ 10:1
" ey:
"'
Holp
G~eYley-
8"-1tt I (tic
..
IP adO
P_~'::::::::::::::::::::::::::::::;~::~-;":-:"~:7"""'~~~~"""''''''''~~S...
::::J
Seve set
40
Select 1I11
Seftox"J rlOfm
erne
o routeroc-x86
o routeroc-1<86
o loulefo3-x86
o roulelos -x86
o lOIAo''''''xlJ6
Bf~
3.3
3.4
3.5
3.6
J7
As you can see I have several Removable Media drives. In this image, we
have a USB flash reader with four slots, for different types of media. Only
one is my Compact Flash. I formatted the Compact Flash with windows prior
to starting Netlnstall, so I know its drive F on my system. I select my F drive,
then browse to the folder where my NPK file is located at, and select the
correct NPK file for installation. This is just like the final steps when using
the Netlnstall Utility with a RouterBoard. Once you have those options,
including your baud and script selected, you can simply press Install to
format and install the RouterOS System.
Once the installation is completed, it will say installation is complete in the
Netlnstall Utility; you will be able to shut down your PC or stop the
necessary flash drive and remove it. Insert the storage device into your new
RouterOS system, and power on. The first boot will finish the installation of
RouterOS on the storage device. This may take a few minutes. Once
complete, the system will restart, generate the SSH keys, start the RouterOS
Services, and then display a login prompt.
Note, when you have an existing licensed device, with DOMs, and flash
cards, there is no way to keep the old configuration!
41
42
Accessing RouterOS
RouterOS is not your normal Router. Typical methods such as SSH and
Telnet access are offered in RouterOS. However, there are two other
methods that allow you to configure your RouterOS system. MAC Telnet
gives you the ability to login to a RouterOS system that has no IP addresses
configured. In fact, this is one of the strongest admin abilities of RouterOS.
As long as there is Layer 2 connectivity, you can access your RouterOS
system!
Now, you might ask, it's a router, it should be doing TCP/IP Layer 3 routing
etc, why do I need to access it via layer2? Simple, if it's not configured, you
will have the ability to access and configure your RouterOS without needing
a console or serial cable!
I have done complete configurations of several
RouterOS devices across long range wireless links. The installers basically
configured RouterOS to connect wirelessly to an existing access point or
backhaul radio and then I am able to access all other RouterOS devices
without IPs and without configuration remotely!
The most common way though, to access your RouterOS configuration is
with a utility called Win Box. You can download this from Mikrotik's
web page, or if you have IP connectivity to your router, use your favorite web
browser and go to the routers IP address. This will bring up a configuration
page, which you can download Win Box at. I would suggest though, getting
the latest version via Mikrotik's webpage.
Just like the Net Install Utility, Win Box will function at either Layer2 or
Layer3. So you can connect to your RouterOS system via a MAC address or
an IP address. IF you are using the MAC, make sure you have your firewall
turned off, as well as any network protection software that you may have
loaded on your Pc.
~
~
Layer 2
MAC Telnet
Via MAC in Win Box
Layer 3
IP based Telnet
Via IP in WinBox
SSH -- Secure Shell
Webpage
API- Application Programming Interface
Serial Interface
44
I
I,
your device. Once entered, you will receive a terminal prompt and will be
able to issue terminal commands.
I
MA C Adaess
OO :OC :42:30 :09:C6
OO:OC :42:30:73:9C
..
IPAdaess
172.25 .0.2
172.25 .0.1
'y'erSlOf"1
ldent>tv
grage-bh
3 .15
433AH
4 . ~ .1
""'tiorm
MikroTI<
MiloroTI<
no,""
none
I
I
I
,,
\
!
A.fresh
i
MAC Teln..t
MAC Tei"lello...
Close
I
1
,
,,
i
I
I'1,
,
I
II
,I
1,
I,
By Selecting the RouterOS system that you wish to connect to, you can then
click on the MAC Telnet button, and it will open the Terminal program. This
program, will allow you to MAC Telnet into your router.
Loqin : ..dlIlin
P a s ~1J ord :
Tr y i nq 00 : OC : 42 :30 :73 : 9C
Connee re d ro 00 :OC :42 :30 :73 :9C
!liD!
I0OI
nIOOI
nIOOI
I0OI !IIlMII !IIDI
I0OI an I0OI
!IIDI
I0OI
I0OI
I0OI
TTTTTITITIT
TTTTTITITIT
JOO(
JOO(
I II
II I
I II
II I
JOO(
KIQ(
JOOOO<
JOO( JOO(
JOO(
KIQ(
RRRRRR
RRR RRR
RRRRRR
RRR RRR
000000
000 000
000 000
000000
TIT
TIT
TIT
TIT
JOO(
JOO(
III
III
III
III
KIQ(
KIQ(
JOOOO<
JOO( JOO(
KIQ(
KIQ(
( a du nS433AR 1 >
Using Telnet
By default, RouterOS has a tel net server enabled. You can use any telnet
application via the IPs on your RouterOS device to connect.
Upon
connecting you will receive a login prompt and then w ill be able to login and
issue terminal commands. RouterOS by default runs tel net sessions on the
default tel net port of 23.
Using windows you can type te/net ip_address of router. In w indows, you
can type Start -7 Run -7 CMD. This will open a command prompt window
and allow you to type your telnet command.
C:'>telnet 172 . 2 5 .0 . 1
Note you must have layer 3 connectivity. You w ill need an IP on your PC as
well as on your RouterOS System. Telnet sessions are typically not secure, as
they provide no data encryption, and keystrokes and text are sent in clear
text.
46
ruTTY ConflQur.x.ion
> _,~ , ,
B~SIC Ol)(j)rc
Sesser
l q;gI'l;J
8 T"rrinaI
Keyboerd
Feet.res
(OTtlCn 'l$.~
Tr:nsatcn
!: ele: 'I:Y'l
CoIo..1'*
Ccrr eclcn
~u
PuTTY se..;on
Host N~ la I? add-en)
1172 25 011
EeMVlOU
f:r
Eell
c..ppe dlcr<:e
t.:.
'
'low
T....et
='
.,:.;"'.....
' __
In
Rb;Jn ... S5H
Selia!
$!OI ~ ~e$uon
De-'aut: S~IIJ'lO~
tOdd
D.."
Sa"Ie
PI:l9
D_
Telne:
I
I
Rb:in
.-"'- SS H
: er 41
Oo$e
V\l~
(' AJw.alj!
_ _I
on exit
Ne....er
~ Only on
open
C'",N'l
ewit
Concti
As you can see there is a number of options, but for basic SSH connectivity,
you will need to put in the host name, or IP address into Putty. RouterOS
defaults to the standard SSH port of 22. You will use the connection type of
SSH. You can store sessions if you wish as well. Once you have the proper IP
information and port, you can click Open to start your SSH session.
Yes
The first time you connect to your RouterOS system, you will see a host key
that is not cached. This is the SSH Key that is generated upon the initial
installation of your RouterOS system. Putty will cache the key, so that you
don't get this message again if you wish. Typically you would hit yes to
cache the key. If you hit no, you will continue connecting, but it will not
cache they key,
Once you connect, you will get a login prompt. From this point on, your
connection will be just like a tel net session. You will be presented the
terminal window for programming RouterOS.
48
WebBox
RouterOS allows you to us a web page for basic configuration. To get to this
page, you will need layer3 connectivity or IP connectivity to your Router.
Your PC must be on the same subnet as the RouterOS system.
Simply browse to the IP address using your favorite web browser.
Inhnl(
I =
"(\",~I~,,~
is , ...eb b,nt' d
co"',,'''. , J tI~r, i- te-tew -c r
T h,~
r .1'I t
LV' nt'_~ t;
O'
" rT,- .e n~
.. ,~ o.r.e f(.';; .
>I~
In.
r , . r ' !{ OO (0"
~ye .
.e fO<;: . 4fl
.. .
" OJ le d
fO';;,l
" J wtt l
) (1 -' 0:
m;',I't",,:
t~ "' JC(:' .
---
.,.-
-"-
; , n .tI . n .f
to: c
tJ.:.
-t':ro . I'I""
t"'e
..
,.t..
01 , Lo. u:
,(1.
..... fl'J .I ..
l.r..
o(umflnt"tI4n
-_..-
...--
--
"e
" <1ft
th o:
Jr c: ' C: .. u te re c
M ~. '"l. tr , P V J : e f ? ~ : II~
""' I'.t or
tn drt ,
,:,.1 ;:) <I I ~
,............
n.,.,
H I.. ' t, ti ~ I ~ Q J
tr" l\d .,-h'1o ~ ~
p O: " S ~
r eec :
I ,)
)I
As you can see, there are a number of options here. If you click on the
WinBox image, you can download, right from your RouterOS. The WebBox
is the web based configuration, you will need to use the WebBox login at the
top of the screen.
From here you also can open a telnet window, by cl icking on the te lnet
section. Graphs are explained in detail in our " Graphing" section. You also
have options for the on-line MikroTik documentation, as well as the licensing
informat ion directly from M ikrotik's website.
w
...:....
.... .... .
~
l ~l=c1."i:5::;.
'-
System
:!-.,."':1'~t~ ;r-:-ac-e--i
Firewall
Routes
_ ..-
SimploQuoues
PPPoE
RegTable
AccessLlst
Na me T'Hlt'
~~1
c\ddlt.' ~fl;
ether-te t L.L.Ll..:.{:l
Gr -a p h
f.lr."l;!.h
!J.f.:'!l2.!:.
d!.5.r..t!!.r..d
ar..{}.[~h
~e r4
gr;:lh
yrd ... lt
q r.;;;..h
qr '.! ~ t:
DHCP Server
upgrade
LOgOL!
50
IP
et her-ret
Interface
button
on
the
Name Type
IP "ddr" . . Gr.-ph
etne rt err.err.et 1
~..\p~.!.~.
t;:
1 . 1 , 1/2 ~
ill:.llil
C.f "
Q.L~li.I)
_.
..fl.:?
9"Rh
Jllilli!
~.l1.h
ilWili
ill.illl
drs eble d
left
side
of
WebBox.
sr ]''''!
nl::,
,./ .~ tq'l~
. ..
I~:t!
.r1~r"""
~ ~ J t("~'~"l
\..,
\,' .... l .. J ';:I
,.1' .-.J. rqll"
.... , ( ['.")'-' (,.'.'1" )
'.
-,r'"
'-"". U"II'1.1.1_.
"" 'p _')(1J,',c'""
..
.. uti,,'()",tl"
..
_ L...... I, ,"HCP)
L'
,
I..
ethe rt
etherZ
e:ther3
1",lan
l-900
,,
Typ ~
etherne t dis3b le d
ethernet d l~ "bh;d
Q.!iUlh
ethern e t diseble c
ire le ss disab le d
Q.G!.lll !
oraph
!lliQh
~
'""eI
12.4.~:
Mode
I . p -brldge
::::oJ
Bd' 1d
::::oJ
F, "l1U'" ILy
Aulll:'n tl'./j te L.y d.:,fdUII.
Forward by default
::::oJ
J;<
po
You can specify either no security or Wi-Fi Protected access via WPA in the
security section on your w ireless interface as well. Note that you can enter
your Pre-shared key or PSK, as well as your group key update.
Security
("
t'~ (xle
[.~~-~:~~:~-~~:===:=
---_
52
_._
_.]
II'
--------
I
Registration Table
\
i
The RegTab le button on the left side, gives you the ability to view the
wireless registration table. Th is shows what interface w ireless radios are
connected to, as well what the MAC, signa l level, TX-Rate and the ability to
copy the MAC to the access list.
,I
,,
l
I
I
j
Registration Table
tnterfece
HAC Addre.s~
AI' S ig na l ~ 1 x-Rat e ~
r-----,_.
camera net
iI
I
'.
j,
,
I
I
I
,
i,
I,
,I,
L
Co
_--
54~lbD'5 ~ cO R. ............................
to .!Jece,,>;; Its"
..............................
no 6ti
no 'Vl
'>;.-'"
1 ~:5S:b4:.l5:0y
5 dMhpr.
.........
1.;:QB.~_1F:L~?~g~i..I'!t!
rcan-'er"
net 00:
,
.. " d'.
o.
_. __
...
')!
Routes ""d
!Destination
Gateway
10 ,0 ,0 ,0/ 0
I
I
,-:1., _. I , ==========
r.., _". ,
I
G3teway : I
System Options
I
I
"II? trnas k :
System
1D
_'=0
"I",,:r~i
"~" ' ~ '' 'I'l ,.3 , 1. 9
D 'J r",be,ot
R.:lfr",h
11,
The refresh timer specifies how often to refresh the WebBox software page
to show information such as usages, CPU time, etc.
There is also an option to perform a software reset; this resets the device to
a factory default configuration. Be careful w ith th is as it w il l w ipe out your
configuration as well.
54
Basic Firewall
Inside the RouterOS WebBox firewall, you have a few simple options. You
can specify a public Interface. Note that this is the ONLY time that you can
specify a " public" interface. You also have a number of check boxes, to
protect the router, the customer and perform NAT out the public interface.
These enter specific commands into RouterOS to perform these actions.
I
I
Firewall
I
1
Apply I
I
,I,
I,
I
1
55
Target -IP
Ma x -Umit. Interfa c e
20M/20M
---0/0
0/0
>i ,~able
a ll
all
a ll
a ll
0/0
cachehit
20W20M
a ll
none
.............
_._._...............I-_
... _-_.
......... .................................. _. -_._....
DSL Parent 172. 25.0 .0/ 24 60 0k!6 r"
a ll
Vo lP
[no ne
a ll
10M/15M
__
Inone
E I ~e
__
300k!4S00k a ll
p
'"
ljait a:move
'CC .
OutL i rn it:
-...---- .....
In -Limit: Lm
Target- IP: r
IL_
.m
. .m
m..mmmm)
..
i Interface:
56
Time:
Days;
_ .._.._
. ..
..
ail
10 0: 00: 09
sun
[Y]
... .
,(
Enabled : C
User: ,':-----~
Password : IL'
I n t erf ace: etber ;
Access List
I,
The RouterOS Access list specifies what interface and what MACs can either
Authenticate or Forward. Your interface defaults will apply if you do not
have the MAC address in the access list. This is your basic MAC access
control in MikroTik. Here you can add MAC addresses, select if you wish to
authenticate or allow the client to forward as well. You can also specify an
interface as well. It is possible to specify the MAC on multiple interfaces;
one could not allow the client to register, and another would, etc.
I,
Access List add
-"'
. ~.
r "'.)
I,.v'A.,
.. ....,"'r....
ct
... . ,~> ,--
,.",,.
I ''>
_,"
:-1 ,,;.,,1..
:;1::::-" " .,,'
ed.t r"mov'
::,...,....::.
~, .!:
"
j
MAC -Addr'e"' ''' .
-J..J
I nt erf ace:
Authent ica t e :
forward :
('C'
.~ o " '"t:ru
.. ~
Ii: I"!:: ..c';c,-:.!
ca rne ra net
yes
ves
........................................................................_ .._._._
II
57
,
i,
DHCP Server is on
Enabled:
:t
I
- '
--
p ri vate b rid ge
II
ilpe!Y changu
Below the DHCP Server options, you have the lease information. You can
view what MAC has what IP, as we ll as other information, and the ability to
add a static lease if you w ish .
Leases I Add I
-_.
-Addre s s
_. ._HAC
...._.._.._--......
iC!ie n t - 1D
Dvnamic Stat us !
58
no
no
bound
bound
bound
bound
bound
bound
bound
no
-_ ...-
no
i
I
no
no
"'-J
",
r :""'-'-",:
( L V..
~~ rem9"e
g':;able
! d'sal1l~
remove
wn r~rnQve!
Upgrades
The upgrade button allows you to specify a NPK file, upload the file and
upgrade your RouterOS device to the latest version. Be sure that you have
the proper file for the CPU version of RouterOS that you are using.
.
Upgrade
iI
First specify the file you wish to upload. This will upload the file via the web
browser. Once the file is uploaded, then you specify if you wish to remove
the file, upgrade, or in some cases downgrade RouterOS versions. Click on
whatever action that you wish to perform. Keep in mind that either function
will require the RouterOS device to reboot.
Filename
rout er05-PO'r\:erpc -J, : 9. rpk i r emo".e
I
1
I
l
upgrade
downgrade
_ _I
I
tMCAddr=
Penwold
OOOC4c13FAAE
OOOC 4c27:26:CO
OOOC:42:30:09:C6
OOOC42:3073:9C
Corl'oecI
Ide .
v.. ri<Jn
""""'_................
Mi<Jon
MokloTok
gragebh
433AH
'"""-~,
3 19
3 19
315
4 0betel
Inside the Win Box Display screen, you have several pieces of information,
including the MAC address of your RouterOS device, the Identity and the IP
on the interface closest to your Pc. You also will receive the Version of
RouterOS as well.
60
--_._ -
If you cl ick on the MAC address, it w ill place the MAC into the Connect To
window for you, if you click on the IP Address, it will place the IP address into
the Connect To window. Be sure that you have IP connectivity if you use the
IP address, otherwise, Win Box will use the MAC address to connect. Make
sure you have the proper username and password.
NOTE: That the MAC address connect feature, really should be used only to
get an initial IP onto your RouterOS device. Some functions, such as file
transfers etc, are problematic at best while connected with a MAC address
through Win Box.
Trenster rate:
Upon connecting you may need to download the plug-ins from the RouterOS
device. This typically should be very quick. Once it is done, it will open the
full Win Box Graphic Interface.
tit ...,..
...
'"
As you can see there are a number of options inside Win Box.
..]
.!!J
At the top of Win Box in the title bar, you will have a number of details. The
username@IP or MAC address of the RouterOS device will be listed at the
top. Next, the system identity is displayed, then the Win Box title, along with
the current RouterOS version number and what RouterBoard or system the
RouterOS device is. Next to that, we have the CPU type.
The two arrows on the left side of the screen are undo
and redo command buttons.
On the right side, we
have options to hide passwords, a small green box that
shows the CPU load, and a lock to show if we are logged
62
1
I
I,
I
\
\,
I
ii
,
I
I
I
,j
,
!
PPP
IP
Routing
Ports
Queues
Drivers
System
Rle.
Log
SNMP
Users
,h
RouterOS orginizes its features inside a DirectoryStructure like system . Each object on the WinBox
menu, has other sub-menus.
For instance, if
you click on System, you
Identity
will get the menu to the
right. Notice, that we can
Oock
setup parameters such as
NTP Oienl
clock
settings,
view
Besources
system
resources
and
Lcense
even reboot or shutdown
Packages
the system.
~o Upgrade
Radius
This
system
is
mirrored
in
Tools
the
command
line
New Terrninal
interface.
We discuss
Telnel
more
command
line
Pass\\'O",
options and features in
CertifICates
the command line section.
Stores
The simplest method of
Make Supoul.rif
understanding this is by
Manual
using the menu structure.
If you wished to access the
system reboot command, in
Win Box you click, system, then
command line, you would type, system reboot.
Logging
HistOl)'
Console
Scnpts
Scheduler
Watchdog
Health
Reboot
ShutdoV\l1
reboot.
In the
Win Box also uses sub sections via tabs. In the wireless section, we see a
number of tabs that each represent another level of commands. Below, you
will see we have interfaces, access-lists, and other tabs. In the command
64
Below and on the next pages I have created a layout for winbox menus so
that you will know where each menu item is. Keep in mind as well though,
that this is for version 3.25+ as there was a major menu change to
accomidate small resolution laptops!
Interfaces
...
Bridge
Wireless
ppp
Mesh
"I
I
I
Allin terfaes
Interfaces
Bridge
Mesh
Interface
Ethernet
NStream Dual
Ports
Ports
PPPoE Server
EolP Tunnel
Access List
Filters
FDB
Secrets
IP Tunnel
R~ g i5 t ra t ion
Table
VLAN
Connect List
VRRP
Se<:urity
Profiles
Profile
NAT
,
Hosts
Active
Connect ions
8Qndmg
65
MLPS
'" t'"
ARP
VP LS
Routing
System
"
l OP Instance
VLPS
BGP
Auto Upgrade
Accour mnq
Add resses
Certificates
l OPN eghbor
BGPVPLS
Filters
Clock
DHCP Client!
OHCPRelay
Accept Filter
Cisco BGP
VLPS
I-
MME
Consle
Drivers
DHCPServer
Advertise Filt@r
f-
OSPF
Health
ONS
Firewall
Forwardiog
Table
History
Prefix Lists
Identity
Hotspot
MPLS Interface
RI P
License
IPSEC
logging
Neighbor>
Local Bindings
Packing
Remote
Pool
Routes
'-
NTP Client
Peckecee
Bindings
Password
Ports
SNMP
Reboot
Services
Resources
Socks
Schuduler
TFTP
Scripts
Traffic F= low
Shutdown
UPnP
Stores
w eb Prexy
UPS
Users
Watchdog
66
---------
- - --
1,,
,,
I1
I1
,
I
J
Queues
II
1I
Files
Log
Radius
Tools
\I
S~eOueA
BTan Server
n!..rfece c....
al"ldo..ICt., Tt!s:
,I
I
I
Em,
O~u.Tru
,I
~oodP~
,,
(,r_F' ii:"g
,,I
p 5(."l
MAC S.rvllr
I,
Netwatch
Pt;C<!!1 Sdfl'.,.,
j
I
, "S
I,tr
Pi"g Speed
,,l
..... M!
II
"'or-;:t-
-",
,J
T,',,<,,
New
Terminal
- - - -- - -
Make
SupOut
Manual
Exit
"'.
womtc-
[BB ~ ~ lel T
-[R"",e
0 1COCians i[ I] rr='= = = =
=
11= ,-
====;,--;=;-;==
=
"
I
+ =..
Firer
-t
The filter button is the rightmost icon. This allows you to filter your objects
in the list by some method. Depending on the location in RouterOS, you
may be able to filter based on Name, MAC, or maybe Action type, SRC
address, etc. You can filter several ways a well, by selecting if it contains,
does not contain, is or is not as well. Then you can type in the text that you
wish to filter. You also have a Plus and Minus button to the left of the text.
This will add or remove another filter, so that you can filter your objects by
several different criteria.
You will also find sections
in RouterOS that contain
counter resets. In some
sections, such as Firewall
68
rules etc, you will have counters that count packets or bytes. If you select an
object, you can reset that individual objects counters with the Reset
Counters button. If you wish to reset all counters in the list, you can use the
Reset All Counters button.
Some sections may have a Find, as well as a dropdown listing of some type.
We will cover each of the
dropdowns
as
we
get
to
each
r .
mm . mmm1 I"""?" m mmmmm m.. mmm;r=;
section. The find will find the
. : 'iO
_J lall
.
J .. l
selected text and highlight it in
the object window below to help
you locate objects with certain text.
69
User Defaults
By default RouterOS will install with a user called Admin and have no
password. This user will be in the Fill User Group, giving you full access to
the router.
User Management
RouterOS has a built in user management system, this is located under the
Users section of RouterOS.
70
Uoero 1Group.
Active Users
,_~1[~"_J L_.
j N';;;;;;
'r : : ..
admn
SSH V.)'S
._.J
...
....
ful ....__
...
...__ ...
.....
_.__ ...__
...__ ....
..
..__
__.__ ...
'..
...
..
....J
litem
In the user section, you will have a number of tabs, just like the rest of
RouterOS. These tabs include the list of users, the groups of users, current
active users, and any SSH Keys that you generate.
Name:
~[ug=
' ~=1==:;;::::
:1 rea=.: d: .-_1C!J
Group c.:
JIJIowed Address :
"
SSH Keys
~----,I
r:lB- [9 rn
IName
Po&cies
read
write
,/
72
-- .- --
..
.._.
__
"
'l.
...
Io<-..al t ~ et ssh ftp reboot read wnIe poLey test --.box passw .
local telnel ssh reboot read test winbox password web SIlIff
Iocallelnet ssh reboot read .....rite lest winbox password web """
f~
.._..
I
.__._---- _
.._-,
. ~
c'
I
II
c,
DN_Group
r-"---,--- - -
OK
Polcie.
'J IocllI
'J soh
Callcel
:::::: tehel
':J ftp
C read
o reboot
o ..
n policy
o test n wnbox
Tile
[ ] paSSVl'Ofd
[ ] snrff
I
I
I
I
I PWt I
I Convner1 I
n web
[-C~-=J
Remove
Active Users
The act ive user section simply shows you what current active users are
connected to your router. In this case, we have a Win Box connection from
an IP. We also have a SSH connection from the same IP address.
SSH Keys
.--_. - _.
o
I
l.
i!lme
i!ldmin
.. .
admln
,
"
From -
...._-_."-"--
anlO1!1970
00:00:21
............
. .7225.0.3.9
...
Jan/01/ 1970 01:52 25 172 25.0.33
__
Via
winbox
I
!
ssh
SSH Keys
SSH keys are used to authenticate sessions without using a
username/password. By importing a DSA key here, and your SSH session
having the correspond ing key. You will import keys here. Import these by
clicking the Import SSH key button, then specifying what user w ill use this
key, and select the key file. You will have to have uploaded your Key file
already. See the Files section of Managing RouterOS for information on how
to do this.
Once you have imported your key, you can use your DSA key on your client
without having to
login. It will use
that key with that
Use. . Ist
user.
"(
User
....,SSHKe,.
,'tI
...
o Use RADIUS
OK
~ Accounting
hterim Update:
IL
----'1 ...
-..JilIJ
I Cancel
,
~ply
I
I
I
With the AM system, you can set your RouterOS to use a Rad ius server to
allow users to login. With this, you can have a centra lized rad ius system for
router management. The users that you have in the radius system can
access your routers and make changes, but you are not giving out the default
Admin passwords to your engineers and techs. This will help you in a large
scale deployment of RouterOS . One thing to keep in mind when you do this,
you typically will need to create a local group, that allows everything but the
Policy function, that way other users that login via Rad ius cannot change the
users locally in the router.
74
RouterOS Services
RouterOS has a number of services that it runs right out of the box. These
services allow remote
IP Service II
access.
and
management to your
J Y
tJ~
Port
router. Some of these
"Of"
include your WinBox
f30 ftp
21 0.000/0
C ssh
22 O.OOOill
and WebBox access.
L
C telnet
C mrbox
C www
23 0 0 0.0/ 0
8251 00 00/0
80 0000/0
By going to IP -7
..
..
Services. you will be
able to turn on and off
these services as well as
change ports, and change from what IPs they are available from. Each one
of these objects can be turned off or on, by disabling or enabling. By doubleclicking on one, you will get the individual item context window. This will
give you options to select what port you wish it to run on. By default these
ports are setup to the most common port numbers.
You also have the ability to setup
the
Available
from
field.
This
NilIl1e: lt~
I
OK
field allows you to restrict access
Port:
Cancel I
to the selected service down to
an IP or a subnet range. If you
I ~
to
only
allow
wished
~ ]
192.168.0.0/16 IPs to access your
FTP server. you would enter
192.168.0.0/16 into the Available
from
field.
A
good
recommendation though is to disable any unused services. I have found that
on larger networks. there are multiple, non-sequential IP ranges for
management, thus, I typically will use my Firew all to restrict access by admin
ranges.
. IP Service < ftp>. _
I
I
- -- - - - - - - -
API Service
RouterOS offers an Application Programming Interface. This interface allows
you to create custom applications to program your routers. This service is
turned off by default, but just like the rest of the services, you can change
the default port from 8728 to another port, and change the Availability IP or
IPrange.
76
m Filet isl
J
r
lIem
B ~ T'!<c9'lill~!lJ:li:4 S 1.ba<?<up
j See
:T)'Pe
b. ." "-I'
,
Tme
.i Cre;Jbon
_._----
.-
9.61<iE
...........
-r.i ...
-Janl OM 97004--51:35
- --:
_.~
,...
<
-,.
54%lree
77
','.'
Below, you can see that we have uploaded an .npk file. This is a MikroTik
Package file that allows your RouterOS to either install or upgrade the OS or
packages. You can simply drag and drop it from your file system right into
the file list window.
,',
,-
, .... c.,,. ..
,, ............
23 r
'
"
r:::J
9
r;;;;;:l fi1
L=~J 1.~~J L~J~J
File Name
.. MikroTi<-0401 197D-0451.backup
8 roulero.-mipsbe-1 19npk
Size
The backup file that we created by clicking the backup button, we can now
simply, click and drag onto our desktop or file folder. It will then download
from RouterOS.
Something to note about downloading and uploading files in RouterOS
through Win Box, you will typically need an IP or layer 3 connection.
Sometimes the Layer2 connection can be a bit flaky, and unreliable. I have
seen where it will stall, stop and hang on some computers. I would
recommend putting an IP on your Router, then connecting with the IP
address through Win Box and then upload your files.
78
Backup / Restore
In the File List window, you also have backup and restore opt ions. Backing
up RouterOS is simple as clicking the backup button. When you click the
backup button, you w ill see that there is a .backup file created . This is your
backup file for your RouterOS. Restoring t his fil e is as simple as uploading
the file, selecting the fi le and cl icking on rest ore.
There are a few things that you should know about backups t hat I wou ld like
to share. The .backup files are the best way to do backups in general. They
w ill restore on the same hardware platform without issues, however, if you
have an older platform, and the chances of you replacing that older platform
with a newer one in the event of a failure is high, and then I would suggest
also making a text backup. The .backup files are not edit able, they are a
binary file that is proprietary to RouterOS, so you can't see in side them,
view configuration etc. If you have a unit that you wish to make a change
to, you can create a backup file and make the change. Reverting is simple as
uploading the file and doing the restore.
[ a drr. i n @ L~ a : nRou ~ e rC S l
Once you export the file, you can go to the file listing, and see that there is
an export.rsc.
. . EJ
~ort~~
..
script
11.6 Kl B
---- - - - - - --
Now you can take this file, just like a backup file or other files, and download
it in Win Box. If you open this file, in any text editor, you will see
/interface bridge
add admin-mac=OO:OO:OO:OO:OO:OO ageing-time=5m arp=enabled automac=yes \
comment= "" disabled=no
forward-delay=15s
max-message-age=20s
mtu=1500 \
name=bridge1 priority=Ox8000 protocol-mode=stp transmit-hold-count=6
/interface ethernet
set 0 arp=enabled euto-neqottetioneves comment= "" disabled=no fullduplex = yes \
mac-address=00:OC:42:32:22:17
mtu=1500
name=ether1
speed= 1 OOMbps
set 1 arp=enabled euto-neqotietioneves bandwidth=unlimited/unlimited
comment=\
"" disabled=no full-duplex=yes mac-address=00:OC:42:32:22: 18 masterport=\
none mtu=1500 name=ether2 speed=100Mbps
set 2 arp=enabled euto-neqotistioneves bandwidth=unlimited/unlim ited
comment=\
'''' disabled=no full-duplex> yes mac-address=00:OC:42: 32: 22:19 masterport=\
none mtu=1500 name=ether3 speed=100Mbps
/interface vlan
add arp=enabled comment="" disabled=no interface=ether2 mtu=1500
name=\
vlan100.2 vlan-id=100
add arp=enabled comment= "" disabled=no interface=ether3 mtu=1500
name= \
vlanlOO.3 vlan-id=100
/interface wireless security-profiles
set default authentication-types = "" eap-methods=passthrough groupciphers n n \
group-key-update=5m interim-update=Os mode-none name=default \
radius-eap-accounting=no radius-mac-accounting=no \
radius-mac-authentication=no radius-mac-caching=disabled \
radius-mac-format=XX: XX: XX:XX: XX: XX radius-mac-mode=as-username \
static-algo-O=none static-algo-1 =none static-algo-2=none static-algo-3= \
none static-key-O= "" stetic-key-L = "" static-key-2= n n static-key-3= n n \
80
"
I
"
I
I
Importing Scripts
Once you get real good at reading and doing command-line interfaces, you
can start creating scripts, or RSC files that you can bring right into RouterOS.
You will need to create this file,
and of course test and test
[ ~an: n @Le ar nRo u t e ~:: ] > impor~ e xpo r~
Opening 3c ript :ile expo :c. r sc
again. Once you have it just the
way you want it, then go ahead
Scr1pt f i le l oaded and e&ecuted eucceeefully
and upload the file. Of course
you can simply paste it right into
the terminal window, but you can
also import the file in the command line. To use this feature, you simply
type import filename. You will need to be at the root in the command line
interface for this to work.
II
I
.I
\
\
,~
81
-----
--- -
Just like with other Routing systems, you have logging capabilities. You will
use this to review access to the router, changes and even show packets that
you may be dropping or changing.
We also have options to send your
logging data out to a Syslog server, like the one contained in M ikrotik's The
Dude Application, or other standardized Syslog servers.
Debugging
information also can help you diagnose issues, such as Rad ius, and hotspot.
To access your log in WinBox, simply cl ick Log on the left menu.
oJ
Jarl/01/1S70 oo.cxn6
JanItl 11970 0000 18
Jo.,/01/1970 00 00.18
J.ov'01/1970 00 0021
JonI0 1i1970 0009 11
JanItl1/197000.0924
JanItl 1!1970 00.09~
JanItl 11 1970 0009.:l4
JanItl1/1970000937
JanItl1/1970 001)9 42
"""10 1/197001 :3829
JanItl1/1970 01.522'5
JanItl1!197001 53 12
JanItl1/1970 O2OBID
Jan/04 /197001.2'5il1
"...,104/1970 0125ffi
Jan104/1970 05:1616
JanI04/1970 23il742
JanI04/1970 230751
JanI04 /1970231Oil1
JanI04/19702331:30
JanI04I1970 2331 .30
Jan/04/1970 23.3614
JonI04II970233614
JanItl4/1970 2339 42
Jan/04/1970 2341 19
S'f'lem rio
ct'oCll rio del>...g
S'f'lem rio acco<rt
S'f'lem rio
I)"lemrio
syslem rio
S'f'lem rio
I)"lem rio
S'f'lem rio
S'f'lem rio
S'f'lem rio acco<rt
S'f'lem rio ace.....
S'f'lem rio acc:oo.rt
system rio acco<rt
I)"lem rio
I)"lem rio acc:oo.rt
'YSlem rio llCCOIrIl
I)"lem rio
S'f'lem rio acco<rt
'YSlem rio accon
S'f'l.... rio lI<:CO<nl
S'f'lem rio acco<rt
l)1Iomriooccon
S'f'lem rio
sy>tem rio occounl
changed
~ ...
d<Mcechangedbyadmn
d<Mce eMlilled by "d"e ,
bndge port chonged by
bndge port chan\Ied by ocnn
bndge port chan\Ied by
u:leffad' added by' admn
user 0Q'lWl1ogged n from 172.25.0.39 via .sh
U:ler 0Q'lWl1ogged "'" from 172 250.39"'. soh
"'*'*'
"'*'*'
In the log, you have the date/time, as well as what system generated the log
and the actual event information.
82
\J
,
,,
I
I!
\,
I
I
II
r-rr
,
i
I
I
I
II
I
I
I
.....!
,
I
,I
I'
I
I
I
i
,I
,
I
I
L.__
Under your Logging Rules, you have objects that you can add, remove,
disable and enable just like any other object in RouterOS. The default
logging options are listed above. This is what your RouterOS system will
come with on a fresh load. I would think that these are the minimum that I
would have on a Router. The ones that I would use normally are Radius and
hotspot logging.
Configuring IP Addresses
We are dealing with a Router right? Well then we w ill need some IP
addresses to go on our Router. Now, we are not going to get into talking
about sub netting and TCP/IP right here in this book, but we are going to at
least get you on the Internet with some basic IP information .
We are going to start by configuring
an IP address. To access your list of
IP addresses, you will click on IP -7
Addresses (imagine that). You w ill
add IP Addresses to RouterOS just
like any other object list in WinBox.
Click the plus sign and you will be on
your w ay. To configure your IPs,
you will need three pieces of
information. One is the IP Address
itself. The second is the subnet
mask and the th ird is what int erf ace
New Address
Address:
~68 200.1/24.. H;
I
Broadcast: I
lnIecface Ietherl
NetWOlic
_ l ..
I.. .
Ji + j
I
I
I Cancel I
I ~pIy I
OK
Disable
I Comment
I Copy I
1 Panove I
Address <192.168.200.1/24>
I...
Broadcast: 1192.168.200.255 I...
Network : [192.168.200.0
Interrace: lether1
84
I[!]
I
I
Common IP Information
I wanted to do a quick review, as in this book you will see that I refer to
private IPs and public IPs. If you know what they are, then you are doing
well, but if you don't, here is what you need to know.
IP addresses basically start from 0.0.0.0 and go through 255.255.255.255.
That's a lot of IP addresses. However, there are blocks of IP addresses that
will never be used on the Internet as a whole. These blocks are used for
different things, including private IP space. The lANA Reserved Private
Network ranges are as follows:
24 bit Block or a /8 Prefix
10.0.0.0 through 10.255.255.255 -16, 777,216 Total IPs
20 bit Block or a /12 Prefix
172.16.0.0 through 172.31.255.255 - 1,048,576 Total IPs
16 bit Block or a /16 Prefix
192.168.0.0 through 192.168.255.255 - 65,536 Total IPs
These blocks are set aside just for private network use. The most common
block is the /16 of 192.168.0.0. This entire block is very common in home
routers. You can use these blocks on your internal network, or private
network, without fear of them being used on the Internet.
Default Routes
A default route catches all traffic that the router does not have a route for,
and tells the router that this is the gateway of last resort. To put it another
way, unless otherwise specified, the router will use this " default " gateway.
RouterOS uses a default destination-address of 0.0.0.0/0 for its default
gateway. To setup your default route, you will need to set this gateway. To
access your Routing-Table, you will click on IP -7 Routes, again very straight
forward. This will give you access to the routing table, and allow you to click
the plus sign and create a new route .
New Route
General
IMnbutes
Destination : 1t
t t
Ie
--'1 ~
Above, you will see the destination of all zeros, or 0.0.0.0/0. This means all
networks with any subnet mask. What we call a default route . You will need
to enter the default gateway address for your network under the gateway
setting.
86
, DN5
Static
Cache
Settings
Name
IJ
o corerooter.corn
Address
192168111
TTL [s]
1d 00:
Once yo u get int o your DNS system, yo u will click t he Set tings button to
setup your upstream DNS servers .
1"4-222----
I
I
I I Cancel I
I
I
OK
~pIy
1~51=2====:::::;_---'I
12048 _
] Ki B
Cache Used : 1
7
'-':==-==-1
Cache Size:
Note above, we have both primary and secondary DNS server that we can
enter. Also, more importantly, is a check box to Allow Remote Requests.
This check box will make your RouterOS act and respond to remote DNS
services. If you don't check this box, the DNS settings here w ill be strictly for
your RouterOS services and usages, vs. other customers or clients.
DHCP-Client
Sometimes, your Internet provider w ill allow you to obta in all of your IP
settings automatically via DHCP or Dynamic Host Configuration Protocol.
RouterOS has both a DHCP-Server and Client built in and will allow you to get
the configuration that is necessary from your network or provider with ease.
DHCP-Client will obtain not only your IP address, but your subnet mask, your
DNS settings, NTP Server, and your default route. This makes it very easy to
configure hosts quickly on a network. Most businesses will use th is to issue
IPs out to clients that don't need to have a static IP address.
To access the DHCP-Client system, you will need to click on IP -7 DHCPClient.
88
+--
a:le
e<f~
ether l
1
-_._._-
IP~s
~-
--T&pres I"'i
...ter
192 168.11
. - - .. .1
, Status
1545:48 bol6ld
DHCP
OHCP
C1i~nt
Stat<n
Irteriace:
Ho$\name:
-,
Client 10:
" ] ....
to
Note that on the top menu bar of our RouterOS it em list, we also have two
extra buttons, One is a release and one is for renewing IPs. You w ill select
the DHCP-Client under your item
list that you w ish to use, and
o ~ Status
or
renew
then
you
can
re
lease
IP Address 19216811 171/24
an IP address as you wish by
using these buttons.
DHCP Server: 1.=92: :.1::6::,
8 ::11:,:1= = = -=
r
,l..-
Pnmary NTP [
---
. OHCP Server
OHCP Networi<.
i~
OHCP
~!.'!~_~~
Corf~ "'--1:=0=.0=-~
=;===-I
.:::r~~_
Ilea.., n=-rne-
If-ddtess Pool
~d AR X"
To access the DHCP-Server menu, you will click IP -7 DHCP-Server. DHCPServers are not complicated to setup, but there are a number of functions
and pieces of information that must be obtained and setup for them to
work. Due to this fact, RouterOS has created a wonderful DHCP Setup
button that we can use to quickly setup a DHCP-Server based on an
interface. I do recommend that you go ahead and setup your IP address on
the interface that you are going to put the DHCP-Server on . Th is w ill add
that range and subnet to the DHCP Server setup wizard.
90
8<>0
'
Next
I! CalceI
-----
Back
Next
I[ Can::!J
...
'I
If you are running a business network you may need to have some IPs that
are statically assigned. I typically will use 2 through 50 for static items, such
as printers, servers etc. You can set this up however you wish. Also, if I
know I will not have more than 100 dynamic devices on the network at once,
I will set this to something like 100-200 as the range.
II
92
- -----
DHCP SolVer
DHCP Nalwofl<. I.e",. Oi:tlons AIe<t.
J V
d><:pl
DHC PCon/ig
r~,
OHCP Setup
,Relay
~3
Lea.. T_
:hldress Pool
3d OOJlO:OO d><:p...POoil
,,Idd
..:.~~
AR .
no
Once this w izard is completed your DHCP Server should be working. One
reason it might show up red, is that you placed it on an int erf ace that is part
of a bridge group, or the interface is not running. Double-clicking on the
DHCP Server object will allow you to change the interface settings, as well as
Lease time and what pool of IP addresses it will use. You also have options
here to select to add ARPs for the leases that you have, as well as the ability
to use Radius .
* -. - _...
en ace . Iether 3
I
-- - Cancel I
... ,----,--I
OK
-,'-
Relay' L
Pool:
[6,;;;:;Jwoi,'"
Src. Mdress: [
_
Bootp SLpport
Add ARP For Leases
AJwa'f' Broadcast
Use
IUS
r C\~bi~' 1
- [ copy l
..
Delay T1Yeshoid 1
-J
Remove
rJB [9 [!]
,,,
,, ;="c,
.><1.
Add.....
11921682lXf0124
Gat"",~. _._
192.168.200.1
,.
,ONS
Sev...
----
....
4222
~e:::.:t.
---
GIll""ay' 192.168200.1
,.....
Netma.lc
, ...
"-.::::;==~'i
r--:-
DNS Servers: L
4222
DNS Domain : L
...
J....
WI NS Servers [ I ~
NTP Selvers: ,1 e
.....
OHCP~ :
.
---_
...
The DHCP Setup Wizard does quite a few things, real quick, let's review them
here.
:r
:r
94
~
~
' IP Pool
Pools
Used ~
LflB [!]
~
Name
.. - ~~ J'.f"OIl
~,
...
Addresseo
192.168
_... .. _... ........ ........ ,.......
.- ...... '".- .- 200.2-192.168.200254
~,
96
........ _
.......
_.
~ ... :,
""',,"
"
__ _ _ .J
"-~'."
---'
]
Addresses :
[ 1 92. 1 68:200.2~~1 ~
Next Pool:
Inone _ ![!]
1
1,
!,
,
,
\
\
I
,
,
I
I
:
I
I
\I
I
j
I
\
I
I
I
- - - --
-- --
- -
Configuration
Masquerading
of
basic
IP
JIddresses
RoLtJng
Routes
Ports
Pool
ARP
To start, you will need to access the NAT
FrewaD
section of Router05. This is located
under your IP Firewall system. Click IP
~ Firewall, and then under the firewall
options, you will need to click the NAT Tab. This is pictured to the right and
below.
We are going to need to create a basic Masquerade. We will assume our
98
- -
_.--- - - - - -
General
Advanced
Extra
Action
StatistICS
'0
O1ain : ~
srcnat
-_._-_._-
r
OstAdd
.
ress : rI
.....
~ '"'
_ __
Src . Address :
.-
..
l ....
.,I
...
1 '"'
In. Interlace: [
___
01..1 . Interrace:
'"'
IJ'
.........J
, w ..
'"
""
"
: i ....
J i- ...
I
'"'
Connection Mark: I~=---=~l '"'
r - .
RoutIng Mark: l...... .....
_-_._.- -Packet Mark:
,._.~-----
i ....
j "-
,'''lvMlCed
Extra
ActIOn
Connection Twe :
Statistics
99
- - ------ - -- - -- -
100
Our Goal
o To allow several computers on a private network, to gain
access to the Internet through a single Internet
connection .
What We Know
o DHCP Internet connection
o Several computers for our home network
o Internet Connection is on Etherl
o Private computers will be on Ether2
Features we will need to use
o DHCP-Client
To get the IP information from our Internet
provider
o DHCP-Server
To assign private addresses to our computers
Network:
Broadcast:
] ...
L -===~] ...
[!]
Interface : [ether2
Step 3:
Setup DHCP-Client on
Ether1. Click IP -7 DHCP-Client -7
Plus Sign. Select interface ether1.
We will use all of the peer
information as well as the default
route from our provider, so leave
these checked.
oHCP
IStatus
-Ti
l
-~ ~ ~
Intetface.
- -----,J ,.,-----J...
Hostnarne: !,
Oient 10
:;;;1
Use Peer ON S
.,
' "''
'
...
... ~ .......J
101
,
FdIer fUes
1r"l
+18
el,~
M.i~ss Lsts
le)1"f1 Faoc:cis
Cil
T
:':-' """, :0" ... 1.., Re>etlole-",, ]
'
,
.
,
,.
[-1
,
:r::~q~:::~::::~~.=:l~::~.~~. . :,. :=~:.=~ : .=:::=:::=~:~:: ~~: :~~::.:::l.~. :.~~.::. .~ ,~:.:.~~::::.~I::~:::~~~::~:~'~~~~~~::Q:::n~~:[
"
'
r.
1101
.. .
'
Once this is done, you can now plug a computer or device into ether2, obtain
an IP address, and then browse the Internet.
102
II
!
I
1
i
1
I
i
Ii,
103
I
Il--_
104
Bridged Client
To create a bridge client, the proper way is to use WDS. You will have to
configure your access point for WDS. This is done simply by adding the WDS
mode and default bridge to your wireless access point. See the Bridged
Access Point Configuration section. Once this is done then you can configure
your CPE, otherwise it will not work.
First, create your bridge group on your client system. Add both the Ethernet
and t he wireless interface to the bri dge group. Even th ough adding t he
wireless client is not typically necessary, I do anyways. Next, configure your
wireless interface for a mode of station-wds. This mode will form a station
relationship along with WDS to your access point. Setup the proper SSID or
scan for the proper SSID, you may have to configure your security profile to
be the same as your access point in order for the unit to register to the AP.
You will also need to configure the WDS settings; I would recommend
dynamic WDS along with adding the bridge group you first created as the
default WDS bridge group.
Once you create this and your CPE associates, you should see a WDS
interface with the MAC of your CPE on your access point. Also, in the bridge
group you should see a WDS interface dynamically created on your CPE as
well. This will bridge the Ethernet and the wireless interface by providing a
true bridge
- -- -- - - - - -- - - - -- -
106
l
I
,
II
)
I
1
,I
I
,
,'
I,
,
,I
,
I,
1
,
J
I,
I
,\
\,
,
107
IP Features
MikroTik RouterOS is of course, a Router! Let's get into the basic routing
functions of RouterOS! First off, I like to spend a moment to answer a
common question I get all of the time. When I bridge, putting IP addresses
are easy and things work, why should I route? Let me answer this question
with two comments. One, bridging and IP addressing are very easy to
manage, and run. However, it is not a matter of if it will fail, just a matter of
when it will fail. Second, my company motto is, "Friends don't let Friends
Bridge Networks!"
With that said, what are the technical reasons you should route? The
Internet is routed for a reason. Failures cause topology changes, and just
like the Internet you should have routed traffic be able to fail over to other
connections and links to make them redundant. Bridging will allow some
redundancy, however, typically at the expense of turning OFF links.
Preventing a bridging loop ends up disabling ports, entre links are wasted.
With routing you can have some traffic, go over a primary connection, and
other traffic go over another, so you actually use the hardware that you
have.
I also like to keep traffic that should be local, well local. Every device on my
entire network, from core routers, etc. doesn't need to know about 500
devices on the network. ARP entries should be limited to just what is
needed to communicate. This also has another benefit, and that is to be
able to handle ARP and Broadcast storms. You are limiting the size of your
broadcast domain. Due to this, you also limit the effects of these types of
108
ARP: Ienab1e.d
99.99% of the time, enabled is perfectly fine. This is the default optien,
which will reply to ARP requests. So, if a device is looking for an IP that your
RouterOS has on its interface, this router will reply to that device saying it is
responsible for that IP. Also, if it does not know of a MAC of an IP, it will
send an ARP request out to find the MAC for an IP.
So what are the uses for the other modes? Some administrators will use the
ARP Disabled mode as a form of security. With this in the disabled mode,
you will not send out ARP requests, or reply to it. Because of this, you will
have to add ARP entries in your ARP list manually. On the other device, you
will have to do this as well. This requires manual ARP entries on both
devices, but works quite well.
- --
---
110
entry in this unit. That means this was a dynamically created entry. We get
dynamic entries by your MikroTik sends out ARP requests and receive the
reply from the device.
...... -- ---
"
MikroTik also gives you tools such as Ping, MAC Ping, etc, to help you with
ensuring that your static entries are correct. Another feature that you
should be aware of is the Make Static option. This option will let you select a
dynamic ARP entry, and easily convert it to a static entry.
Static Routing
RouterOS offers a very simple interface for creating static routes. To access
the Routing interface, simply
click IP -7 Routes.
,
. ' Ro ute List
RoUes
"Ues
+
lle>Uwilon
AS
I> OO.O.(Y()
DAC I> 1 1 1 OI2l
--
'f
Gate.."Y
1.112501
II
Ostance
Ro<tng 101'""
"
Prot . Sou1:e
1 I 11
The IP Routes list will show all of your Routes that you have. The
first column is very important. This column shows the status of
each of your routes.
..AS
.. ..
, --~
AS
OAC
=
=
=
=
=
S Static Route
A Active Route
C Connected Route
o OSPF Route
X Disabled Route
AS
S
OAo
XS
,AS
100
r RIP Route
b = BGP Route
There are also items that are blue in color. Blue items are routes that are
valid, but are not active. This typically means there is a static route that is
taking priority, or another route that has a lower cost. It also could mean
that the gateway check has failed; therefore the route is inactive due to not
being able to get to the gateway.
There are a few types of routes that
Destination
I Gateway
I wish to cover a bit more as well.
DAS
OO.O.ll/t}
172.25.0.1
DAS routes are always interesting.
1 72 .25.0.012""4~......._ _.....
DAC
How can it be a dynamic active
static route?
This statement
contradicts itself. The reason for
this is that this is a route that was received via the DHCP-Client system.
There are also DAC routes. These are dynamically active connected routes.
This basically says th is subnet is directly connected to the router. It is added
dynamically due to adding an IP to the router, and as long as the int erface is
up and running, it will be active!
............_
_ _
_ _
. _ _ . _
_ . _ _
112
. .....
- --
.H
j
"
I
I
I
I
I\
I
,,
I
L
1
,,
\
I
\,
I
I,
1
,
i
I
I
\
I
---------
======-=-' . .
Checking Gateways
Check Gateway give you the ability to verify that the gateway is available. It
has two options, ping or ARP. If the router does not have an ARP for the
gateway, it will consider it unavailable. This makes the route turn Blue, it
would be active, but in this case, the gateway in not on-line or otherwise
unavailable. In most cases you would use the ping option, as this pings the
gateway watching for it not to respond. However, if you have a router or
gateway that does not respond to pings, you can use the ARP entry.
114
.. .. _-
--
Using Distances
The distance is also usefu l to us. Th is is the distance that your stat ic route
has, or its cost. If you use an examp le of two different Internet connections,
and one has a distance of 2 and one has a distance of 1, the route with a
distance of 1 will be preferred over the route with a distance of 2. Simple
right, the one with the. lower distance is preferred. The route w ith the
higher distance will be blue. It is a va lid route, but there is another route
that is preferred, just due to its lower distance.
Rou\~
<OD.O.OIlJ >
......
116
..
---_ .. _ - - - - - - -
So the th ings you need are: Traffic Ident ificat ion, another routing table, and
a policy.
Routing Policies
There are two ways to identi fy your traffic; one is doing routing marks under
the mangle system . The second is to directly identify the traffic under your
routing policies. To access your routing policies, or more commonly called
routing rules, click on IP -7 Routes -7 Rules tab. This is your routing rules
section.
Rot...
RUes
L+ 1 J
l;,1
] c"l: 7
lse. A:klress
IOst. ~'-S
Under your routing rules, you can create rules that identi fy traffic directly.
Typically, I will use a Source address. I identify the traffic by specifying this
address, but you can also use a routing mark. Remember, these are rules,
and any ru les in RouterOS are processed from
the top down in ordered fash ion . Also, the
, New Policy Routin g Rule
rule is attempting to match traffic. If you
....
Src. Address : 192.168.525
specify both a source address and a routing
....
Dst. klcress :
mark, both will have to match for it to work.
Under the action section, we are going to
do a lookup, but you can also drop or make
that traffic unreachable. The lookup action
simply says use the listed table to find the
proper routing.
- ._ ... _ -- - - - - - - -- -
ntedace:
---
T.obIe : el teble
1 ....
..J
].!
_
.,
..., _-,
EJ
'
~Attribut""
r--~------
[9 9 ~ ()(lJ
De_n
..
Gateway :1??~lJ1
Gateway Wedace : ["
Wedace:
01e<:k Gateway:
Type :
..
..
..j;
L
[
~
..,
]
r~~;;
.. ..
~
Dstance: r
Scope:
T~et Scope :
[~"""""""
[;0=
.J
_.: ...
EJ
!...
".
. . .1
"1
" """_..
.
'
. . . .. .
. ....
; ...
:F :
"ll,i"',
. ......""""'-
Rout es Rules .
Above we see this rule added, note, that we click on the right drop down and
selected just the alt_table. This allows us to only see the alt_table rules.
Sometimes you may get this item as a blue entry. The reason for this is that
you may not have a routing policy defined yet for that table. In this case, we
created one before we added our new route, so it becomes active right
away.
118
.,.
$>
'.' Rout.Ust
Roul es ' Ruleo
,+....:::'
L:cJ':::;' f
'"v'
I
'l
r'
I Destination
.....,
f"'] l
L:J
'VI'
I' '
f-l~~.....~
iDAS 1- 0 0 0 0/0
:OPe I- 1722500/24
IDPe I- 192 1682000..
I
1722
5,0.1
--- ---- -- --172 25,0,1
Roul"ll Mori<
tlislance
1 .kJobie
a
o
o
etber l
hodge 1
...
I Pre! Soutce_
.i-
.J ....,
.... -I
.
17225.050
1921682001
In the above list, note that we have two default routes! This is possible, due
to the fact that the first one has a routing mark that we are using to move it
to another routing table.
- .. rUh'fillll
"+,, r;J II Fl yl
---
::
---
J.cttO"l
._.- . _ - _ . _ .__. _ .
Ch6I'
,;c........ ';,i.....__ ..
~ .kd"e_
--_.-.-
._.
; ~ ~. PCIt
F~ets
'"
119
- --
Your mangle system is very powerful. You can use any of the ways you wish
to identify traffic here. These are rules, and just like any rule, remember
they are processed in order. Once the packet has been matched, it mayor
may not continue to process
other rules. In our case,
once we match it, we will
typically
stop
the
processing by specifying a
Dot I\ddreoo :
routing mark.
Lf
Protocol : ,
Src, FC<!
().; Port
---'
...
===========;j ...
i
i...""
..,."",,]
'"
;",.." ..,
.., .., ..
,
1
:='
-...I ...
hw. Port ;
.
,..
.~:===-::=.-==~
n. h eri"",,: ~:===::--===~
P2P :
Packet Marlc
Comec!ion Marl, :
...
!"l_~_..
ir
__
_.._
_..__.._
..
..
1....
Rouing Mall< : ~
--..J
...
Aclloo
.'
,----,--- --~"' 71
..__ .-"---',
120
.....
_... _ . _- - - - - -
Firewall Features
--" -
"'
'''
'"
,,,.
Router05 has a full featured Firewall. The Firewall will allow you to permit
or deny different types of traffic, based on a set of rules. It is used to not
only prevent unauthorized access to your router, and your network, but also
can be used to prevent unwanted or unnecessary data from flowing around
in your network.
Traffic Identification
First off, I love dealing with Firewalls. I spend more time working on firewall
rules, management and coming up with creative ways to get to the desired
result. If I had one thing to say about firewalling, it is Traffic Identification.
Just like with many other features, your firewall deals with traffic coming to,
from and through your router! There are all kinds of traffic and being able to
identify the traffic you want is sometimes the hardest part. Think of picking
out that nice red sedan that you want, out of 20,000 cars as they go down a
10 lane highway! This becomes hard to watch for, and you have to know
how to identify it. This is ever harder when the bulk of the cars are red!
So first, let's talk a bit more about traffic identification. You can identify
traffic in a number of ways. With Router05 you can use your firewall to
identify traffic by what interface it either arrives or leaves on. This is a very
broad approach.
TCP/IP as you know has a number of protocols. The most common one will
be TCP and UDP, but there are others commonly used, such as GRE and
ICMP. If we identify traffic by protocol, now we know what highway they
are coming and going on. This again, is still quite broad. So we go deeper,
and look at what port they are using. Both TCP and UDP have 65,000+ ports
each, so figure you have 65,000+ lanes to each highway. That is a huge
amount of lanes to watch, so we need to further narrow it down further.
Sometimes we have flags to help us. Between all of these highways in and
out, each protocol, and then each port or lane, we have narrowed the traffic
down quite a bit. But what happens if we have a flag. If we have a flag with
a number on it, that's what D5CP or T05 bits do for us. So now we can
121
- - -- -
-- -
- -- --- -- -- - -
122
:. Established _
Established _
Established :_
-: Established
This is important to understand with the RouterOS firewall as it gives you the
ability to understand how connections are created . Invalid connections are
typically hacker attempts! Also, instead of processing on every packet that
passes through your router, you can process on the new connection states
only. If you never let the connection become established, then there will be
no further data. If you did let it become established, why process rules on
these packets? You allowed the connection state to become established. If
you did not want the connection, why allow the new connection state
packets? In regards to the related connections, again, you allowed the
original connection, why do you need to do anything but allow your related
connections?
Do you want some good suggestions about connections states? First, drop
your invalid connections, as typically they are hack attempts. Process your
rules based on new connection states, and allow your related and
established connections. This will minimize the amount of CPU usage that
you use, as well as still accomplish the firewalling features that you need.
123
- . ._- ._
- - - - -
Bri dge
~d;;-........ -r ,
............
D..c1d
Dst-NAT
...
~UT i~
:.I
8ndge
Pr e routi ng
.. .. I
,,
,
-~~?1
INPUT
INTE FFACE
art dqe
FOI1HClrd
,.. _.. ..
Input
Fo rward
-. --"' ......
. . ....
I
"l
_ .....-R.,utinOJ
t". ......
~<~
1"'<"('
>, ~ - l ,
<~~
Inp ut
-~~ o l k-(
,>
...;,-
Local
~
Mange
De stinati on
NAT
.f
Globet.ln
Queue
-.1.-
124
8n dge
Out p ut
Bndge
\ I ,,
1+
Src-N A1
-1
~-;----......,"
Int erfa ce
Qucuo
-I
".~,:;...-
Mo"gl e
p ro C.,.<O-OLIt
Pret cutm q
Conn'Irack
Output
Postfoutlng
-c, ~""<:Kion..-'>
po,tro udn gl
pro ce s s.m
HotS p:J t
Input
_ _Il:ri ~d
LOCAl
--
Ou ,Pu~~..............~_
.~
lfllOc,,;
. . .. .......
Ol~lJT
l'lTER- FACE
--
=t.. .
Globa l Out
Oi .e ue
Glob;ll!Total
QL..eu e
-*SO
JU
.-
'AT
Glob al-Ict a l
He- Sp ot
Queue
o ct pot
0 - 00 - 0
Outp ut
Fo rwa rd
CcnnTrac:k
r>4 anyle
l
Ma n g le
Filt er
Fi~er
M3'1gle
[I
tro ut
Acc ounting
' ,;VCW
"""
'WP
Ater
-,
V'
I1
II
:,
Chains
Befo re we start working w ith t he firewa ll, we need to discuss chains.
RouterOS uses chains for segmenting the different types of traffic that your
router has. There are three built-in cha ins; these are cha ins that are always
present in any RouterOS system. You ca n also create new cha ins for
manageability as well. All of your rules under each cha in are processed in
order!
RouterOS also makes it easy to manage these
chains by providing a drop-down box in the
right side of the firewall filter rules. With this,
you can manage each portion of your
RouterOS firewall simpler by grouping rules
into chains, and then calling those chains from
the built-in chains.
dynamic
forward
hackertraos
input
output
static
traphackers
Input Chain
Output Chain
The output chain is for data that is generated from the router. Things such
as pings from the router, and ping replies from the router. Creating tunnels,
using the web proxy system, and other outbound connections would be
controlled here.
Forward Chain
- --- - - - --
Other Chains
Just because you have the three chains, does not mean you can't add more.
You can create chains with any name you wish, just simply by changing the
name of the chain under each rule. You will need to jump to these chains to
be able to use them from one of the built in chains.
The main purpose of these other chains, is to allow you to name cha ins, and
jump to them from the main built-in chains. This gives you the ability to
provide rules based off another rule. For example, you can setup your
forward chain to say if the packets are destined for your web server IP
address, to send them to a chain called, web_server. Then under the
web_server chain, you can apply all of the firewalling that you wish to as
needed. This allows you to have a completely different set of firew all ru les
for one individuallP address vs. all of the other forward ing ru les.
Also, though mentioned at the beginning of the session, you can also help
manageability of your firewall by grouping functions of your firewall into
chains, and then calling on those chains from the built-in chains.
Jumping to Chains
By default, you have your three built-in chains, input, output and forward.
For organization and other reasons, you build other chains that you create
names for. For you to use these chains, you have to jump to them from one
of the built in chains. Remember, all data flows through the three built-in
chains based on the type of traffic. For you to jump to another chain that
you created, let's say your web_server chain, you will have to create a rule
with a jump action under your built-in chains.
126
General
Advanced
Oie
: ;fOlWalti
,
Src. AdcRss :
DsL Ioddress :
= 5.55.5
So, we will assume that you have a web_server with a public IP address
being routed through your RouterOS system. This web server's IP address
will be 5.5.5.5 in our case. Since we are routing through our router, we will
need to apply firewall rules in the forward chain, or jump from the forward
chain to our web_server chain. Since we only want to send data that is going
to our web server to the web_server chain, we will apply a new rule that
matches only the web server data, and then say jump to our web_server
chain.
General
Advanced
I
ktion : -junp
Jump Target :
EJdra
Action
Statistics
--
ebserver_chainl
-'--
-+
We have created a rule, and told it to jump to our web_server chain. Note
that we have added the Dst-address field as our web server IP address. This
is so that the only data that
will jump to this chain is data that is going to our
web server IP address. We then go into our action tab, and tell the system
to jump to another chain.
Now, inside the webserver- chain we can create other rules, and since we
have only brought traffic that is destined for the 5.5.5.5 IP address into the
webserver_chain, we don't have to specify that information again. In this
rule, we say that if they are using Tep port 80, HTIP traffic, we will apply a
rule called accept. This action will accept or allow the packet. Once the
Genenli Advanced
Cha.
s.c.!IdcXess:
Ost AdcteS$:
ExInl k:tJon
StIltlstICO
1~:et>setV~~~.
,
.
.
-..J! ...
~':=-:========~
I
IL.....
O~~=~=p=)==-_-==::
Prolo<X>l :
Src. P<>tt : [
Osl. Port
J...
j ..
O@
,".
128
._.
.. _ - - - --
Fi
~ RUes
NAT
+[:::1 '"j[
Narr:-e
M&"lCle ~~ PM:!;
[c' Ii
~.-
"'1M~~
.. _.... __ ................_..
.[ -
... .
...) .:~. ,:
You can add many entries in the address list as well as have many different
lists. You can also have RouterOS create Dynamic Address lists. These lists
are created when a firewall rule is matched. Once matched, they are added
to the address list of your
choosing for a specified time.
An example of using this
Mion. ! ,;;jd ;;:'; t~ ~~~ i;,t
-l!J
r
feature is to have an address
." ddress us!, !LJs;"g~?P
.............j.~"
,
-1
list dynamically get created as
TimeO\..t: .02JJO:OO
...
t.... .
,
"."
~.1
users use Peer to Peer
applications.
This then will
create
an
address
list
dynamically giving you the list of users that are using Peer to Peer
applications. The timeout value in your firewall rule will determine how long
they will stay on the address list. You can specify both Source and
Destination address lists as needed, and can create an address list with any
name.
--.~
~..................
130
"
Flrew,a
Fbr;.u~
N.AT "'&"'9~
+J, ,J 1....
'T"
I, H ,i
I 0
..
i0
',.. '" .,
_ "
,.."
"
SeMcePorts Co~~
Adctressl.its
- uo Re!8t H Coners
_"
.
-.- -
" ', , " " " ' , " , .. , ' , ' "
"'"
.. , " ,
I
ecc '" ,
~ ,,,
',
:,
,1.
Ctl. Por.
1 (0< .
",,0 ..
"
""2
3
.j 1JCt:.
0I ,.;c
4
S
;
oI ace
"
llCC.
Cql)
179
./ fJCC
17tJ.
12.)
:;
./ ace
5 l co)
Jl~
11
12
13
" ex:
., l'!CC
",.;c..
"'T'
.--------.,..----.-.-,--.--- .
n . hl .. , ..511:.
A_.A
".....,4,doren
.
. L.IEt._.._
0B
17$.1.
17 tJ
S7-G-9
53
170 4 KiB
OB
518
0
17lJ .
2056 1
122 M,B
31 ~3
I
t/ ecc. I
t/ :.c .. '
" ecc.
; C
,,""" 1
l '
tc
~7 PH:CloC:Cis
1127001
,
3310.
17 tJ.. :,20-')2 1
6~cp) 520-521
127,00 1
50",)
17 -tJ.
17
2llOO
2000
oB
oB
eB
OB
OB
OB
OB
0
0
0
0
0
0
0
nB
OR
030.2 NB
S990
.::
56::.::7E:.....--------:.::~:.::........::.:.::::JI
With these rules you have the basic IP matching ability's right on the general
tab. This will give you the ability to match based on source and destination
addresses, protocol as well as source, destination ports, and any ports. You
can also match based on your in or out interfaces as well.
The 'any port' option basically says match the packet regardless if its source
or destination port number, as long as one of them is the any port. You can
also use packet marks to match data as well in the firewall rules, but make
sure to follow the packet flow diagram to know how and where to put these
marks and firewall rules.
131
Gc....
Adv!ll1Cec
0'1"",:
l!"""
P<l'-_
s.c.Add=s: .
."---Dot.AddrMo: i.._--_.._..__..._.-
..,
._.-._._---'
J
~-
.. _...._.._.... _--
Proto::of:
L_.
-.-
.-
--_ _-_..................... ]
._ _
_.._ _ _ .
Sr..:h.~' i
t ....
...
.. -.- -. _. _
___. ._..__.._.
.._._-1
----~
oo. hedoce.
...-
====-
---
----
p.o.et MaIt<:
~Moo1< : .
...
Roo.iln, Mork:
----
' L :_ _
--""t-.l
.
Connection Bytes
Normally I would reserve not talking about
Corr<dioo &te.
connection bytes as it's sometimes difficult
So: 1'lc-",
to properly communicate.
Connection
bytes only work on TCP connections first of
all. This rule gives you the ability to match
based on a connections transferred amount of data.
--------i lCl1l57611
'"
..........
..... '.
'
A really good usage for this is looking for extended downloads. The example
in the graphic is looking for connections that have gone over lmeg of
transferred data. Of course, you can change this number to whatever you
132
wish to. Once the connection goes over lmeg, it w ill start matching this
ru le. The rule is in bytes so calculate accordingly.
Now that you have this rule, you can do something with it. I sometimes will
do a connection or packet mark, with a special rule, that puts it into an
extended download queue. Everyone can fight over so much bandwidth in
one queue for these extended downloads. Normally though, it would not be
1 Meg, it would be something like 200+ Meg for most of my configurations,
but it is a preference.
to
updated
by
RouterOS,
due
.-<'t ","
"
this; the latest version will give
P2p
f.:ll:rad< ","".j
01,,4>
you better matching vs. older
..
..
..
~corn<!d
..
edonk
Paccet Maril:
ware,
types of P2P or you can select
all-p2p, to match all of the types.
~JOI.' ~eK
-~
layer 7 Filters
Normally, when you identify traffic, you are using port, protocol, IP
addresses, etc. However, some applications use common ports that are
used for other types of data. Some instant messenger applications will use
TCP port 80 to connect with 1M servers. TCP port 80 is more commonly used
for HTIP traffic. This 1M data is virtually impossible to match and catch
without affecting other types of traffic. That's where the Layer 7 firewalling
abilities of RouterOS come in to help out.
When you apply most RouterOS firewall
..... -.......
filters, you are really only looking at the first
40 bits of data, or the TCP header data.
I\(ymsg Iypns Iyhoo).????
This header contains your IP addresses, port
?? ?[Iwt]. *\xcO\x80
numbers as well as options like TOS etc.
This is less than 2% of the data of many
packets. Due to this, we can process rules very quickly. However, when we
start doing Layer 7 or application layer filtering; we now start looking at the
entire packet. Therefore the amount of data we process goes from 20 bytes
to the entire 1500 byte or larger packet. Since we are now processing the
entire packet, we can look for data inside the packet that is common to a
specific application.
If we use the 1M or instant messaging traffic that we talked about earlier, we
can match data based on a layer 7 filter that defines what the packet must
contain. If it does contain that, it will match that filter. The note to the
right shows you an example of matching based on packet content.
To match via this we have to first define what the layer 7 filter will be
matching. This is done in the Layer 7 tab of the firewall. To get to this click
IP ~ Firewall ~ Layer 7 Protocols Tab.
134
._- - -
- - - -- - - - -
AT
er .
t
+ ,t...:::J
'occ"l
I (i
............[......
l,
Name
Q
angle
LV
_
c........
' ,Regexp
---
Connection Limiting
In your extra tab under your firewa ll rules, you also have a feature called
Co nnection Li miting. This feature is
very simple to use. I use it
quite a bit to limit P2P
applications from creating
l.In4: ;; 100
too many connections. I also
use
it
to
prevent
a
from
res idential
client
becoming a Spammer.
To use th is feature, yo u w ill need to se lect t he TCP Protocol, as it is a
connection based protocol in the TCP/IP suite. In most cases, I w ill also
===-
Podion :
r~:~:I() ~ ~~: : - - -
i +I
Tmeeet: IBd
08:00:00
............................................
------~--
: I~J
. ...
this basically does, is says, if you scan ports, and the tota l weight of the
scanned ports within the delay threshold would result in a match to the rule.
Remember, this is a rule, so you are matching data based on the rule. Once
the data is matched, you have to do something with it. I will typically place
an action to add the source IP address to an address list, typically port
scanners or some other easily recognizable name. Then I typically will place
another rule that will drop all traffic from the port scanner address list.
Ingress Priority /
ros / DSCP
I put these two together even though they are separate items, but they both
deal with priorities. The ingress priority is a function of WMM or VLAN
priorities. If you set priorities with VLAN or WMM you will be able to match
data based on.
The DSCP or TOS bit is a priority based number that is included in the IP
header information of the packet. What is really nice about this is that this
information is transmitted with the packet. Because of this, you can do 005
and other data matching very easily. In some cases, you can do ingress
marking. Let your edge routers ident ify the traffic and place TOS bits on all
of your traffic. Then in your core network, or backbone, you can process
based just on the TOS bits. If you wish to change priorities, you can do this
simply by changing the TOS bit.
Random
Using random can be fun. I will use the example that when me and my wife
are not getting along, I use the random command to drop 30% of her web
traffic and trust me, I get a response in about two minutes from enabling
that rule. I don't know what is worse, actually using that rule, or the fact
that I just enable and disable when I need it!
As the random switch implies, it allows you to setup a random matching
ability. Besides aggregating the wife with it, it also can do some good. If you
have an application that you wish to test with a questionable connection,
you can randomly drop packets based on a percentage. This will give you
the appearance of a T1 or other type of link that has packet loss on it.
cmt - -
ft1l&. ,.,
""'" .5.......
: ~ ~, ' r ~ J
..
The thing to keep in mind with the limit value is that it does not match data
until it goes over the rate. Once it goes over the rate, then it matches data.
This rule also is global, so unless you specify other options in your rule, it
doesn't matter what the IP, or ports are.
The DST Limit further limits packets per second but this time it limits per
IP/port. In the limit system, if you place a limit of 40 pps for an entire /24
subnet, then that is exactly what you would get. The entire subnet would
have a limit of 40 pps. If you use the DST limit feature, you can limit to
something like 10 pps per destination IP and port. So an individual computer
can have 40 pps, but only 10 pps per port.
Nth
Nth is a value that you can use to match Nth amount of data. In version 3 of
RouterOS this is handled differently than v2.x. It is now possible to match
138
-- -
- - --
50% of your data with only one rule. The key to understand Nth, is that you
are matching what packet out of what packet count.
Time
The time field is exactly what it sounds like . It lets your rule match at various
times of the day! This works great if you wish to allow access to some sites
or change bandwidth allocations at different times of the day. The rule
works just by matching the time to the system clock. Remember, on
RouterBoards, they do not keep the clock set after a reboot, so make sure
they can get to a NTP Server to get their time. For x86 applications, you
won't have to worry about this.
Simply specify the start time and the
Firewall Actions
Inside your firewall there are many different actions. Some just accept data,
some deny it, and others can change it. In the sections to follow, I will
discuss the different types of firewalling actions that you can use in
RouterOS.
Accept
Accept is very simple operation. What this does is "accept" or allow data
traffic. By default RouterOS is a "allow all". In other words, with no firewall
rules, everything is allowed. There is nothing blocked, no data is not passed.
The typical usage for accept rules is to allow very specific data. One
common practice with firewalling, especially in the enterprise, is to deny
-.
- ._- - - - -- -
Drop
When you drop data, this means that you are denying it. You have matched
that packet, and that packet is no longer processed. It does not forward
through the router; it is not processed by the RouterOS system in any way,
the packet is basically ignored as if it never received it.
I commonly use drop with a connection limiting rule . Once we have xx
number of connections, then the connection limit rule starts to match data.
If I accepted the data, that means data over the connection limits I had
specified would be accepted and continue on, nothing would really change
and the rule doesn't really stop connections. By making that rule a deny
rule, once the user goes over that connection limit, it will start dropping or
denying connections above the connection limit.
Logging
Inside your firewall you can also perform logging actions on your data. This
logging action allows you to identify traffic. The best use for th is is to see
what kind of data is hitting a drop rule.
Right before your drop all rule, place
that
a
log
rule.
This
will
log
all
data
ActIO" ..-'. .
'I
1
__
-:.....J
r-..- ..- ... .......- .I
makes it to the log rule, and unlike
Lo9 PoSbo ~~!:.._...................
.. ..
.a.
most other actions, the log rule w ill
let the packet continue to process
down the rule list. The next rule though,
is a drop all rule. This way you will get information on what your drop rule is
dropping. The Log Prefix information is simply that, an informational prefix
that is appended to all of the logs generated.
i
~._". ~
The logging rule places these logs into memory as 'fi rew all info' types. You
can then use your logging actions to be able to see these in your logs, or
140
send to a Syslog system etc. Below you can see what the output is inside
your log memory. Note that we have the ICMP prefix that we defined
above. This information will help you identify traffic as it passes through
your firewall.
I,
,
1
I,
i
,I
Reject
The reject action is solely for ICMP packets. This will stop the ICMP packets,
and then supply a reject message
back. Once you select the reject
Reject Vl4h' ' temP networl< ~ach .b1e
action, you can then specify with
temP adnw1 prohCted
what reject message to respond
'arc> host prnhibced
iarc> hoslllYeachabie
with.
.
net
ed
I
I
l
1
,.
I,
"
I1
,
II
I
,
I!
I,
,
I
I
,
,~
Tarpit
t"E ~
.__
~
~
~
~
~
~
~
~
~
~
~
The basics to this list, is disable services you don't need, block DOS and PSD
IPs once you identify them, allow only traffic from management IP subnets,
and drop everything else!
142
Protecting Networks
Common Firewall Options
Putting the firewall to use for you and your customers is the hard part.
Router05 offers so many options, wh ich building your firewa ll may seem like
a daunting task. Overwhelming options and abilities, and as a router
adm inistrator putting it all together is hard work.
First off, we want to prevent the unwanted traffic that we do n't need on our
network. TCP bas ed connections are a place to start. We will block invalid
connections, but allow those established and related. This will keep us from
processing a bunch of data and focus our efforts to blocking the initial
creation of the connect ion. This also will keep our CPU time down. If you
wish to provide bas ic firewalling, I would also look for port scanners in your
forward chain just like in the input chain. Add those detected users to an
address list and block them.
Next, we will wish
to prevent some
is
data
that
common
from
crossing
your
network.
Both TCP
and UDP ports 135-139 are commonly used for worms and viruses. These
are the ports that are used by NetB/05 traffic, and in my op inion, should
never traverse a public network. A common examp le of this is two users on
a network, file sharing directly in windows. First off, they don't want this,
even if they don't know they don't. This is a very big hole for hackers,
viruses etc, to get into, so I typica lly will block these ports as they should not
traverse my networks. Another set is TCP!UDP 445, this has the same usage
of the NetBI05 traffic and I think should be blocked.
What about viruses? There are a number of virus scripts floating around the
Internet. You will need to look over t hese before adding them to your
system, as some of them may have undesirable affects. So be sure you
know what you are doing and what it will affect. I have seen some of these
scripts block common ports that are regularly used. So be very careful when
applying something that you did not make.
SPAM Prevention
As an Internet provider, you may wish to prevent network users from
sending out SPAM. This is a difficult task, as there may be legitimate mail
servers operating on your network. Even with this, there are a number of
methods that you can control SPAM on your network. The first way is simple
connection limiting. Most mail system will send outbound mail via TCP port
25. This is the SMTP port.
Mail servers commonly use port 25 for mail, so identifying the traffic is fairly
easy. If you apply a connection limit per IP just on port 25, th is will be the
first step. Residential users typically will never need more than five TCP Port
25 connections out. They typically send a single message via a single
connection; therefore, any residential user going over this limit very well
may have been infected with a virus or worm that causes their computer to
send out SPAM. A rule that prohibits over 5 connections, and then adds the
source IP to an address list will allow you to identify the user. Set this rule
up for an hour or so timeout on the list. A second rule would then block all
port 25 outbound access based on that address list. With this method, once
a computer is infected and sending out massive e-mails, it will be placed on
the list, and all SMTP traffic will be blocked for an hour. After that, if they
continue to attempt, they will simply get added again.
chaln- ! c rward
addres~-ll~t-tlmeout 2h d5~-pcrt 2 S
protoccl= t cp
addres~-1~3t.Ove r
5 SMTP
co~~e:ticn-ll~t= 5 , 3 2
With the above rules in place we have effectively eliminated the possibility
of sending lots of SPAM and e-mail out quickly. What happens if you have a
144
real mail server on your network? Well there are two ways of dealing with
this. Real mail servers may send out quite a few messages very quickly as
they are dealing with many users. A retail business that I worked with had
about 175 users, but they could send out a staggering amount of e-mail in
some cases.
Most mail servers though will limit the number of outbound threads, or
connections. One Hundred seems to be a good number for simultaneous
connections on most mail servers. The simplest method of processing this is
to change the first rule, and add
an " accept ed" mail server list.
You create an address list that is
for approved mail servers. This
and in your first rule that adds
customers to an address list, you
exclude the approved mail server
list by selecting not on this list. If
they are on the list, the rule will
never match, so you don't have to
worry about them getting on the
list.
]~
I::r
JL.].. .
Protocol 0 [6 ~cp)
SIC Port : [
r"
~{'n
, ....
_..
[5
Netmaok: [32
-1
...
_ _....
~
,.
.. . .,
1i
"
TuneoUl : i 02-00:00
These attacks send the dictionary at a SSH, tel net or FTP Server trying to find
a word that will let them in. One of the ways I have found to limit this type
of attack very effectively is to create several different address lists
dynamically. These lists, will allow only so many SSH, FTP or Telnet attempts
before it blocks an IP for a set amount of time.
To do this, you will simply create a rule that says if it is a new connection on
one of these ports; add them to a stage 1 list. Normally, most actual users
will not go past this, and this stage 1 list only keeps the IP there for maybe a
minute or two. With tel net, you will get several attempts to type in the
correct username and password, but if you type the wrong ones, now you
can create another connection and try again. This is where your stage 2 rule
comes in . This rule says if your IP is already on the stage 1 list, and you are
attempting to make a connection, add your IP to the stage 2 list, this time for
five or six minutes. Again, as the user, you will have several attempts to
connect with FTP and tel net. The third rule is the big one. Now you have
145
. - - - - -- - - -
--,--
-r
,k:lJon. Charl
iSr.:
Ad<t,,,. IDot. _
.....
r-
.....iProto...
_ ~J<:pL
6 !cp)
6 !cp)
6 !cp)
, - !
2:2.. .
22
22
22
:" n er"'IISle
iId~.~lJ.s:_
'oI1_st age}
ssI1.stage2
.sh.lIto;j<! 1
This is a set of rules that I usually use. I would jump if it is port 22 for SSH or
port 23. You don't have to actually specify the port here, as you could do
this in the jump rule as well. Note that we ordered them backwards; we
wanted the first rule to look at the stage 3 list while the second rule looks at
the stage 2 list, so on and so forth . The idea behind this is that we have
several stages, to let someone that may be valid to login. Once they have
gone over this number of attempts in a sma ll time period, we assume that
they are attempting to hack the router, and then block them for a long time.
DOS/POD Attacks
There are two types of attacks that we commonly see. One is a DOS or
Denial of Service attack. This attack typically sends thousands, or more,
connection requests, or TCP SYNs to a single IP address. This IP may be a
web server, or some other connection based protocol. Even though all of
these connections are made and are valid, the issue is that the server can
only handle so many of them. After a while the server will be overloaded
with SYN requests, having so many connections open that the server is
overwhelmed.
First off we need to identify these types of connections. These are simple as
we can setup a rule to match TCP connections, with a SYN flag that are in the
new connection state. This identifies all of these connections that are
attempting to be opened up. Next, we place a limit on the number of
packets per second we wish to allow. A good number wou ld be 300-400 of
these types of packets per second. Once we identify that a single IP has
146
147
- - - _._- - - - -- -
. _.
-- - - - -
148
This list does a number of things. One, it checks a list called "Allow 25
SMTP", for IP addresses, if they are on this list; they will get 25 SMTP
connections. If they are not on this list, it will give them 10 SMTP
connections, once they go over 10; they get added to an address list called
"Over 10 SMTP" for 2 hours. Once they are on this list they will have all
SMTP blocked for however long they are on the list.
This gives you two levels of SMTP, one default and one that allows up to 25
connections.
Of course you can modify that list or the number of
connections to your preferences.
Here is the order of events:
Conditions
Protocol: TCP
Dst Port: 25
Chains
The mangle system uses chains, just like your firewall system. It is important
to understand how these chains work together. Depending on how your
data flows, you will use different chains. Make sure you look at the packet
flow section in the firewall system
Prerouting
This is the most common location for your mangle rules. This will process
data as it flows through your router, but more importantly, it processes prior
to your routing decision. 50 you can apply marks prior to the router
determining what route to take. 99% of your mangle rules will go here.
Postrouting
This is typically for packets leaving your router that you wish to mangle.
Good usages for your mangle system here is when you are changing your
TCP M55 size, or making other packet changes. Another possibility is if you
are changing the T05 bit of the packet.
Input
The input chain in mangle is the same as the input chain in the firewall
system. These rules are for packets that are destined for your router. They
input into the router. An example of this would be ICMP ping packets that
are pinging your router. Your router receives them in on the input cha in,
and then responds to them on the output chain.
150
Forward
The forward chain, again, is just like the forward chain in the firewall system.
This chain processes on packets that are
Output
The output chain is just like the output on your firewall rules. This is for
packets that are generated by your router, and sent out an interface.
Using Marks
While using your Mangle system, one of the key features is marking. You
will typically use the ability to mark data simply to identify it for use in other
RouterOS features. There are several different features that RouterOS will
use marks for. Policy based routing, along with traffic management, and
queues are just a few. Each of these RouterOS features will use a mark to
identify traffic. Since these marks are just used to identify traffic for other
RouterOS features, they do not travel outside of your Router. They don't go
between RouterOS systems, nor are you changing the packet or data in any
way. The two marks that you will commonly use are Packet marks and
Routing Marks.
Packet Marks
When you are identifying data to either use in firewall rules, or in the
queuing system you are going to be marking the packets with a packet mark.
This is the most common type of mark that you may use. The goal is to
identify traffic and then place a mark on that traffic for other RouterOS
facilities. To identify traffic, you will use the firewall like options in the
mangle to match data. Once the data is matched you will have an action
type to mark your packets. This places a virtual mark, only inside the
RouterOS system, that you can use in your queuing system, as well as your
firewalling system.
Routing Marks
151
Connection Marks
Connection Marks are using to increase the processing capacities of your
RouterOS. It's important to understand how connections are created and
how connection states in RouterOS are handled. Refer to the connection
state section if you need more information.
Using connection marks is very simple. You need to match the data,
preferably when its connection state is still new, by using a mangle rule. This
rule then places a connection mark on that connection. All other packets
that come from that new connection will also have a connection mark on
them. This then allows you to place a routing or packet mark on the packets
that have a connection mark on them. Processing all of the packets based
on the mark is faster than matching the data every time. The connection
mark allows you to do complicated or high capacity matching without the
high CPU overhead of processing and analyzing every packets header
information. It's just simply faster to process based on the connection mark.
So the question that has to be asked is; when do you use connection marks?
Typically I have found unless you are really starting to push the RouterOS
system and hardware that you have, I find it simpler to mark with packet or
152
--
-- -
-_._-----
routing marks directly, vs. indirectly with a connection mark. If you are
having CPU issues with the RouterOS device, either you are pushing more
data or simply have lots of rules, then you can start using the connection
mark to help your router and CPU. I will say though that if you are starting
to drive your RouterOS system to this level, then you should think about
replacing the hardware with something a bit faster.
Change MSS
This allows you to change your MSS or Maximum Segment Size field of your
IP header. This is the largest amount of data that a device can handle in a
single unfragmented piece. The number of bytes in the MSS plus the header
information must not add up above the number of bytes in the MTU or
Maximum Transmission Unit.
The typical usage for this is to set a packet size on an outgoing interface,
which your data will leave on. An example of this is a PPPoE Client
connection. You will typically have a 1500 byte packet size with Ethernet,
but when you add the header information that PPPoE has to have, you end
up with a 1460 maximum packet size. By changing your MSS, you are
specifying those packets that are going through your routing and leaving on
said interface need to be fragmented to the MSS size.
Of course you can use your postrouting chain for changing your MSS,
however, for optimized processing; you can also specify the packet size in
the advanced tab of your mangle rule, specifying packets that are oversized
for your interface. So if you are changing your MSS to 1460, instead of
153
-,,
Clear OF
This simply clears the DF bit of the packet. This bit if set to 1, specifies do
not fragment. This basically says that this packet should not be fragmented.
By using this option, you are clearing this bit and resetting it to 0, showing
that it can be fragmented.
Set Priority
This sets a new-priority parameter on the packet that is sent out through a
link that can carry the priority. This is just for VLAN and WMM-Enabled
Wireless interfaces.
154
Chains
The NAT system has two built in chains. Just like the firewall chains, NAT
rules must belong to a chain of some type. All NAT rules w ill start with
either a srcnat or a dstnat chain. Srcnat rules are rules that perform actions
that come from the NATed network. As the data passes through the Router,
the source IP address is replaced by the new IP address on the outside of the
NAT system. Dstnat rules are data that come from the public side of your
network and are translated to the private side, think inbound routing.
- ._._- - - - -
----J
Src. Port [
::
:1..
One of the little t id-bits though that you need to understand is that when
you do masquerading, the outgoing IP address on the out interface that is
used for translation is the first IP that was added to that outgoing int erface.
Also, there is no reason you cannot masquerade public IPs, or virtua lly any IP
address you wish with RouterOS. Many routers w ill on ly let you masquerade
private addresses. I do this when a networks primary Int ernet connection
with public IPs goes down and all we have is a DSL or cable connection. We
masquerade customers with those public IPs out the DSL or cable interface
letting them get on-line, but not use their public IPs.
To create a basic masquerade rule, see the above graphic, click on IP -7
Firewall -7 NAT, and create a new rule . Enter either a source address or an
,
out interface, preferably both, and then click on Action, and use the action
drop down box to select masquerade.
156
- -- - -
- - - - --
~
~
IP ~ Firewa ll ~ NAT
New Rule
Add either Source Address Subnet or Out-Interface
You can specify both if you w ish
Select Action Tab
Use the action drop-down to select masquerade as the
action.
Inbound NAT
Inbound NAT or dstnat commonly
is used to take a public IP address,
and forward it int o an int ern al
private IP address. You do not have
to forward an entire IP address and
all protocols and ports though. You
can simply have several rules to only
forward specific protocols and ports.
This typically will be used in
conjunction with your outbound
NAT rule as well. The reason for
this is that data that comes in
through the inbound NAT system
will typically need to reply on the
same IP address that the request was
sent too.
Chat>
[mm
Src Mae..:
Adton . dst_
...
J+
....
Outbound NAT
Outbound NAT uses your source IP address to translate to a specific public IP
address. Instead of looking from the outside in, you will be looking at this
rule from the inside private address going out, hence outbound NAT.
RouterOS calls this srcnat, or source NAT. This feature is very basic. It says,
if data comes from xyz private IP
address, then perform srcnat on
it, and translate it to abc public IP
010n: 'S<Ml
and send that data out to the
Internet. This will allow a private
IP address to show up as a very
specific public IP address. You will
have to have this public IP
address on your public interface
-of your RouterOS system.
To _ to" , f\bc IF_...
-
..
-----_....__._
To Pats
J ~
158
--
._- - - - - - - ~
the to-address field in the action tab. This will make the computer, or
device, that is on the private address appear to come from its own public IP
address. You can only have one srcnat rule per public IP address, as this is a
1:1 relationship.
Doing a 1:1 NAT, allows you to assign a public IP address to a private address
on the inside of your network. In some routers, the functionally of th is is
limited, however, with RouterOS, this function works perfectly. To do this,
you will have to create two different rules. One is an outbound NAT. This
takes all the traffic that the private IP address generates and sends it out an
individual public IP address. No ot her traffic will be generated from this
public IP without it coming from t he private IP.
The second rule is the inbound NAT rule. This sends all packets that are
destined to the public IP address and forwards them into the private IP. We
do not define any ports or protocols, so that all data is passed through. The
only th ing that is changed is the source and destination IP addresses to allow
forwarding through the private network.
Genn Adv/ll'lced Ext", Action S11!listic.
+
Chao : fdstnat
Plbic IP Address!
Advanced
Extra
Action
StalJ"bC'
-Pnvale IP .~
To Ports :
...
- - ----
Adv!ll'lCed
O1ain:
Extra
AdIOO SlahstiCS
~~.. -
!.
Dst . Address:
Extra Adm
_._...
...
StolistJes
.~
['ubk IP_~
To Ports: [
-J
l _ _.
JldJon : [src1'lat
To Addresses
....
General Mvanced
I
I
....
.._____._..........; ...
_m_m___
_ ...
,I
,
160
'--
- - --
To Ports:
... .
...
...
...
...
To p~ l.al
...
:::1
....
Redirect
162
IL
Redirect is the same thing as a dst-nat action, but it does not need a toaddress field. It always redirects to the incoming interface IP on the router.
What this is typically used for is redirecting traffic to router facilities and
features.
Two really good
functions of this feature is for
General l~ i &Ira Acti"" StobWC$ ':
redirecting web traffic to your
r---
_
..
010., : ,dstnat
on
RouterOS.
.. .-.-- " .......
-~
__
~ r;:;;:j ~
...
.. ~
--
Src Port
"""."
163
- --
_ ._..-
rn
lnurf.". Li' l
Bondng
..,:'r.'1 ..... ]
Ethernet
Inside the Ethernet interface settings, you will see a listing of just hard
Ethernet interfaces. This will not include other interfaces associated with
Ethernet interfaces, such as PPPoE or VLANs, but just actual, physical
Ethernet interfaces.
,.
~.,. ~.~,'!.."' _
,R
';' elilerl
,R ol...""2
etiler3
,
,R ';'
:~. Tl'~
Bh<mel
8 ........
EIhemel
... . . . . . . . . .. .. ....- -
- . ----.
--r--..1_.._......1
T~
!.~.," ,." _.._..lI~..f.~::.:. ~!.~~.::;;~~~_~J~~ . .E.~..~..::. T~ . ~~::.: ..~.~.~ .l.~.
10 2 M"", 12 Moo.
1 169
W7' none
<rim.
0
' 12 ""p. 770 kbp.
'2
<0 ncoe
ed "*,,,ed
0
0 "".
Obp.
0
0 none
ed _ed
0
"""'ed
Inside this section you will see what type of Ethernet interface, the current
TX and RX data rates, as well as the TX and RX number of packets.
Depending on your version, as well as hardware, you may have some other
options. On the RouterBoard 400 Series, you may have options such as
switch port, master port and TX/RX Bandwidth limits.
164
-Gonerol , _
I
1 r....
Slotu, Tr<iflC
Name :
i~;l""""""'"
,..........................
t.........
...
_...
.AppIy
:'
:
.:
er,~
~~
o
I
' I :_7 1'"
, I c..,,,,met1t ,
MTU: 1500
1..
I
.... 1
==.
!
I
OK
'
;
=
T11'" l ar..m.t
..
. SClur<:;
~-
TO!ctl
1"....... 1"
.......:"............ ,.....
BMldwidh {R.:/Ty..}: t
unlllnted !.......
:i" fi .............................
.B1h11lted ; .!
Switch Controls
On most Ethernet interfaces you will not have options to control bandwidth
or options for Master and switch ports. These are typically on the
RouterBoard 100 and 400 series devices. This gives you options to setup
165
Below you will see the Ethernet tab of an Ethernet interface . Here you can
manually select the Ethernet speed as well as enable or disable either AutoNegotiation
or
Full
Duplex
_.. ..
Operation. Full Duplex operation
means that the interface and both
send and receive data at the same
time. This is default for most
,1
I Ois~
I
Ethernet connections. If you have
I
1
Comment .
I,....
..
....
a device that only runs at 10Mbps
_.. ]
I TOId1
Half-Duplex, then you would want
to
manually
configure
your
I
interface, by checking the lOMbps
option, and uncheck both Auto
,
Negotiation as well as Full Duplex.
.
;=e.J...,--.
This will tell RouterOS to ONLY run
the selected Ethernet port in this
mode only.
166
--."~
,., ,._.
Tx 7.,...,.
O~
Cereel
IowY I
T.x P~ 'J6.S 'J!s
....._................
, I I),~. I
r-c~;; ;;:; ;]
I = ~ ;;:~, 111
M~l~~~J~JnIOOI~J
I.. =tz
Tx Pod<et
7sa, 's
I' T;;:;;;--]
"'Uig
Tra!fic
Name:
[!Il
~======~
[l"sOO
..
.. ,
......t
. _ _
....
_~
' MetaRDUTERs
MetaRO UTERs
Interfaces
CJB B ~ IT]
I
I
: c 1Q
I
168
I~')
-.J
_ _ . _ _
. . . . .- - ,
As you can see we have assigned ether3, the physical interface of our main
router, as a static interface to our Virtual Router. We also assigned vifl to
this same router. This will make our virtual router have two interfaces. One
that is connected to the ether3 interface of our physical router, and the
second, is our Virtual Ethernet Interface interconnecting both our physical
router and our virtual router.
This interface, just like every other one in RouterOS, can be masqueraded,
firewalled, and otherwise controlled just like if it was a real interface.
I
1
l,
I
I
i
.,---
r-:-::
U",.e : l~ '
MAC
T=
'S;;;;;;;; . . . . . . . . . m m . 1
MTU:
[isoo
r- .m.................
,.............. . _
__
Mi,,,,,
~-
AAP: ."".bled
~
~..
.. ---
. . . ..mJ
Transm~
rro05oo----- -.
170
--
. ..._--
...... - - - - -_ . _
- - -
occurs is packets enter on one switch, go out through the first cable, and
then go back out the second cable, back to the first switch. That same
packet then goes back out the first cable, so on and so forth. It just keeps
going around and around endlessly. Eventually this will use up all bandwidth
and CPU power in the switches, causing the network to basically come to a
complete halt, or at best, becomes so slow that the network is not usable.
This is also called a network loop.
STP of course, is designed to prevent this. RouterOS supports two different
versions of STP, the standard STP and RSTP. RSTP stands for Rapid SpanningTree-Protocol. In most cases the default settings for STP or RSTP is fine. The
main thing to note is that when you enable STP and turn on an interface, you
have to understand that there is a forward delay. This delay, defaulted to 15
seconds, basically enables the interface, but does not allow any
transmission. It waits during the forward delay and listens to see if enabling
that port would cause a loop. If it would, it disables the port, so you can't
use that port in your network. If it's a wireless link, that is turned off, one of
the bad things with using STP or RSTP.
RSTP does the same thing, but it does not wait, it listens and looks to
prevent a loop quickly before it becomes an issue. Also topology changes
happen within seconds or less, vs. 30-50 seconds for a change with STP.
Also, RSTP maintains backup details regarding the discarding status of ports.
This will help avoid the timeouts if the current forwarding ports were to fail.
A few things to note, if the port is in forwarding status, which means data is
flowing across that port. Disabled status means that it has been disabled
due to loop detection. Listening means that it is trying to figure out if it can
bring that port to a forwarding status without creating a loop. Backup ports
mean that the port is disabled but considered a backup if necessary. The
last mode is designated port; this is also a forwarding port.
Bridge Ports
Once you create your bridge interface, now you will need to add ports to
this. Below is a bride that is running STP.
171
----- ---
..Proloco
_ ....
SlJ1
The ports tab is where you w ill add new ports to your bridge int erface.
Bridge
POllS FIlen
UAT Hosts
Gene.-al S1atus
._..
_0
"
_ _0
...
Edge : .
,
One instance when you would wish to
Port To Port . '....0
change these bridge port options is if
E>t""'" FOB: ....0
you wished to prefer one link over the
other. An example of this is if you
have a high capacity fiber or wireless
link, say over 100 Mbits, and right along side of it, you have a low cost 30+
Mbits wireless link. Of course you will wish to use the higher capacity link
normally, but with Spanning Tree, it does not detect what link is faster.
However, we do have options inside our interface that allows us to prefer a
link. You would have to configure this on both sides of your link as well.
The simplest thing to do with this is just to increase the priority of the
interfaces that are on the slower link. The default is a priority of 80. An
increase to 90 will make the primary link, if working, to be prefe rred .
172
.. I
Bridge Setfing:.;;,s
~ Use IP FirewaB
RJ
174
lJ
..,_'-::::
I OK I
I Caore I
I Apply I
.. I
Bridge Setfing:.;;,s
~ Use IP FirewaB
RJ
174
lJ
..,_'-::::
I OK I
I Caore I
I Apply I
image to
,_fBridge
bridge1
bridge 1
Something to note with this type of setup, is that you can use different VLAN
10 5. So if VLAN 100 is on ether1, you could bridge VLAN 200 on ether2, or
bridge VLAN 100 on ether1 with VLAN 300 on etherl. You can also add
firewall rules based on your bridged interface.
VLAN Configuration
VLAN configuration is super simple. All
we need to know what the VLAN 10 that
you wish to run. If you wish to run VLAN
100 on ether2 then that is the extent of
the configuration that you will need .
To add a VLAN, Select Interface -7 Add
Interfaces -7 VLAN -7 Enter the NAME of
the VLAN, and change the VLAN 10.
Gena aI
TraffIC
N,."., :
Type :
~an"00
[IILAN . . -
-j
-
..;
---'
MTU:
MAC Mae.s:
ARP:
[1500
L i_ _.
1"""t.ilOlJ
---'
.:
[r:
~~r:
1 ---':I~J
176
Bonding
Bond ing will allow you to aggregate several interfaces into a single virtual
link. You will end up getting higher data rates as well as possibly providing
failover. Typically you would bond
only Ethernet interfaces, however,
New Interface
you can bond other types of
General Bonding Traffic
connections, including tunnels, and
wireless
interfaces.
Sla~'es ether2
...
.
. .... . .
Mode: balance IT
,.."
Down Delay: :0
,,
.. ,
=
--==-Delay: 0
..,
! ms
"
The
There are several different modes.
default mode of balance rr, is a round-robin
load balancing of the data across each slave.
This will provide load balancing as well as fault
tolerance. This mode, typically gives the best
results as long as the links are balanced. An
example would be two GigE interfaces. It does
not work the best if the connections have
different latencies.
The B02.3ad mode is the IEEE dynamic link aggregation standard mode. This
mode the interfaces will be aggregated in a group where each slave shares
If you wish to balance outbound traffic according to the load on each slave,
then balance-tlb is for you. This mode, will balance the outbound traffic, but
the receiving data comes in by the current slave. If the slave fa ils, then
another will take the MAC address of the failed slave. This does not require
any special switch support. I typically don't use this mode.
Adaptive load balancing is what balance-alb is. It includes the balance-tlb
but also balances the receive data. Note that for this to work; you will have
to have device driver support for setting the MAC address. If not, it w ill not
work. This mode does not require any special switch support. I typically do
not use this mode.
The balance-xor mode uses a XOR policy for transmission, but only provides
failover. I typically do not use this mode.
The broadcast mode sends data out all slave interfaces at once. Th is will
provide fault tolerance, but on some slower systems, can cause slowdowns
on the speed of the connection. I really never have used this mode, as I
typically need more throughput.
On the modes that have a primary and
Mode. iecnve backup
I~]
secondary connection, such as activel[!]
backup, there is also an option to specify
the primary connection . In this case, I have
selected active-backup, and then selected
that etherl is my primary connection. This mode works quite well even if
... ...
178
...
,.
....l
you don't have balanced links. So your primary connection may be high-end
giving hundreds of megabits of throughput, however, your secondary may
be a much smaller connection. This will fail over, but no considerations are
made for the slower connection. All it cares about is, is the primary up, if
not bring up the backup.
Of course, you have to have a way to
detect that you have a failed link in
any of these methods with fault
erp
Do,..., DelIly: ::: l)'Pe j
tolerance. The link monitoring type
will help you with this. There are
basically 3 types of monitoring. ARP
is the most common. It simply uses
the existing ARP entries to determine if
the remote interface is reachable. Mil, or Media Independent Interface,
basically allows the media interface to be changed or redesigned without
changing the MAC hardware. This is a hardware and driver requirement that
must be met for these modes to function. Most min-Gbics and other such
devices must support MIl. Type one uses this standard to determine Iinkstatus of the slave interfaces. If you can unplug a slave interface and it still
shows up, this means it is not supported with MIl. Type 2 uses Mil type2 to
determine the link status. This would be used if typel is not supported by
the interface.
A few notes about bonding. Most of these methods require the latency of
the connections to be similar, as well as the speed of the connections. If
you are trying to balance across different types of connections, I would
suggest using another method in some cases. Trial and Error sometimes will
help you with this, to setup and test across your links to see how it will
perform when you are trying to balance across multiple links. If you are
more worried about failures and redundancy, link failure detection will work
much better on higher end hardware such as 3COM and Intel NICs vs. other
less expensive cards. An example would be some Intel cards will detect the
failure and switch over in less than a second, while other, less expensive
cards may require up to 20 seconds!
179
- - -- - - - - -
,,'!?"',
" 'j '"
>-.. ---
, "",
",N
.
- - "
C
portal. This portal is typically an
A "
,, ~
"
"
,
"'~
,
entry or exit point to the mesh
" ,
, ,'
network. In most cases, this could
- - -be a hotspot controller or the
-~> - PREG m'nln,,_
gateway router to the Internet. By
configuring a portal, the network will send a RANN message out into the
mesh network, saying that it's basically the default route . As other mesh
devices reply with PREG or Path Registration messages, it will build a routing
tree with the root of the tree as the portal. Think that the portal is the
default gateway. Also, if other nodes do not know where to send data, they
will default to the portal device.
I
----- "
180
With all of that said, you do not have to have a porta l mode device,
however, th is is better for a mesh network where most of the
communication occurs between devices, not out to the Internet. Instead of
a device sending RANN messages out, all of the devices send out the PREQ
messages looking for other devices and destinations. Clients of an access
point do not have to respond to these messages as the device that they are
connected to will answer them for those cl ients and send PREP, or path
response messages back for the
clients.
When you start to build your
----"'.;;~
--network, keep in mind that
wireless stations can't be bridged,
so you will need to use the WDS
setup. You can either set it up statically or dynamically. One thing I like to
do with WDS is to take advantage of Dynamic WDS, but put a high access-list
signal value. I don't want anything without having a good strong signal to
form a WDS bridge with my devices. So, by doing th is, I eliminate low signal
transmissions, and other devices that simply will not form a good quality link
to !
::::.:.::::::::::::::..
Mesh: mesn 1
-+
Path Coot : 10
====k eNai . 10
s
--
Port Type:
~o
.....
Now,
once
you
have
your
mesh
DR M etess 00:00:00.000000
interface up and running, simply add
your mesh ports.
You can add
Ethernet interfaces as well as wireless
interfaces. You can also add bridge interfaces if you wish to. I typically will
not use the bridge interface because I want the mesh to take care of
everything. Also, you can set the port type if you wish; however, RouterOS is
really good with the auto type . This will allow you to set it up the type of
port that it is, either an Ethernet, wireless, or WDS.
VRRP
VRRP or Virtual Router Redundancy Protocol is a RFC standard protocol that
is used to combine several routers into a Virtual Router Group, or VR. This
group's purpose is to have router redundancy. Each of the Virtual Router
Nodes will have a virtual IP configured along with a virtual MAC address.
182
One of the nodes w ill have the virtua l IP as its real IP. This node will be the
owner, and w ill only be replaced if the power becomes unavailable. The
other ro uters w ill be backups, when they do not see a number of broadcasts
that normally come from the owner at the advertisement int ervals, they
start an election process and one of the backup routers become the master
router, assum ing that virtuallP as the ir own.
Before we configure VRRP, it is important to understand how this system
works and what its limitations are. The reason I say this, is typically when I
thought about using VRRP, I ended up using dynamic routing to route
around a failed interface or router. This typically works better, and allows
you more options. But, there may not be an ability to do this in your
network design etc, hence, VRRP.
So to configure VRRP, you have to
' New lnterface
create a VRRP interface; this is
General VR RP I Scnpts TraffIC
done on the interface menu. Click
Int elface: .
Interfaces -7 Add -7 VRRP. This
VRID: .! .
_
will start you off with a new
interface. The VRID is your Virtual
Pnooty: 100
Router ID number, and you will also
Interval: 1
need to setup a priority if you wish
, "'J Preemption Mode
to have one router to be primary
and secondary.
I wou ld also
suggest using some form of
Password :
authentication. Also, you will need
to have the same interval on all of
your routers, otherwise other
routers will ignore the received advertisement packets and it simply will not
work.
There are three types of VRRP routers. The Master is the router that is
currently being used as the IP. It would be the unit that you would be using
to go through normally. The backup, of course, is the backup unit, and you
can have multiple of these if you wish. When the master is no longer
available, then the backup router with the highest priority will become the
new master. Now, if the original unit comes back on line, if it has a higher
priority, it will automatically become the new master, so your traffic will
switch over to that higher priority unit. You may not wish this to occur, so
you can turn on Preemption mode.
184
Tunnels
RouterOS offers many different types of tunneling options. Some of these
you can bridge and some you cannot. Tunnels that you can bridge are Layer
2 tunnels. My experience though, shows that you will always have a better
performing network if you use layer 3 tunnels. These tunnels you will route
through, thus reducing network overhead and broadcast domains. Also,
these provide routing abilities, so you can really control traffic one each
segment, provide queuing, and traffic shaping as well as OoS.
Some tunnels also encrypt traffic, and that encryption can be simple or very
advanced. RouterOS can do from MPPE 128 Stateless encryption, very
common for home VPN connections, to AES-256 bit encryption. Some of the
tunnels though, do not encrypt traffic or have an option not to encrypt
traffic. I use a rule of thumb to keep encryption to a minimum; this also
keeps the load off of your RouterOS CPU as well. An example would be for
most site to site traffic, which does not deal with private personal data
and/or credit card information; I would suggest just using the MPPE 128
encryption. Typically this provides enough encryption to keep that private
data private. IF you are transmitting credit card information, first it should
be encrypted by whatever method you are transmitting it before it hits any
types of tunneling, but you may wish to bump that up to something like
3DES or AES-128. But if you want the most encryption you can get, you can
do an IPSec tunnel inside an encrypted L2TP tunnel. So, you encrypt with
AES-256 or 3Des, and then hit the tunnel, that encrypts the already
encrypted data with MPPE 128.
EalP
EolP or Ethernet over IP tunnels are proprietary to RouterOS. These give you
a very quick, unsecured method of creating a Layer 2 tunnel. To create an
EolP tunnel, you simply need two MikroTik systems that can communicate
directly to each other. EolP will use IP Protocol 47, more commonly referred
to as GRE for the communication between the two sites. EolP is not a
replacement for WDS in wireless bridging as well.
- -- - - - - - - - -
New Interface
~_.
Name .L.-_
: _
Type:
- -1
I
_~
l Ec IPT~
MTU: 1500
=
ie . : . : ,
~1
,
ARP : ,.lenabled
Tunnel lD: 0
To create an EolP tunnel click Interfaces ~ Plus Sign ~ EolP Tunnel. This
will create a new interface that you can apply filters, queues, and setup
routing on. The only two items that you need in the interface settings is
your Remote address, this would be the remote IP address of the remote
end, and the tunnel ID number. This number must be the same on both
ends. Once you create the two ends, now you have a Tunnel. You can at this
point, place IPs on each end, and setup routing, as you can route across an
EolP tunnel if you wish, but most people would use it for what it is intended
for, and that is bridging it.
One thing that I want to
point out, and one reason I
do not use EolP tunnels
much, is that the interface,
regardless of its actual status,
always shows running. This means that you will not have a state change, or
other identification that shows that the interface is down. It never goes
down, and hence, anything that is based on the interface never changes or
failover due to this fact. Also, unless you pass data to the other side you will
not know if the link it working or not.
186
!lhjge
bndgel
bnOOel
One major issue that you may have w ith Eo lP links is MTU. Typically when
you bridge Ethernet across the Internet, if you have a good Ethernet
connection, you won't have issues; however, if you go through things like a
PPPoE client, you may have to adjust the packet sizes of your tunnel. By
default your tunnel MTU will be 1500, and this is fine for Ethernet, but not
over the Internet. MTU issues are often difficult to troubleshoot. Common
signs are HTIPS and other very specific websites are not working (assuming
you are going through the EolP tunnel to get to the Internet) as well as large
ping packets are not getting though. To fix this, you will simply need to
change the MSS size on large packets to be smaller than the max MTU that
the devices between your two routers can support.
187
====--,
188
.' ppp
Irtenace PPPoE Severs Secret. Profile. ActIve Connection
.......... _..... ..__..- _.._.... ,
._._- .. _--,- -_ _- ,..._
,
,.. ..'..,,, ..
<:
: >3
PPTP Server
LZTP Server i OVPN SeNer I
+. "':
"".
~:='
,Name
-...
II
vi
' . '
--,'-,-T~
.,
Trx
,Rlt
,,
-.
""
.-1
...... " - -
.j
i _1
,
....
As you can see we have qu ite a few options here. The important thing here
is that there are a number of tabs that are common to several different
systems. The secrets, profiles and active connections tabs are all shared by
the PPP System and each of protocols w ill share these. The PPP System uses
four authentication modes as well depending on the protocol and service.
What is important to note is that the PAP method is not encrypted or
secured, when in doubt, disable this
method.
. '
PPP Secrets
[d
Password I
Caler 10 :
".
i.
II T
5eNice: ~1l)I
'0
' I- - - - - - , : ....
.-.....__....
~
...
__' r ..
Profie : jdeld
-'
---local .Address : I
........
Remate .Address:
Routes :
c-
,._
....
"
. ....
,.,
-' ...
"""",,,,,''0,,,,'0,,,,,,,,,,,,,,,,,,,,,,,
....
18
k erface
I ofj
1= U
lST'f
defilUl -
'~ Mms:...-c.
-
---
can use, as well as if they must call from a specific IP address. It also gives
you options for the local and remote address, but this can be specified inside
the profile that they use. We also have the ability to add a route when this
PPP secret is used. This can be use if you are using an IP pool in the profile.
You will not know the IP address that will be assigned to the PPP user, but
regardless, using the route here, will add a route to the IP that the PPP user
has been assigned.
PPP AuthentiCit on & AccC!'un:lng
- - ~. :._._
.,
190
1
PPP Profiles
N... PPP Prcfll.
Get_
Unto
Name .proIie l
... _.
....
it I ...
Reroof .e.daessh.ilOO!.4
...
...
OJtgong Pl.er
- -- -
."ddress list
...
ONS Server:
WillS Server:
'
no
r yeS
rno
ryes
Coillples~n
(i' de/act
- -- - - - - - ._ - - - -
Interlace
PPPoE Servers
Secrets
~e
Address
L
L
L
L
L
---
172.27.0.99
172.27.0.3
172.27.0.14
172.27.0.15
172.27.0.201
00:00.46
00:31:40
00:31:39
00:31:39
00: 31:40
PPP Server
New Int.rf".
Name l~l
Type [p~ p ~.;;.
Max MTU . [15()()
Max MRU: [ 1500
MRRU
..
._._Port [..-10
Modem .... [
L.J IU Modem
One of the hang up points on this method is that the existing serialO is
typically used for the console. If you are using a RouterBoard or other
hardware with only one serial port, you will have to remove the console
from the serial port.
192
Port List
r
l'
Serial Console
Bcud Rate
auto
Above you see the port list; you get th is by clicking the PORT button in
Win Box. This port button shows you
your serial interfaces and ports. Note in
Console
this example, it shows that serialO is in
+
use by the "serial console" this is your
Pc rt List
.----...,
1 ' 1'
't."lame
,ff'serial0
Baud Rate
alto
-r
Ao CortroI
none
Now you will see that the port list does not have a used by next to your
serial interface. This shows that you have freed the port. Now finish
configuring your PPP Server interface. You will need to configure your
modem init string. Typically this would be ATZ, to issue a modem reset, and
then the default configuration of your modem would be set to auto answer,
however, if you do not have the default configuration set you can also use
ATAO, however refer to your user manual for exact auto answer commands.
. - - - - - - --- -- -- - -
W Port List
= IT]
Name
~serialO
194
Used By
PPP P..2E-inl..?__
Baud Rate
auto
Row Control
none
.
,,
,,
Port: :sena/O
Modem 1n( .
...
General
rtJ Modem
:................
...
'"~
One of the big usages for this is with an out of band cellular data card. I use
these cards along with the PPP client, to have out of band access to core
routers. This works quite well, and will give you a backup method to get into
195
- - - - --- -_.._ --
- - _ .
...
---
196
L2TP/PPTP Servers
I combine the L2TP and PPTP systems together, because the setup is virtually
identical. Each protocol is a bit different, both use GRE protocol 47 to
establish the connections; however the PPTP system is TCP based where
L2TP uses a UDP stream. Which is better? I get asked that quite a bit. PPTP
is more common, and due to it using TCP it should be more reliable,
however, I have seen better luck with L2TP connections on lossy or other
high latency applications. If I had to make a recommendation, I would use
PPTP.
....... ppp
Interrace
PPPoE Servers
Secrets
Type
arne
J...;,. __
_ ._. _- _._. -
.&1ablec:L
.,
---
Profiles
Active Connections
IPoX
router.
As you can see the configuration for the L2TP Server is very close to the
PPTP Server configuration. Again remember by enabl ing th is server, you
turn it on basically on every interface and every IP that comes into the
router.
19
- -- - - - - -
- - - - -- -
--
11 lEiiiib"iea - j
.......
Max MTU:
[ 14~mml
r'" ...................................
MRRU:
i.
1
.
,.
i. '"
JI .I
- klthertication - - - - - ~ pap
~ chap
..", mschap1
[;;;'1 mschap2
---------- .
--
..
--'
198
l2TP/PPTP Client
Unlike enabling the PPTP or L2TP
Servers, the clients are interfaces.
When you create one of these client
interfaces, you will have to put in all
of the information necessary to have
that int erface estab lish a connection
to the server. In this case, on the DialOut tab. .you will find the IP address
that you will need to connect to, as
well as the username/password and
what profile that you want to use on
the client.
You also can set the
Authentication method you wish to
--~--.
Dial CAt
Tr.Wfc
51_us
..-
-_.._-
.. _.
......
Uoer: I.........c
cificenel
.........
...
Password : ;
.-
--
--,
- PJow
PdP
rnochapl
j ..,.;
chap
~ rnochap2
199
Bridging PPTP
RouterOS has begun to offer the ability to bridge your PPTP VPN connection.
This will allow you to create a direct Ethernet bridge, and allow you to pass
Layer2 Traffic across your encrypted tunnel. This only works in PPTP not
L2TP, note that. You will start by simply creating your VPN just like you
would if you would route your tunnel. Create your profiles on both sides,
with one exception . In this bridging
profile you will need to select a
8lidge 6~.~=-, ~-=-~.::JI[!J ...
bridge. This bridge is the bridge that
when your PPTP tunnel comes up, it
will automatically add the PPTP
tunnel into your bridge group for you. You will need to select this on both
sides of your PPTP link. Once this is done, enter your PPP Secret, and create
your interfaces, I would suggest using PPTP Server to create a static interface
on your server side. When the interfaces come up, they should drop the
PPTP interface into the bridge group dynamically, and you should be able to
pass traffic across your tunnel.
At the time of writing this, there are a few bugs in this application,
specifically the need to define the bridge group in the profile outside of
Win Box. Using Telnet, SSH or the terminal window is fine. To do this, you
will use: /ppp profile set profilenumber bridge=bridgegroup. Even though we
have done it in WinBox, it seems to not take effect until you do it in the new
terminal. Of course I have reported it! So this may be fixed in the version
that you have!
200
...
...
...
Being that PPPoE Servers run via Layer 2, you can add them to a bridge
group, Ethernet port or wireless interface. To add them, you simply need to
click on the PPPoE Servers tab under PPP. Here you can add the PPPoE
Service to your interface as you need. You can select what authentication
methods to allow as well as what default profile you w ish to use. Just like in
the PPPTP and L2TP services this will be for users that do not have a profile
from radius. The One Session per Host field will enforce that only one
connection can come from each MAC. This is useful to prevent several
connections from one MAC address.
201
user IS.
202
._._._-------~-_
. :.
- .
-
_._
~~~
~
Even if you are using this on a wireless or Ethernet interface, remember the
PPPoE client is an interface. So if you are doing masquerading, many people
forget to change the masquerade rule to have an out interface of the PPPoE
Client vs. the Ethernet or wireless interface. The reason for this, again, is
that the PPPoE Client is an interface, and you are no longer going out the
WLANl you are going out the PPPoE Client interface.
I do get questions about the Service and AC Name. The service name is the
name of the PPPoE service on the PPPoE Server interface. This name
normally goes unnoticed, as most PPPoE Clients look for any PPPoE service,
regardless of its name. That is usually the goal, get them on-line quickly.
However, if you do have the time to kill, you can use the service name under
the PPPoE client and setup the client to only use one PPPoE Service name.
This could be used if you need multiple concentrators in a given broadcast
domain due to speed and/or processor restrictions. My suggestion is to
leave this to a single PPPoE Server per segment, and ensure that you have
enough performance. If you have a failure, it's simple enough to activate
203
Multi-Link or MLPPPoE
RouterOS also offers Multi-Link PPPoE. What this service does, is gives you
the ability to bond multiple PPPoE Clients into one large pipe. To enable this
feature
simply
specify
multiple interfaces to run
Interlaces: r~i'
_Jl l ~
your PPPOE Client on . By
::: .. :J[!];
enabling
this,
it
will
automatically attempt a
PPPoE connection on both
interfaces. The PPPoE Server that you are connecting to must support
MLPPP. You will need to contact your provider to be able to verify if their
system supports MLPPP. Other than this, you will gain about 95% of the
additional connection, as there typically are some additional overhead, but
in all, a decent speed gain. Also this method is a true bonding, so if you have
2 x 2megj6meg Internet connections, then you will actually get on a single
TCP Connection around 4megj12meg.
__-_.'__________
.'
204
"
o ... .. ......
r~ ' --"
' ''--'
_
_ -_._1
JC!J
Ndmask. ,24
Ma><MTU . 1500
Deld
, .J
"' [ i ..]
Proil.: I. defa<.t
._....:
Certfic5e: 1none
AUh. ~ sh.1
~ mdS
Q>her
R:
blmofish 128
o ees 192
~ _ 1 28
[ ] ees 256
OpenVPN Server
The Server portion starts out just like any other PPP tunnel. You will need to
define a profile, and then create a VPN user under the PPP Secrets section.
Then you will need to enable the OpenVPN Serer. IF you read the PPTP
Server section, then you will know there are three buttons in the Interfaces
tab of the PPP menu. The last one is our OpenVPN Server. So to get to th is
you would click PPP -7 Interfaces Tab -7 OpenVPN Server button.
205
OpenVPN Client
The OpenVPN Client is an
.' New !nt.dace
interface like the rest of the
.
I
these.
You will also need to
Certlficate: !no~
..
r~
have the correct certificate
I really like using OpenVPN, the reason is that it gives me the security of
IPSEC, and when dealing with financial or private information, this high
security is a must. Moreover though, is that it creates an interface. This
interface is "SIMPLE" in comparison to route, firewall and do common IP
206
I,
I
II
Ij
I
I
I
207
,' ,
,',
__
L__ . .
1.. .
Os! . Port :
L______ __J.. .
Protocol:
[lJ'?'YL
El .
208
_0._. . .
~~~_
Action
Action:
Level:
~qujre
r~~~ult
Priority: [
' ]
. '0..
___..J
i -
======~
IKE Domain
The Internet Key Exchange is the
system that provides the "keying
for
the
ISAKMP
material"
framework. ISAKMP stands for
the Internet Security Association
and Key Management Protocol.
This basically provides a means
for authentication and automatic
management of the SAs we
talked about before. 99% of the
time the IKE is not doing much.
But if traffic is caught by a policy
and there is no SA, then that
policy will notify the IKE and it will
establish a connection to the
remote side of the link. The other
t ime it is running is when it
responds to said request from a
remote connection. When it does
this it has two phases of
operations.
Phase 1 is when the two sides
agree on what algorithms they
' N
sec Peer
Port: !500
hth. Method:
_-J
In"'t;;;;dk;;-- --l[]
r
_._--
--~-
Secret . ''
---'
-~
_J~
Exchange Mode:
;;il
maI"I
;::;." - -
<
1
;..;.
Ga
+I
o NAT Travetsal
P~Check: ~~
H.m ~ortthm:
[f!ld~
m ....m {~J
~ia1 PIgorlhm : ~ -
~=-~
DHGro<4>: !modp l 024
:[iJ
o GenerMe Poky
i
LJebytes: i
--
liekne: ld 00:0000
11
.]
i
_ J~ s
209
IPsec Peers
Once you have created your policy, you will need to create a peer. This peer
gives your system all of the information that is necessary to create a
connection. The peers are located on the Peers tab under IPSec. The peer
you will need the basic information, such as the remote IP address and the
port that you wish to use. Typically, you will start with a pre-shared key, this
is a secret that will be entered on both sides, and will be the starting point
for the keying material as well as the SAs. Make this a strong key, use upper
and lowercase letters, numbers and some symbols if at all possible. You can
also use a certificate to generate this material as well vs. a pre-shared key;
however the key is the most common.
In this section you will also set your exchange mode. I use, main 99% of the
time, and unless you know what you are doing with IPSec, I would suggest
not changing this. The option for the initial contact allows this peer to tell
the IKE to start a peering conversation. The NAT-Traversal option will only
work in some cases. This basically enables the Linux NAT-T system that helps
210
Proposals
- Auh. A1gOlirrn.
md5
_ ruB
Encr. A1gOlihm.
_ ruB
:'" 3de.
aes192
'" shl>1
r des
o ae.128
l'
L.ebme: 00:30:00
ae.256
....
Since we are talking about encryption, now is a good time to discuss the
different types of encryption and the performance out of each.
Most
people will know Triple DES, or 3DES. This is a very common high-security
encryption method that is wildly supported. However this Algorithm is fairly
slow in most cases. Performance and encryption using this method will take
quite a bit of CPU time and I would recommend at least a high end
RouterBoard or even better an x86 system.
The AES-256 encryption
method is DOD (Department of Defense) standard. This offers better
211
__ . _ --
- _
.. --- - - --
- -
Protocol
Used
Functional
Layer
PPTP
L2TP
No
No
No
No
11'11'
EolP
Setup
Complicated?
Protocol
Private
Data?
Max
Encryption
"
OAH+
400AH+
400
400
47
IPSec
TCP
UDP
UDP
or
2 or 3
Layer 3
Yes
Yes
Minimum
Hardware
Yes
DES
AES256
DES
AES256
RBI000+
RBI000+
A few other things that you want to remember is that IPSEC and OpenVPN
will require quite a bit of CPU power. OpenVPN is not difficult to setup, but
its more time consuming than PPTP tunnels. If you are in the need to ensure
that you have private data, things like complete customer financial data,
credit card numbers that are not already encrypted, as well as bank
information, encrypted with something higher than the MPPE. However, if
you are not transporting that information, use PPTP or L2TP, as these are
much simpler to setup, and troubleshoot!
212
-- - - - ~-
'J
213
II
II
,_
._
-_ _
l')1I:~1l'>
,~
U~f(U <l.
214
- --
I,,
back to the default settings as if you just put the card in and powered up
your RouterOS system. Remember though, all of your configuration will be
lost, and if you are using the wireless interface to connect to your RouterOS
system, it will be disabled and reset, so you may not be able to get back into
it again.
215
......
---
~>n
.~
"
_ _ ._.~
"
~.......
... bps
Default Chent TK Rate:
Default Options
... bps
,-
"'
j Hide SSID
216
Default TX Rates
MikroTik has proprietary wireless frame data that is transmitted with
M ikroTik w ireless devices. Th is data is typically ignored by most other
devices, however for MikroTik devices; we can specify default transmittal
rates both on the Access Point and on the Client. These fields will set these
options for you by default. These default AP and Client Rates will be
overridden if they are specified by an access list policy.
Scan List
The scan list is not normally used; however, if you have a RouterOS device
with super channel license, you will have the ability to put an access point on
a non-standard frequency center. The scan list will give your client devices
the ability to scan the inputted channels for your SSID. When you put in the
scan list, you will type frequencies separated by spaces to scan for your SSID.
217
--- - - -- -
Scanning
Scanning will allow you to basically see any broadcasting SSIDs within range
of the wireless interface card. You will need to setup your band prior to
scanning, and if you are using n-streme, you will need to enable that as well
see
n-streme
enabled
SSIDs.
before
you
will
[B]
rAdd''''~
SSID
Sarod
. BR. OO.I)C.42 2189:B6 2.4",.. . 2 4G ~ ' B
'ABR 1)2:0C 4221B3B6 ce-
24GH,.jj
ABR G2CC 4223B3B7 hotspot
2 4G ~,.jj
ABR C2.CC 42 23 838S ren-p-wds 2 4G ',,<;
5B ... ..
56
56
56
~1
Bl
81
Bl
) 3 I)OO~4Zp8:lJ 6
25 000C4 22 3B~ 6
15 000C42238366
25 00DC422389E6
'I
. R"""D... I
3.?3
.
:
3.23
323
3.23
51""
SlOp
II.
[" "'CI"'_ :
..
Coreect
[ Use
N~I"'OI~
J
I
This will also give you the MAC addresses of your access points, and if there
is MikroTik proprietary extensions transmitted, such as radio names and
RouterOS information. You will also see the signal strengths, SNR and noise
floor information. By clicking on one of these, you can then select connect
to automatically change your wireless interface to station mode, as well as
set the proper ~SID and frequency.
18
,_.~
II
\
\
Sniffing
The Sniffer is another wireless tool. This is bas ically the same as the packet
sn iffer tool, but inst ead of having to be connected to a wireless interface,
this pulls packets out of the air. You can use multiple channels, as it does
not look at SSIDs. You can also use this in conjunction with a streaming
server; this is covered in the packet sniffing section under RouterOS tools
more.
II
219
j,
' FleQ.Jenc
,,1..
"'1
~
~
;Z
!ji
' '''
10)
~<I)
,.~
fi;)
'H'
fiXl
"',
!Banti
I,., ............"
jAddrp-ss
~
,
00.0C.42.23 89.86
020C.:42:23 89 86
020C42:23 89 87
02-0C ~ 2' 23 ' 89" 88
, \SSID
2 4dp2
cam.
botspot
temp-wds
--
Ilf~Freq 17.:)
431
1.0 1
1.0 1
1.1 1
11 I
29 1
00
00
00
00
00
00
0.0
oU""
"
;"
~
-rz
_ _ "
2 4~
24.8 .
25.1
25 3 .
'
BdI'ldwidth
Net [ Stet, ..
38.0 kbos
4
4
8.9 kbcs
1
8.8kbD'
1
9.0 kbas
1
S 1 kbas
1
240kb"
C
0
0 bas
C
0
0 ecs
C
0
0 bps
0
0
0 bas
0
0
0 bps
0
0
0 bos
0
0
0 b"
0
0
" . __. ' __ . ' __' ._ _
.. _
220
Bands
There are a number of bands that RouterOS will operate in. The IEEE
standards typically apply unless you are using RouterOS with a super channel
license. You have 802.11B or BIG modes, very common, but you can also
turn off the (SMA protocol with
8
802.11b and just run G only with all air
rates. You can also run G-Turbo mode
as well, this uses a 40 MHz channel
size vs. 10 MHz. Doing this in 2.4 GHz
typically will reduce the number of
non-overlapping channels to about
two, but sometimes will give you higher than expected data rates . In a
wireless ISP scenario, I would stick to the smaller channel sizes.
You also have options for 2GHz 10 and 5 MHz channel sizes. The reason for
these options is to have more channels available, and to reduce interference
221
WDS-Slave Mode
The WDS slave mode is basically an access point, however, it connects to an
AP-Bridge radio cards and forms a WDS connection. The only difference
between this and the AP-Bridge mode is that if the primary radio, the one in
AP-Bridge mode changes channels, the access point in the wds-slave mode
will change channels accordingly.
222
223
MAC Authentication
I will start off this section by saying; MAC does NOT provide security on your
network. By using MACs to control access, you are telling the access point
that you must have xxx MAC address to connect to the access point. Keep in
224
:::..=J
You can also select a transmit key. This allows you to connect to the Access
point without the key and then the key is given to you so that you can
communicate securely using WEP. You will need the mode as static keys
optional so that they can connect and get the key before they start using the
key.
With that said, my recommendation is to NOT use WEP . WEP is outdated,
originally created in 1997. With any Linux based laptop for the most part it
takes about 20 seconds to break. It's considered very easy to break and
should not be used if you are wishing to have a quality secured wireless
network.
225
.. --- --
~...
"~""""""""""""~"""""""'"
Mode: 1
dynamic keys
, ,, '" .... " ......
.- Authentication Types-_._._.--.
n""
': .,
. .}i""".,
-.-----
,._,
t..., tkip
- -....-...---
[;OJ tkip
r
,-
You will also be able to select what kind of Ciphers as well. Most users will
be fine using TIKP ciphers; however, if you are security conscious, you can
use the AES-CCM ciphers as well. RouterOS can run WPA and WPA2 at the
same time, and if you wish you can specify different shared keys for each
method.
Once you setup your security profile, you can then enable it on
your wireless interface by selected it in the security profile dropdown in your
wireless interface.
226
...
00011000000 00
Interlace: . 11
s~
Sttenglh Ronge.
.~
...
...
AP Txlmit
CienlTx l r i
r:-
----,'''=1
~
,.....- - - - - - ,
lh<.
... Time
,wi
mon
"", tue
-! ., 1d 00:00:00
'" wed
'ItI;
thu
."l lr;
These rules, like other ordered lists in RouterOS run from the top down, in
order. Once a rule is matched, the processing stops. Th is allows you to
setup times when the rule mayor may not match, allowing you to allow any
MAC to connect during lunch hour, but otherwise, only allow a few MACs to
connect. Remember that this is not MAC authentication only. If you have
WPA2 running, then you will still need that WPA2 shared key. But you can
also set that a specific MAC address must have this specific pre -shared key.
This will allow you to setup different pre-shared keys for each MAC that you
have connected to your access point.
The Signal Strength also limits the Access Point to only allowing clients with
strong enough signals to give good quality connections. An example is in
802.11b, a -70 is typically what is needed to have an llmeg Air Rate
227
_._-- - - - -
-.I
,
Learn RouterOS by Dennis Burgess
Connection. With a ru le like the one above, every MAC must have between
a -70 and a 120db signal to be able to connect. Remember though, if you
create a rule like this, you then need to specify that anyone that doesn't
match that rule would not be authenticated by un-checking the
authentication check box.
You can also limit a customers forwarding ability. This prevents the cl ient
from talking through the access point to another client directly connected to
the same access point, or c1ient-to-c1ient communications. This does not
prevent a client on access point A from communicating to a client on access
point B.
,
I
,
I
The TX Limits are for MikroTik CPE or clients. They can be in any wireless
mode that connects them to the access point. Once they are connected, you
can add an AP and Client TX limit. This will limit the TX speed of the access
point sending to the client as well as limit the clients transmit speed sending
to the access point!
This information is embedded in the MikroTik
proprietary wireless frame extensions, and will not work w ith most other
non-RouterOS clients.
28
Uptime
00;5055
AP
VI
"0
no
Lmt k it",;
S9't
0.500
I;:::====~I
I
I
I
I
I
I
I
List I
I
I
I
I
I T
I
I
I
I TOJch I
OK
Remove
Reset
Copy to Connecl
Ping
MAC Ping
elnet
229
. . _
"'
~.
L.[
....
.-
~.
An example is that you can say connect to SSID 'Towerl' only if the signal
strength is above -70. If it drops below that signal, then it will disconnect
and start searching for another connection . The 802.11x standards will not
drop a working access point for another with a stronger signal unless the
signal of the currently connected access point drops below the allowed
range. So once tower 1 drops below that -70 level, it will disconnect and
start looking for something else.
Another thing that is handy is that you can have different security profiles
associated with different rules and/or SSIDs. Some wireless ISPs will use a
standard load on a CPE device, loaded up with SSIDs, security profiles and
signal strengths settings for installers. This way, once they point it at a
tower, it will automatically connect with the right security profile for that
access point, assuming they have enough signal strength. This creates a
simple method of having installers performing installations without having to
have the installers knowing all of the security keys etc.
230
I
\
I
,,
,
I
I
231
awns
..
..
._.
__
" ....
~.J
You will need to be careful, remember, even though you have two separate
SSIDs, they are still on the same channel as the master wireless interface.
They share the bandwidth of the frequency they you have them connected
on.
232
HT MCS
\.\IDS
Nstreme
TK Power Statl.lS
TI~lflc
".
N-Streme is a proprietary
Enable Polling
R: Disable CSMA
extension of the 802.11x
design that MikroTik created
Fremer Po6cy ldy~allli~ si~emm. ~" . m
m.".....
m:'] ! 3
Frames Limit: [4000 " ,----", " --'" ']
to overcome some of the
limitations
and
increase
performance of wireless links.
This is only supported with
MikroTik RouterOS running on both ends.
The goal is to increase
performance typically at the cost of latency. N-streme does a few things,
including compression, polling, and no limits on distance. It will also
combine frames similar to the way M3P does as well.
To enable N-Streme on your access point, you will simply need to check the
Enable N-Streme button on the Nstreme tab of your wireless interface. Here
you can also set your framer policy, limits, polling as well as the ability to
disable CSMA. Once you check this box on your access point, if you had
clients connected, they will be disconnected. You will need to check the
corresponding box on your clients as well so that they will connect. Also
remember that when you are scanning with N-streme enabled, you are
looking only for n-streme enabled access points, not standard a/b/g/n access
points.
In typical usages, nstreme mode will provide higher data throughput,
however, typically increase latency a bit. This is mostly due to the
compression that occurs in the link. There is also no limit in the ACK timeout
values, so you can go greater distances vs. running standard 802.11x. We
have seen 52 Meg connections using 5gig-Turbo modes and N-Streme,
however, with 802.11n; this performance is upwards of 70meg half-duplex.
This is not what you will get all of the time, typical link performance and
path analysis should be done to determine what your actual throughput may
be.
233
i+
.. .. .,-- ... ,..... ..
"" ..
h Radio:
'
~.-.
",,-.,""',
~M
. . . . . . . . . . .. . . . . .. . , .. "
.................,[!]
Ix Frequency;
_............"
: MHz
5 180
=--~
.J Disable CSMA
!+ ]
_.-J
---
R" SignalStrength: .
This w ill
create
your
new
interface. Th is interface will use
two radio cards to provide full
duplex throughput. It does th is by
allowing one card to receive on ly
and another to send . On the
Nstreme Dual tab of your new
interface, you will need to setup
what rad io card is receiving and
what one is sending. These would
be the TX and RX radio sett ings.
h SignalStrength:
....
m' "
, ,
, ..,
" ..
_ ,,, ,,
..
R" Rate: I
TxRate:
.... ,
"........................... 'j
~:O==-IO::- __ ~-====~
lQ!D:_ _.....
.. .
roo ...
Tx Retries Timeout:
l.0
J
.
__,j
..... .
'.. .. ..,
One of the most common
Tx Henies Lost: 0
j
mistakes that are made in the
Rx Sad Seqs: D
__._ -r-r-r-.._1
...
Nstreme
is that
once you
Rx Duplicates: 0
configure one end, you w ill have
Comecled
frequencies for TX and RX; these
frequencies are flipped on your
remote system . 50 the example is
if yo u transm it at 5180 then you
have to receive at 5180 on the remote side. Th is is a com mon mistake. The
234
235
,-
On the remote end, you can use station-wds, or even bridge if you wish. If it
is simply a point-to-point link, then I would use Bridge on your main site and
station-wds on the other. On the station-wds side, you would also create a
bridge group, add your Ethernet interface and then configure your stationwds wireless interface with the proper WDS type and default bridge group.
Upon the link coming up the wireless interface card should be dynamically
added to the bridge group.
r .. . . .. .
.... ._...... . ...... .. .. . . .
,Ei ~..,.Ia.'21
\J{irel,,~~ lAJb~r.9.~.)]lJJ .
You should also notice a
i DRA
4 '~w dsl
WDS
WDS
interface
dynamic
created on the bridge side,
as well as it being added to
the bridge group as well.
:_- - - - -
If you wish to use static WDS entries, you will need to setup your wireless
interface WDS settings to static mode, and then you will ,have to have the
remote MAC of the radio cards you wish to form a WDS link to.
236
237
"
-- - - - - - - - - - - - - - - - - -
238
Hardware Selection
Selection of your hardware is necessary now. It is ALWAYS better to have a
larger antenna and lower power radio. Antennas amplify in both directions;
they have receive and transmit gain. If you are using a 20dbi antenna, that
means what signal it receives will be increased by 20dbi and the power going
from the radio card at 12dbi then is increased by 20dbi as it leaves the
antenna. IF you can use a 60mw radio card and a 20dbi antenna, it will be
better t han using a 600mw radio card and a 12dbi antenna. Again, lower
power output larger ant enna, of course this doesn't work out all of the time,
but it will help. Last thing, is that when dealing with backhaul links, don't
skimp on the CPU power. Go with AH RouterBoards vs. the cheapest thing
possible!
239
Antenna Alignment
Now that you have the equipment selected, the antennas and coax installed
etc, now we need to go ahead and align the link. Again, start with the
simplest configuration, no security, a simple SSID, etc. If possible, get the
units to connect on the ground before you put up the link. Then go ahead
and put up your link. You should have done your link planning prior to
putting up the link. You will know about what dbi you should receive on
each end based on this planning. So if you have a 10 mile link with 19dbi
antennas and 320mw radios, you should have close to a -70dbi signal on
both ends. When you align the links first start with your horizontal or side to
side azimuth, and then once you get the signal as much as possible that way,
drop in from the highest point where you lose signal and go till you get the
best possible signal vertically. The idea is that you want your antenna with
as much up tilt as your signal will allow. This will prevent other ground
based interference.
Signal Issues
240
processing.
241
._ ._ - - -
_ ._ -
,
!
Try some variations of Nstreme as well, such as larger frame sizes, and
dynamic frame sizes. The goal is to find the best settings for your link and
every link will be different. What works on one link may not work on
another! One last option for more speed, is to try using turbo channel sizes,
and if you can't use Nstreme, try turning on M3P as well on both interfaces,
this could save you quite a bit of bandwidth as well. However, there is
already some compression done with Nstreme and I have found M3P
doesn't really help too much with Nstreme turned on.
242
Wandering/Fluctuating Signal
A w andering sign al or fluctuating signal would be +/- 4dbi of signal within a
few minutes. So if you just installed your link and the signal is changing
wildly, again, 2dbi +/-, then I would go ahead and look for issues. If this is a
new link, then I would first look at Fresnel zone issues. Move one side of the
link up 5-10 foot and see if that changes things. If this is an old link that just
started to have this issue, I would ask if the issue could have started with a
recent rain or freezing weather. If so, then chances are you have a water
intrusion issue. Remember, those N connectors and cabling needs to be
wrapped extremely well to prevent water from gett ing into them.
Bad CCQ
Bad CCQ can be a result of low or wandering signal, so check those first.
When your CCQ starts going down, see what air rate you are connected at,
again, Fresnel zone issues could be the culprit. Make sure trees have not
243
244
'j
1
1
I
!
I
:,,
,
I,
I
I
l
245
246
\
I
I
\
I,
I,
,
,
,
/
I
i,
~
j
247
Prerou ti n~
Ma ngle
Global-In
Oueue
J -_ ... _ .. - .. ...
Global Total
Qu e Uf~
tr.terte ce
Qceue
-"---
---
OUTPUT
IN IERFAC L
48
....... ,
GlobiJl-Out
Queue
c. _.
I
I
INPUT
INTERFACE
<;;"lt~~
D.c. ...... '
Input
Mllna le
Forwa rd
Ma nq le
l ocal
Proce ss-In
~l
<f:~
'O.c15Jo
/
postrouti~1_
ManCI -l" _.
Output
M" nqle
-!
loca l
"'"
P rocess-O u ~
"AII-download"
Parent
parent=Local-interface
Parent
"VIPs-download"
parent=AII-download
Child
Child
"Other-download"
"VIP2-download"
parent=AII-<iownload
parent= VIPs-download
Child
"VIP1-download"
parent= VIPs-download
249
j
,,,
,J
I
bandwidth available. Keep in mind that even though you have a limit-at of 1
Meg for each of your 10 customers, if you only have 5 Meg of Internet
connection, then you really can't guarantee that bandwidth. But if you have
20 Meg, and other customers that don't have a limit-at rate at all, they are
not guaranteed any bandwidth, your customers with the li mit-at w ill receive
the bandwidth and then the customers with only a MIR or max-limit will get
what's left over. The Max-limit is defined as; during a best case data can
flow up to this limit, assuming that there is bandwidth available.
There are a few rules as well for the bandwidth distribution using your
queues. First is that your max-limit of the parent must be either greater
than or equal too, >=, the sum of all of your child limit-at's, and the max-limit
of all of your child's must be less than or equal to the max-lim it of your
parent.
Reason to Use
Pros I Cons
RED
PCQ
To configure your queue types, you will need to go into the queu e types tab
under queues. Click on Queues -7 then the Queue Type Tab. Here you can
specify queue names along with their types and their configuration s.
251
, Pad<et
PFIfO Lorn"
byte and packet FIFO queues.
./
I Cheel< !
I
CMlu.
I
They both work the same way
SIZe
I
I
I
just on different types of data,
/' ~-Oueue SIZe ~ ,
I
0'01> '
I
,, Packet r--,~
PF'FO Urn"
I
one works on entire packets
I
I
I
I
vs. the other working on bytes
. ....
of data.
'
"
252
-~
I typically do not use RED in production, there just simply does not seem to
be a need for this in most cases . However, your situation may warrant such
a queuing system, and it is built in with RouterOS.
253
SFQQueues
SFQ or Stochastic Fairness Queuing is the way to go if you are looking for
great QoS implementation. This system will take advantage of priorities,
max-limits and limit-at's in
your queues. It works by
SFQ
using a hash value from up
IN
OUT
,, -- - - - -- - - -----,1
to 4 different classifiers,
I
I
...
,, HashL_. ..i
I
I
typically but not limited to
I
I
~ ~~1
I
using both source and
I
Round
r'-!
0.001
.... ...... .
...
I
I
~
Hashing
Robin
I
...
I,
Allot
destination addresses for
I
Pertub
i
,
I
I
,
"
Hash
most
types
of
..
.
I
I
I
,. ~ff I t
!
I
implementations. Then it
I
I
I
divides that traffic into
1024 sub-streams, and then
performs
round-robin
between each of those substreams. Even though this queue uses the most CPU time, it is absolutely
great for traffic prioritization and QoS implementations with RouterOS. With
this queuing system, you can guarantee data rates, provide the QoS type of
services based on types of data, as well as ensure VolP quality.
'
PCQQueues
Per-Connection Queuing is a MikroTik Specific queue type . This was
designed to simply distribute traffic evenly across a large subnet and then
provide the ability to limit each sub-stream that is created while maintaining
a super low CPU requirement. PCQ works by taking classifiers, and then
based on those, forming
sub-streams. Each of
PCQ
those are basically an
IN i
-=-O~T
individual FIFO queue.
I
I
In most WISPs and ISP
I
1
' FIFO 1 I
1
implementations,
the
' ~!~6::!]
:[G;;;"P'';
1
FIFO I
idea is to have an entire
~
+ by
.e:;:: : FIFO 3 ] ~
Total i
Classifier
1
1
...
subnet have the same
F'FO Ouooesa " I
1
PCO ToIal L
,
I
FIFO
n
1
""" 1
for
each
max-limit
I
1
fifO Ow."Ul,I Siz.e
individual IP address, or
I
1
PCO WmlI
to share an amount of
~
L..__. _.._._ ..
254
pcq-rateeo
max-limit=512k~
2 users
7 users
-256k'"
- 73k
-13k
-73k
-73k
-7'3k
-73k
-13k
-256k"
..
..
..
..
..
..
pcq-rate=128000
max-limit=512k
2 users
4 users
7 users
-128k",
-128k",
-128k-.
-73k
-73k
-13k
-13k
-73k
-73k
-73k
-l28k-.
-128k-'
-128k-.
..
...
..
...
..
...
..
If we specify a pcq-rate,
now we are adding that
individual rate limit for
each of our sub-queues.
So in the example above,
when we had two users,
they could use 256k each,
however now that we
use more than 128k individually.
255
Using PCQ
Now that you understand how PCQ works, I want to go through on how to
configure PCQl First, we need to create two different PCQ Queue types, up
and down. This will help us identify
,..---' - - ' ..
traffic that is considered up, or going
Type Name: i, ..upstr earn
'
out to the Internet from our
..,...----T, + !
Kind [p cq _
l-.-..J
customers, and traffic going down,
or
to
our
customers.
Rate:
" ". " , ,, ,,
ro
I ..
Limit:
[io--
'"""
"
... ,. , .. , .. , . , .
"..,
256
Kind: pc
::::!..q
...J.....:.....
L!:
!
"
Here: 10
:=:===~
50=========
Limit: I~
Tolal Limit: 2000
Src Pori
Dct. Port
Once we have our PCQ types and rates per customer, now we need to setup
a rule to match data from our customers, and then setup max-limits that
that queue can pull. If you don't set a max-limit, then the PCQ will assume
that you have 100 Meg or whatever your Ethernet connection is, and not
divide up the bandwidth accordingly. So you have to setup a rule that knows
how much bandwidth you wish to divide evenly between all of your
customers!
So now we create a simple queue rule, under advanced we select our upload
and download queue types to
our new PCQ Queue
G........ Advanced SI_, TrolflC T01 01 To1oi Stllittit.
types that we created.
Name.
WE specify our target
T..getAddr..., 100.0018
address so that we know
'" T..gel D...'*"d
what data we are aim ing
0;
3M
,. 4
for, in this case our
T..gel Upio<ld
private subnets, and
Limit Al U'1limrt ed
brlS/.
then specify a Max-Limit
Queue Type' .upstreo..r:!!.
so that the PCQ system
knows where to start
dividing the bandwidth up
at.
~
~~"
, ..1
257
lE =
-
--
Queue Tree
Queue Types
j"IJPdlent
Name
aDdownioad , . _.,--.local ether3
..
aD-download
VlPsdownload
Vl P1downioad VIPs-downioad
VlP2download VIPs-downioad
other -download
aUdownload
--"""'-
00
Reset AI Cour~ers
Packet Mark
5M
4500k
4M
4M
4500k
.._.----~-----_._----
VIP1_packels
VIP2_packels
otherpackets
2M
1M
1M
3M
As you can see from the above image, you can setup multiple parent queues,
typically though, you will setup the main parents on the actual interface.
You do this by specifying the parent as the interface you are going out. You
would then need to create a second set of rules, just like the one above,
however, this time; you would create an all -upload queue with a parent of
the WAN connection. It is also important to note that any simple queues
that match traffic that would normally be matched by your queue tree, will
take that traffic and not allow the queue tree from processing, as simple
queues are processed before the queue tree.
258
259
....._
.~,
The example to the right shows you how you can setup bursting for your
customer. In this case the customer will receive a burst of 2 Meg for roughly
30
seconds.
That
assumes
Mbps
that for the last
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_
~u~t; l i m i t
4
60 seconds they
have
not
x-limit
transferred any
3-+- - - - - - - - - - - 9u""
data. Bursting is
~llcw.d
a tricky subject
Burst-threshold
2
and I have some
graphs that will
Average
rare
help as well.
1
~.
Bursting works
by looking at a
variable called
260
10
Bu rst-ti me
15
20
[ItT-:1~i;;;~---=-
I a
'
8
7
6
5
4
3
2
1
"
Mllster
P8
P7
P6
P5
P4
P3
P2
Pl
'
100M
100M
100M
100M
P8
100M
100M
P7
100M
100M
P6
100M
100M
P5
100M
100M
P4
100M
100M .._-_._--_._---_._---_
----_._-_
...P3
100M
100M
P2
100M
100M
P1
_._-_.__._-_.
. ~- '-
" _
"._._
"
, .,....
".
'
"
, . _ . .
,,_
,_
__ . ' "
",'"
, .
261
By using SFQ queue types, as well as using parent queues, you can start to
create quality of service, QoS,
systems.
In the previous
,
Parent: Master
+
,.
image, you will see a basic core
router QoS System. What this
does, is simply identify data via
the packet marks, and then apply them to the master queue. Th is master
queue has plenty of bandwidth, so we are not limiting bandwidth except for
100 Megabit, however, in a single clock cycle, packets that are P1 will go out
before packets with a status of P8. These are arbitrary identifications, we
use the mangle system to mark packets and identify them based on the type
of traffic. To set queues as sub queues, simply click on the advanced tab of
your queue and set a parent queue. In this case, we use the Master queue
as the parent. This means it will share bandwidth with the master queue.
,l
,
,
Na...
2
0
CL
,
4
it F~leni ToIdl
6 V:)P fralhe
~.er~ t'm!=:nt
Packet Marks:
Vop
.M~fl_dJl~f!!~.~1
Web/E-Mall
-~. -----,~-
[ Ise
lRIt U"", At
!T'I LIm~At
unllTllled
un.rn~ed
3M
3M
unlrmled
unlmited
..~.~.~
3M
3M
",--
unlinll:ed
..
-----_.~._._.-
unlim~ ed
Pncny
. ,,
f
B
1
..2
_-
A basic VolP QoS system is above. This assumes we create the necessary
mangle rules. We identify traffic going to and from our VolP Server as VolP
262
263
-- - - - -
264
265
~jN:lme
. ..
Burst PCQ
Standard PCQ
Parenl Total
10.0.0.0/8
Bur st PCQ
Now that we have our order of importance, note that we have a parent total
rule . This is going to be a parent of both of our PCQs; we have to know how
much bandwidth we can allot as we only have a 3M Internet connection, so
we need to still limit that.
I II I
m arne
I 2
Parent Total
I .. 1
"'"'',.'" 1llil:- Standard PCQ
PCQ
,.-. o .- -,- ----_ 1llil.' '"" Burst
,_ .._._
.,_.._.._.,._._
__
~ ._
_~
3M
3M
10.0.0.0/8
__''_''"'_' 3M _.. ,. - _ _ 3M
__
- - __
- .. - _.n
3M
Burst
_ __ .- _._,,. .. _.._ 3M ..- - - - ---_._.,-_.- --- _._
.._.. PCQ
__ - - - ._.
" ""''' '' ''''~ '' _ '' _' ''' '_ "' ' " ' '''' " '' " '' '''' ' '' ' ''' ' ' _ ' '_ '
.-
_-_
_.
What occurs is that as new connections are being created, until they are at
10 Meg of data transferred, customer will be able to get data transfers up to
2M. This gives them quick access to small and short connections, but once
they go over that 10 Meg transfer per connection, it then drops down to the
266
267
I *' I IN ~e
2
1
[
g_
1
.....-3...... . ..... ..
~.$J!~~r.
_
~J;()ld_........... .
mBasic
3M
J f:'1
J t,L '"
3M
3M
_ }f:'1
?ilye,-packag.~ _
J t:A.............. ._ ~QI,jF.'..~f~~9t:l
.
3M
Basic Package
With this system, now each one of your customers get different peQ
bandwidth packages. If you wished to as well you can create a Queue that
has a limit-at that guarantees bandwidth over other queues. Keep in mind
that you will also need to specify the SFQ queue type in your parent. If you
do this, you may have business customers that are guaranteed bandwidth
vs. your other customers. You can simply change the priority as well in the
queue to ensure your higher priority customers get higher allocations of
bandwidth as your parent's bandwidth becomes scarce.
268
269
270
,
,
I
I
I
I
I
,
':,
I,
\ \
I,
I
I
,
I,
,
I
I
,,
I
I
I
I
I
j
I
I
271
\
I
I
Hotspots
272
Paid Hotspots
As a business owner, I like hotspots. The reason is they can make me
money. In areas that I already have Internet bandwidth available, I can place
a paid hotspot system using RouterOS into an area that has many transient
users, or users that come and go, and allow them to pay for Internet services
with a credit card and ga in access to the Internet. The best part about these
types of hotspots is that I don't have to ta lk to the customer, take a credit
card over the phone, have a 24 hours sales/support line, or do anything
more than typically setup the system. The funds are deposited right into my
account, so I don't even have to take a check to the bank!
Paid hotspots are very common today, any place that people gather that
would like to have Internet connections are a potential place for a hotspot.
Hotels, and coffee shops are greats places, as well are restraints, truck stops
and rest areas.
Free Hotspots
Regardless of what many think, free hotspots can make money, and yes I did
just use the phrase " make money" and the word free in the same sentence!
Most free hotspots are not the main attraction. An example is a coffee shop
or restraint would put in a free hotspot system to attract more coffee
drinkers and business people. The idea is that now they can stay connected
with their laptops to their office even though they are having a coffee or
lunch! These hotspots may exist solely for free as an added extra to your
meal.
In the case of the coffee shop or restaurant, it's a hard case to make money
on a free hotspot, but if you have a hotel, gas station, truck stop or rest area,
you can make money with a free hotspotl The idea is simple; you sell ads to
businesses in the area that someone may be interested in! An example of
this is a hotel that has a pizza shop that w ill del iver pizza to the hotel. Upon
the hotel guest starting their web browser, they w ill get these ads delivered
273
Definitions
There are some definitions that you should know about before we get into
the configuration of RouterOS with a hotspot system. We will cover those
quickly so that you can get started!
Splash Page
The splash page is the initial page that RouterOS will display if a user is not
authenticated. A new user will connect to the network, and upon starting
their web browser, they will be redirected to the splash page. RouterOS
supports customization of the splash page. This page is stored locally on the
hotspot router, typically as login.html.
There
is
also
a
redirect.html
that
points to the login.html file if you wish to do some form of redirection vs.
displaying the page from RouterOS. RouterOS does have a built in web
server to deliver these pages, however, there is no server side processing
built in, so these pages should be simple html and client side application
code. The default folder for the hotspot splash page, html and images, is
called hotspot.
274
Walled-Garden
These are resources that you are going to specifically allow users with no
authentication to access. An example of this is that pizza shops website we
talked about in the free hotspot section. Items that you list in RouterOS
walled-garden users will be able to access without authentication to your
hotspot. RouterOS has two walled-gardens, one is an IP walled garden,
designed for you to enter IPs, protocols and ports into for allowing access,
and the second is the standard walled-garden. This one allows you to enter
hostnames, and DNS names into the system to allow un-authenticated
access.
Bindings
RouterOS offers an IP Binding system. This allow you to setup one-to-one
NAT translation, allows you to bypass login/authentication requirements to
specific hosts as well as allows you to block specific hosts and subnets from
your hotspot system.
Hotspot Interface
Hotspots run at layer 2 in the 051 model. Therefore they are applied to an
interface. When you apply a hotspot to an interface, once the setup is
complete, you will assume that all devices, MAC addresses, and IPs behind
that interface must authenticate somehow. For this reason if you place a
hotspot sever on the interface that you are currently running on, you will
typically be disconnected from the RouterOS interface until you
authenticate.
275
- .
--
- --
--~--
Servers
Server Profiles
+ Q t:JL:J -_._
y __R, ;,~., _..
-_.~
~~.~~-----
,,_
",
, .,II
Next
_~
i,
Hotzpot Setup j
,., ., ..
,",.""""',.~,,,',"',
.,
I L~~~ncel
R] Mesquerade Network ,
"""'c~~~~i"""1
'. .
I' ~
' . ~
L~.'
j Address Pool of Netwoik: I'0 552-, 0 -5;5 ~54 J ~ ,
.
. ' .
'
l!. '
.
"
276
Select Cellificate:
Beck ]
Beck
Next
II Cancel 1
ImJm:
Next
I I:. Cancel
'"
Back
1~
'I
277
is
to
create
a
local
process
Narne of Local HotS pot User:
for
username/password
Password for the User: L
.
authentication to the hotspot.
If you don't do this, then
f
Back 1I _Next
_...J1
Cancel
. '"
there
would
be
no
username/password for you
even to login with . You can
delete it later, but it does get created with the wizard.
r':'m ---====.
'
As you can see there are lots of functions that need to occur to get the
splash page from a RouterOS system. I do recommend using the wizard as
well as it does all of the things you need it to in one easy to use interface.
278
LOgln RADIUS
'l
MAC
HTT PGtAP
HTTP PAP
'" CoolUe
HTTPS
Tri.ol
I
I HTTPCook", Lletine: 3d OUoo 00 _
L:..
none
00:30: 00
1d 0000 OO
=.-....,
default
279
These can
The default method for Logins is HTIP CHAP. The splash page that comes
with RouterOS contains code for the browsers to CHAP encrypt the
username/password. That along with the splash page allows users to type in
there username/password. This is the simplest of hotspot logins and is
supported by RouterOS. HTIP PAP is the same method howeve r, the
username/passwords are sent in plain text. The HTIPS method is the same
as HTIP PAP with the exception that you have a SSL Certificate installed into
RouterOS that the hotspot uses to create a secure connection with the users
browser. I typically don't use this method as the HTIP Chap method works
quite well. I also am not taking any sensitive information via the web server
on the RouterOS System, so I don't think having to have a SSL page is
necessary.
Hotspot Cookies
The cookie method is really an extension of the other HTIP methods,
including the HTIPS method. Once the user logs in via their username and
password, the MikroTik will generate a cookie to give to their browser. This
cookie is good for the HTIP Cookie Lifetime value. Th is cookie has
information in it to identify the user. If the users logs out or leaves and then
comes back and connects to the network within the cookie lifetime, the
browser delivers this cookie automatically to RouterOS and the hotspot
system and if the user account is still valid, this cookie w ill log them in
automatically, no need to type the username and password aga in . You can
also look at any assigned cookies, as well as delete them via the cookies tab
under the hotspot interface.
280
281
1''"
282
Server: all
Password [
Address
. :
. -r-r-r-r-r-rr-r-:
MACAddress [::
EIMil: [ -
::::::: : :
..
Nome ,
mJ
,- " -",_
----. - - - ,
, - ,-
'J
Address Pool: no ne
Session Timeout.
......
J
...
Rate Limil(r><!txt
Incoming Fater
Outgong Fdter
[~::::=:=
..._.,-" -"---III]
:!]
. . . . - - ' - - - - -,";'1
.
_~
e1wa~_, ,,
:!]
283
Using IP Bindings
IP Bindings is a way to setup One to One
NAT translations, but also it's used to
bypass
hotspot
clients
without
authentication. You can also use it to
block specific hosts or subnets as well.
I ....
--'
,
Server: c::1
alcI -_ _
Type: regular
... -
.,..- - - -
284
r.
~
S IC.
r:
allow
"
Address: :
"",
,,, ,
.. ,., ,
, "
Path: i
"
"
L! ".Iinklechs net
Dsl. Port; i
Dsl, Hosl:
deny
i ....
Src. Address:
...
....
_--,.-.::::1 ...
285
-:. .Yl
PS
H
D
AH
AH
D
6f:1.
j "
MAC Addres.
_.. .. Addre.,
..
..__ __ ..,..,.__ .-.._
uoo:22:3F... l0.590.196
000:AOC. .. 10.5912
000:1143 10.59.0106
0 00:1 8'39 .. 192.1681100
000:18,39... 10.59.0.53
00:OF 66 ., 10.59069
000:1F,33" 192,168,1 ,5
,,"QQ: lf}L.l,Q?~ .Q)g .........
....__
AH
~ :&_.
~._
,,_.~
!B : l g;[0l:~1;l;22[ 22
',::C
""'-
ITo
'Server" .,......
!Idle Time
' ,A, A...
,,,, ,Addle,.
, _ ,,."
_
1059 0196
hotspoll
ld034841 obps
105912
hotspotl
10 48.42 0 bps
1059 0106
hotspotl
03 08430 bp.
10.59.0144
hotspotl
0300 34 0 bp,
10.59.0,53
hotspotl
025810 0bp,
10.59069
hotspotl
0242 33 0bp,
10,59,0,86
hotspotl
02:38 110 bp,
10 ?~ Q, ~l~_h..".tJP".!L._..
" 0~ Q5)~ QIoP' "
1,Q.59J1~3B
nO!!P910211 0 p
"._~._
' , "
, _
, . ,. , ."
" , "
"
, _ . "
"
' ~ , , H
,,...,, n
IT, Aate
Obps
0 bps
ll bps
_...............
. . _ '. . n~m'
Gbps
Gbos
Obp,
Obp,
O,IoPl_
a bill
"
On the left we have letters that identify what the host is currently doing. A
would be for an active host, this would be a host that has been
authenticated . 0 is dynamic hosts, these are typically customers that the
universal client had to dynamically assign them a valid address to get them
work. H is plan hosts that typically have received a DHCP address.
One of the best tools you
can have for managing
General Statistic' Troffrc
O
K
1_ _your
hotspot
is
right
here.
MAC Address: [O
OOF 6SCi iioD
5
'
. . ..
..
If you double click the
....... _
hosts,
you
will
have
To Address: i 10,59.069
!
several tabs as well as
Server; i._hotspotl .......- .._-_.. .._...i
traffic, statistics plus one
Bridge Port: ,,_unknown
...
-- - ----_... .......!
major button I use all of
the time. 'This is the ability
to take this host and
create a binding from it. This will ensure that you don't typo either the MAC
or the IP address.
:
, "',
"
,', "
~' "
_.~
"'--_.~~
_-_.
286
_~~
;R
!R
!R
lR
IR
IR
Ser_
Q W_ 1
Q W spot1
Q hOlSpo'l
Q W ' OQ'l
Q W , ,,,,,1
W ,oct1
,UCM Dornai1
ps...
~Io.
LL..
Er.
pe
Na. ..
:Addteu
IO.SS0 4
10.SS24
l OSS06
10.SS0T
10.SS2.10
1O.sa 0.1 4
Up/me
Idle Tme
Session T~
3d2Va51
0057.16
3d 00:23 33
0000:02
lOd 191 4 3ll
0000 24
01 :11 :31
0001 :11
9d2201 .12
eo sass
lOd 22: 31: 3ll
00 43:32
All Rae
abps
r, Rate
Obp,
151 bps 151 bps
obIo' Obp,
o"1"
otl~,
0
obps
Obp,
0
287
--- - - -
288
1
1
I
I
I
I
I,
I
I
I
I
,
I
I
,
I,
I
I
I
I
I
I,
I
289
..
_ -
"
General Status .
- Service ' ,
o ppp
o hotspot
1 1 login
CJ
wireless
dhcp
Called 10:
,
"
__._.. _ _._
...
...._.
"'
'
,-,
L: Accounting 8eckup
Realm: :'-----_._---_._...
"
Src. Address:
. . . ." . . . . . .
_-_.
, ...
......,;
.....
. . .. ,
,i
"
The Service defines what service the Radius server is responsible for. You
can have the same radius server doing authentication for multiple services at
the same time.
The second portion is the service that you are configuring to use Radius. We
cover this in each individual section, so if you wanted to configure your
hotspot system, you will have to configure the radius check box under the
hotspot profile. For your PPP service, you must configure your PPP system
to use radius just like any other service. Once both of these are done, then
you can start using your Radius client!
290
291
If you are getting some accepts and rejects, but also are getting timeouts,
check the last request RTI time. This is the turnaround time it took to get a
response back from your radius server. In the image above it is taking 80ms.
IF your timeout value is under 80, then you will get more timeouts, however,
if you see higher times, you may need to simply bump your timeout value
accordingly to give your server time to respond.
292
I
I!
J
I,
,
I
I
I,
I,
,
I
I
I
!
1
1
Ii
II
i
Accounting
IP ~ Accounting is a method to track both the
r-I . "
.
number of packets and the number of bytes
...... ~~n~p.I.~..8.g;;q\.!nting ..!
based on IP pairs. When enabled, the IP
Account Local Traflic
accounting system starts tracking IP pairs
Threshold: [?56
based on the source and destination IP
addresses. Data that is dropped in the
router are not counted, only data flowing
through the router. You can of course, enable or disable local traffic, or
traffic sent or received by the router itself.
-.J
Once you enable IP Accounting, you will start to build a list, of these IP pairs
The threshold is
along with their corresponding packet and byte counts.
how many IP pairs can be created with a max of 8192. Once you have 8192
IP pairs, anything left over or unmatched will go into an uncounted counter.
You can take a snapshot; this does two things, displays the IP Pairs along
with their counters, but also clears out the table.
Most people will use this with some form of data collection application. You
would normally enable the web-access system, when your data collection
application connects to http:UrouteriQ!accounting!ip.cgi on the router, a
snapshot is taken and the information is presented. You do have the ability
both in the firewall as well as in the IP Accounting Web -access menu to limit
what IPs can run this web application.
294
'
Neighbors
RouterOS uses discovery packets sent out all int erfaces to discover
neighboring RouterOS and Cisco 10 5 systems. To access this click IP ~
Neighbors. This discovery process is done via MNDP or MikroTik Network
Discovery Protocol. It will learn information about the neighboring devices
as well, such as IP address on the neighboring interface, MAC, Identity and
versions. Since RouterOS offers MAC-Telnet ability, you can simply double
click on a discovered device and MAC Telnet to a neighbor. You can also
turn on or off the discovery protocol by using the discovery interfaces tab.
MNDP does use UDP Protocol 5678 and broadcasts every 60 seconds. It
only discards routers that have been removed after 180 seconds.
Neighbor,
DiSCOY'lIY Int",la~ .
f.!J
! l nteri~.
etherl
1 .,ih;;1
(P Addr..""~,",-.~
M AC
~
Mdro..
(don . PIali"'2-m Version
--l!2 25 200..2_
OO:OC~4.2~2A[)J_joTil .. lAiklQT "
4 Dbeta3
172.250.124
OOOC:42 tf:Ol :DA . ....~I:;;:
AI<J:;:;oT~i<
:;...;;:,
3 .:.i
1 9~
Board None
=......._
""",,!,,;;;:~
295
: ' ~ ']
Pools
IP -7 Pools is your IP pools for both your DHCP and other systems like your
universal client in your hotspot. Most of the
time your IP pools is setup by other
Name: ....
ihs-_- . .01-2
r
,
processes like when you setup your DHCP
Addresses: l2Q. 5 5. 2 -1 0 5. 5. 2~ ~
servers etc. The pool is exactly what it
Next
Pool:
~~~~
m
T~
1
.A.
sounds like. It gives us a list of IPs that
different services can use. RouterOS will
also have a used addresses tab to list
addresses that are currently in use.
-
_",~_.--J '
- -.
296
- --
- --
.--
- ox
Clock
Port. 11080
:I...................
_.
..............J
,:1,
Max Comocliom' ~
200i;o.o=Oii-oi""'iiiOi"..' 1
. '
S IC. Addre$s:
S IC
-------.....
.... ~._._.._......_.
...
...
Port
Dst. Address:
Dsl. Port
Action:
Time
I~cc~Pt '
l~
Date: Aug/05/200'3
297
'"
Client
Mode: .uncest
-...
ii"._ !
Server
r
98
---- .
EMbJ.e.Q .
Broadcast
J MultiC<lsl
~ Manycasl
The RouterOS loggi ng systems is quite exte nsive. You have options to create
log files, send logs to Syslog servers, or echo data to the local log or console.
Under System ~ Logging you can
Nerne; fremo1e
setup the different types of actions,
giving you the ability to send your log
Type: [ remote
data elsewhere. The remote action
Reroote Addle: : to:pO
.q
sends data to a remote Syslog server.
Remote Port 1c::51.:.4c.,.......-_.,.......-_-,
Under the action tab you can create
Src. Addles, : -,.-,-.,....,-......
severa l Syslog servers, etc; you w ill
need to specify the remote address as
BSD SysiOll
well as the remote port for this to
3 [daemon]
work.
I
w~rnlng
299
_. _ - - - -- - -
300
Name: Ia l l
Scripting
Policy -
.. reboot
~ reed
'" write
~ paicy
R; lest
~ pesswo,d
.., ,niff
Run Colrt: 0
Source:
Scheduler
The schedule allows you to schedule
start dates, times and rerun int ervals as
well as delays upon starting. You can
setu p a start time of startu p as well,
with a delay. I like to do this when it is
necessary to run a script upon startup,
but I need a minute or two for all of the
services and connections to come up
before I start running the script. It will
also list the number of times to run .
Remember though, that your clock will
need to be set if you w ish scheduler to
run at the correct time.
N<me:
St",t Dete, Q;fvo111 970
Siert Time: 00:00:00
InteNdl 00:00:00
J I
Delay 00:00 00
On Evenl
Owner:
~-
reboot
reed
WIle
paicy
lest
pasMOld
tril l
.'
Run Count: t.::
,0:...,........................_
.........._
301
Auto UQgrades
The auto upgrades section allows you to perform
-__l
RouterOS software upgrades quickly. To get to
172250.1
i
Address:
======~
this menu section, click System ~ Auto Upgrade.
User: admin
,
Here, you will need to first define a package
PassWOld:
source. This system will FTP into the package
source and obtain a file list and based on that file
list show packages that may be available to
upgrade the RouterOS version that you are on. It
will take into account variables like the current RouterOS version, as well as
the processor type.
~
Once you have defined your package sources under your package source
tab, you can then click on your available package list, and select refresh . This
will force the system to go out to the FTP servers and download these list s.
Remember that you must have the correct usernamejpassword in the
package source as well as the ability to FTP into that source for this to work.
Once the list is downloaded, then you should have a listing for your
Processor type.
[!J
I
I:,';:--;QG,
Source
.
172250.1
Name
routerosx86
Version
4.0beta4
Status
available
' Completed 1
As you can see here, we have a package that is available. Clicking on this and
then clicking download will simply download the package from the FTP
server, and nothing more. The Download all button will give you options to
download beta packages as well as rebooting after the download is
complete.
302
..__..
__:
.. ...._.R1~.. _ ..
complicated process by using some
(t] Authenticate
form of public bandwidth test site
or using a Linux application like
Allocate UDP Ports From ~2~
OO~O_ _,
IPERF. RouterOS though, offers the
]
Mal( Sessions: 00
ability to run a bandwidth test
server for clients to connect to and
perform bandwidth tests. These
tests will be covered more in the test client section. To configure the
options for the bandwidth test server, you will click Tools -7 BTest Server.
Inside here we have an option for our BTest Server Settings. Here we can
enable or disable the server, specify the max number of bandwidth test
sessions as well as if we require authentication. Authentication is user
authentication through the RouterOS users system. For example the admin
user that comes defaulted on the RouterOS system would be a user that
would be able to perform a bandwidth test.
303
.n.,
n!
304
_...
",.,,,,.,n,)
...
;:::=-=::..::-.,
--
body= t ex t
Using the tool e-ma il command you can specify the body, to and subject
lines. As long as your e-mail system is configured correct with your outbound
SMTP Server, the email should go out without issues. These commands
inside scripting will allow you to send e-mails upon someone logging to your
hotspot as a trial user, or other task.
As you can see, you can get files form FTP or HTIP, just simply enter the
address, if there is a username/password as well as what mode you wish t o
try to download the file in. The src-path is the folder and fi le that you wish
305
Graphing
The graphing system of RouterOS allows you to quickly and effectively use
RouterOS to show usage over time. RouterOS supports graphing your
Interfaces, simple queues, as well as the resources of your RouterOS system.
To enable graphing, you will click Tools -7 Graphing. Here you will see
several tabs, the graph tabs are the actual graphs to be accessed inside
RouterOS, and the rules are the ability to specify who and how you can
access those graphs.
Queue Graphs
N!ritetface Gtaph$
Ireetece Rules
Resource Rules
.., .. ... ..
:
:
.. :.. :.., :..
. . . .
_. i i ; ,.
..
..
..
..:
.
.
..."
.
.
. ... ... .. ... ..
: :: : :
.
.
.
.
. . ,.:,
..
. ,.. ..
i i ; , .. i ;
: : : : ::
..
..
..
..
..
..
~ i
... .. ..
: ; :.
..
.
..
.
..
.- :. .:
:.
; ..
. . . ,
..
,
.
.
i i ; ; . ; . ; . . ; . i " ' i " '; " ' ; " ' ;
.
::::::::::::<;:
.;:;::::::::
::
. ..
5.00 Mb
2. 50 Mb
0 .00 Mb
8 10 12 14 16 18 20 22 0 2 4
Max i 11: 9.44 Mb Av erage In: 3.78 Mb
Current In: 452 Mb
Max Out: 1.38 Mb Average Out: 492.63 Kb Cunent Out: 463.38 Kb
10 12 14
You can also go to http://routeriQigra phs and see a web based version of
the graphs as well. These work quite well and record quite a bit of
information for you to review and see on each queue and interface.
306
Packet Sniffer
The packet sniffer is located under Tools -7 Packet Sniffer in the WinBox
menus. Once here you can setup your packet sniffer settings to get started.
The interface is required, as well as
specifying the memory limit. If you check
only headers, you will get quite a bit more
Irte,fllCe: on
data than if you had the entire packet. You
Memory Linol 110
kb
can
also
save
that
r"'"! Oriy Heode<s
enelol Sbe"",ing Fit.,
data into a data file
File Nome: L
-..J ...
if you wish by
Protocol ip only
,
Fde Lunit /19
'1kb
specifying a file
Add,e.. 1: 1..::;!
o~
o o::.:O::..:/O,--_...J
name and limit.
...
!
POIt 1:
;:;:;::;::=
Address 2: 0,00010
---,
...
307
TFTP Server
In Version 3.21 a TFTP server was introduced into
RouterOS. To access the TFTP Server, simply click IP
-7 TFTP. Here you can click the plus and add what
IPs are allowed to read from the server, and set
what file names you wish to have. It also has
options if the file can be written to or not.
..'. .....
~."
Real Filename:
- ,'" Anow
-'
r-'~
Hits: ,0_
':::
_-']
Traffic-Flow
Traffic flow is a system that can provide stats based on packets that pass
through your router. What is more important is that this data can be
collected by using some kind of
NetFlow
traffic
capture
i General I Stetus
software or device.
The
C Enabled
amount
of
data
that
is
lnteueces [all.... . . . ....!_ ~
generated is very low, but it
Cache Entries: [4~
....l!]
streams that data to your
Active Flow Timeout @ ?999 . .
.... .1
capture and analysis software.
Inective Flow Timeout 199 00:1 ~
.
.~.
.
..
]
Most of these types of
l
software's
can
help
you
identify performance issues
with your network, what kind of data is moving, when it moves, help you to
identify traffic patterns, as well as look at individual IPs and subnet ranges
and generate usage reports based on those. These applications are outside
the context of this book; however, RouterOS has the ability to stream that
data to these applications. To access the net-flow system, click on IP -7
Traffic Flow.
Address:
lrililm. . .-,
.
308
PorI:
r1 ?~~
[5
Vllrsion: 5
A ""
'_
nil f
20
.
------v_--.I:Ii
+ :
"]
UPnP
Universal Pug and Play applications communicate with your RouterOS
system to open and forward ports through NAT that is necessary for the
application or UPNP system to function
correctly. For the ISP or WISP, I would not
n rl":---- - -_' --u;, r)<lt:l!e.d..._.
___.._. . - '---,
~
configure UPNP on any core devices, only
R, Allow To DIsable E><lerMl lnlerf~c.
customer (PEs would be normal for us to
R. Show DunYny Rule
configure UPNP on.
To configure UPNP,
simply click IP -7 UPNP. The UPnP Settings
button will allow us to enable or disable the
feature and allows us to use some security features of UPnP. Specifically, we
have the ability to disable the ability for a UPnP Device or software to
disable the external interface. I don't know why you would need to do this,
but it is an option. UPnP is very insecure, as no passwords or authentication
is used. It is used to simply make holes in your NAT system easy for software
and devices.
Once enabled, you will need to add two interfaces at least, one external and
one internal. This way UPnP knows what is inside and outside of your
network. After you have completed that, there are no more configurations
needed with UPnP. If the device is working correctly you should see
Dynamic NAT rules created for specific ports to forward to internal
addressing.
309
IP Scan
The IP Scan tool scans an IP subnet and returns devices that can be pinged as
well as any information that it can obtain from that device. To run IP Scan,
click on Tools -7 IP San. Then select what int erface you w ish to run the scan
on, and the address range you wish to scan. When you run it, it will show
the IPs that respond, the MAC addresses, response time, DNS name if any, as
well as SNMP and NetBIOS data .
.-
. -..
_-_..
......,.,,..-,.,..-....,.,.....,.."..,..Addle..
; .MAC Addle
17225.0.1
310
,..
Tme (ms)
DNS
SNMP
o co re.in kleem...
Nelbios::-....
...
M'"' '
"'I ...
:'~ Kil
The cache administrator will be displayed there is a cache issue or non existent pages. You also can set the max caching size, and if you are using a
Disk to cache with, make sure you check the box for caching on disk. If you
do not check the caching to disk, Router05 will use your RAM for your
caching system. The drive that you will use to cache with is defined in the
store system; see that section for more information on the store system.
311
~._ -
_ v
"
, , , " " n
"
, , _ ,
"
312
1.01 __ .
17J..2'i 0 CJ!24.
Os!. Poot
Me(bod
0 0;. Hoot
- -
._.
- -
Ac"
,
R.~
""'"
...
,
deny
To HIs
217<72
_." .-.
..
In this image, we have the private address of the local subnet on port 80
only as allowed, everything else is denied. This way a hacker cannot use my
web proxy system to relay though. This is very important to do, otherwise;
any bandwidth saving that you may get through the web proxy system could
be used up by someone outside of your network stealing your bandwidth.
ost. Address:
~:..:::::.
...
...
0,1. Host: 11...
PIllh:
,] ...
------'
...
Action: allow
H ~s:
209703
313
- -- _ ._-- -
Generel Advanced
Action
,..-''''---
Chain: dstnet
. 1""1
Src. Address.
Statistics
..
_-_ -_ __
._..
",,,
.
172.25.0.0/24
>'
- -................................... .
",
..
"
".,.,
Ii
j ....
(.~~"
-.........
Dst. Address:
, , ,
.. , ..
~,
Ptotocol: .. j 6 [tcpJ
Src. Pori:
DsLPort:
Gene ,~1
'J
,. "
80
Action:
~edire:::::cl'--
To Ports: l8S8S
..__..
========Z,i+ ,
...=.
....
In this rule, you can see that we are taking IPs from ou r private network, and
then redirecting them to the proxy port. This ru le effectively reroutes their
HTIP traffic through the web proxy system regardless what their sett ings are
in their browser.
314
315
- -
_ .-
- - --- -
.. _
- -
---
MetaRouters are virtua lized routers that operate inside of your RouterOS
system. This can be useful to allow a customer or individual access to their
own private router, with their own IPs and firewall settings, but not actua lly
have to purchase the hardware to do so. At the time of writing this,
MetaRouters work only on RouterBoard 400 series boards. You are limited
as well in the number of MetaRouters that can run on one system. This is
mostly due to CPU and RAM restrictions.
These MetaRouters run
underneath the main RouterOS system, and use the license that the main
RouterOS uses.
In the diagram below, you will see that you can have multiple MetaRouters
below an individual RouterBoard 400 series product.
RouterBoard 433AH
MetaRouter
MetaRouter
MetaRouter
:l
316
II
I
I,
I,
MelaROUTER mr1
i k<oTlk 3 .23
l k<oTlk Loqin :
I,,
I
,
i
I
,I
I
I
317
Dynamic Routing
,,
",
When yo u are using RouterBoards with at least a level 4 license, you will
have the ability to run all of the Dynamic Routing protocols offered. In an
x86 vers ion of RouterOS, you w ill have to have a Leve l 5 or better to run
BGP. A level 4 license w ith x86 systems does allow you to use RIP and OSPF.
There are many books on OSPF, BGP and RIP as w ell, I will run t hrough t he
basic setup, however we will not discuss routing techniques, and most
troubleshooting abilities inside this book as those topics are outs ide ou r
scope here.
Disbibute Default
.. Redistribute StatIC Routes
RIP
r:
318
Interface: private
Jl"
!i:. j
bridg~
Heceive: J ~i :2
"
'r:::-"1
Al1henticalion' md5
,
;
i"
&4
it :
.
Passive
,
In Prefix List:
'::=
hU pdate., 0
Rx Updates:
Bad Packets
-.:::.
O ~_~
~O======-
319
""
~- ~.. I
;]
320
Genelal Stal",
Interfl'Ce:
Cost: :10'
Priority
Authentication:
~===~
1
-none
....
AuthentICation Key. ;.::.====~
J
~r~~~~~lt
"']!!
,...., Pa$$tve
.
Retransmil lntelval 5
321
BGP
We do have full support for BPG within RouterOS. BGP or Boader Gateway
Protocol is the key protocol on the Internet. It supplies interdomain routing
across the Internet and if you are going to multi -home to several providers
then you will need to run BGP somewhere. Why should you run BGP with
several providers is a question I get asked quite often! When you are
running all private IPs behind your core router, then BGP is not really
necessary. You can change providers, gateways and connections without
much hassle. But when you end up with your own IP addresses, and your
own AS (Autonomous System) number, you will need to eventually run BGP.
If you are running with a single Internet provider, BGP will not help your
business that much, however, once you go with multiple providers, getting
your own IPs and AS are the way to go. Now, you have your own IPs, they
don't belong to your provider, they are yours . It doesn't matter what
provider you wish to use (as long as they will establish a BGP session with
you) and you can use your IPs without issues. When you start running
multiple providers, you can start load balancing, and shape your traffic
across them.
To get started you will need several things. First, you will need to configure
the default BGP instance. This is basically changing the instance AS number
to the one you have been assigned, then creating a BGP peer with the next
router.
Once you do that, everything else is modifying what routes are
seen by each peer, as well as changing and modifying route information for
your internal routing protocol.
Most networks that I work with will run
several BGP peers to multiple providers. This provides redundancy, but also
allows us to load balance and provide symmetry across your network. If one
peer goes down, the entire network, along with all of your public IPs are still
reachable and able to use the Internet through the single peer.
Please keep in mind that there are entire books about BGP, how to optimize
BGP, provide load balancing and symmetry and failover.
Refer to other
reference materials for more advanced configuration of BGP between
providers.
322
...
--'
Router 10 :
n Redis~ibul e Conoecred
Redislnbute Stolic
Redistribute RIP
. ' Redistribut e OSPF
Re<istrib<Ae DIne. BGP
Out Filter: [
Conlederation
Corlederalal Peels:
...
CuderlO:
Peers
The second step after configuring your instance is to configure a BGP peer.
This is simpler than it sounds; keep in mind that you will have to have IP
connectivity. Most providers will assign a /30 or /29 for routing between
your network and them. One of those IPs will be your router and one will be
theirs. Theirs will normally also be the BGP peer router as well. However,
you can use BGP multi-hop as well to provide a BGP peer. We will cover that
a bit further in the chapter.
323
r.. '
'.~~."~~~.""'.'.~'"'''.'.'''
'.'.' ',',','.',~'
{,
, ~,
.. i
1...
"
Hold Time 18 0.
TTL
M"" Prelix Limit
~55
..J.j s
-_....... _T+
J
~---,, '"
L.
...
In Filler:
~---"~---"i . -
. .
_ ....
,~ ->'
. .,....
~'"
.._.
..
--~."-,,
_,~.......,
,,--
' - - - - - - --
Networks
iilL==BJ
Network:
The networks in RouterOS are a listing of IP
prefixes that will be advertised to your peers.
Synchronize
If you have not placed filters in your BGP
system, and you type in a network here, BGP
will advertise this network. The synchron ize
box, will first ensure that some part of the network is in the IGP routing
table.
For instance, if you put in the above network, 187.1.1.0/24, and
check the Sync box, unless you have some 187.1.1.x subnet in your routing
table, it w ill not be advertised. If you only have an 187.1.1.0/30 it w ill be
advertised though.
324
Routing Filters
...
Prefill:
. ----
. ..,.
...~-
325
"' - BGP
,--.. ..
BGP AS Peih
~~
'
...
-- -----~~_ ._-.-
"'eign
-. . -
..
...
BGFLcca Fie'
BGPMED
BGP Atomic Alr.'egale
..
BGP O,ig"
.a. _
--_._---_.. __
BGP Cornmunitiet
BGP CommuniOOf
~ __
_-- .. _-
_.~
; Irwert Match
,?a, ~ ~~~I~~~. ,
Action
' , ,"
"' ,. , ,
,-
.L~.~~
"
'1'"
"
"""
Set Dete-ce
Set scope
" . , ", " n ' . ' " " " ' ' ' n ' '' ' ' ' ' ' , ~ _
..
'"
,"
!
- .
Sel T
Set
Pl t~L
' Scope
Soiece.
L
f ..
'""'n
Set In Neeh op
"
.1
".
.. .,,, . . ,
-,,
'..........
"'''1
! .;.
-~----'j ....
-,_...
>c.'. ,.,-
326
"--,.,
,""
on,on
__._--
'C,,
..
J...
,i ...
J...
...
-!.;.
"
i ...
_..
,_
-, , .
,
..--"
I
,
I
I
1
,
,i
,
327
- .-- - "
>-, '."
~.,
...';': ": .,
,.
,;: : ;.?:~:
- -
328
y . -
,,
'.. '
, ''C ,
Windows Installation
Installing the windows application is just like installing any other Windows
application. You will download the windows installation file, and run it.
Agree to the setup terms, and select the
..,.... " ." ..., . ...... "" . , , . ..,. .....
components to install. Dude has really two
Reset Conf igur etion
main components, the Server and cl ient. In
'" The Dude (required)
~ The Dude server faes
the windows installation, you can install
~ St art Menu Shortcuts
both the server and the client at the same
time.
The required component is the
client, and the server files will allow you to
run a Dude server on your Pc. Dude does
have the capabilities to run the server as a service under just about any of
your windows versions, but that is configured in the server settings. If you
check the reset configuration, this will wipe the configuration data files and
let you start over. I normally never need this as there is also a reset
configuration option inside the client application.
After the selection of the components to install, you will then select what
folder you wish to inst all under. Now, here is a little trick that I like to do.
Keep in mind that I use The Dude everyday on many different networks. We
have many different Dude servers and versions out on many different
networks. I have to be able to quickly change between different Dude
versions and servers all of the time. When I select the installation folder for
the Dude, I install it in a folder with the version information. So for The
Dude v3 RC2, I installed it in a folder called Dude3rc2. This way I can have
different versions running at the same t ime as well.
329
Dude Agents
A Dude agent is a Dude server acting on behalf of the primary server. No
data and configuration is stored on this other than a username/password to
secure that Dude Server. Your primary server will be programmed to use the
agent to get to subnets that are not normally accessible by the primary Dude
server. For instance, if you have multiple hotspot networks behind different
types of broadband connections, and these hotspots share the same
common IP structure. In this case, if you had a single Dude server, you
would only be able to ping and monitor devices with public IPs for the most
part. However, with a Dude agent, your primary Dude server can request
the Dude Agent that has both a public IP and a private IP to ping the private
IP. Since the only private IPs the agent can ping are the ones local to itself,
you can monitor the entire private subnet behind the NAT with the Agent. If
anything ever happened to the Agent box, nothing is lost, as the entire
configuration is located on the primary Dude Server!
330
Dude Lavout
Once you perform the initial installation, you should get an application like
the following:
This is the initial screen area for the Dude application. In the upper left, we
have the settings, server and other command buttons. Along the left we
have our contents to get into all of the sections of the Dude application,
below that, a quick reference map window. The main application screen to
the right is where your ma ps will go !
331
!P-
Enable On Locolhost
There are several server running modes . The default mode is for the server
to start with the client and stay running until the computer is rebooted,
however, this does NOT start the server when you start your computer. The
second mode is "only when local client is running", will do exactly what it
says! When you start the Dude client application, it will run, and when you
close it, it will stop the server. The last mode is "As a Service". This mode
installs a "The Dude" Service into Windows XP or greater allowing the Dude
service to start with the workstation or server in question.
i..............................................................
dude. exe
Dennis
00
13 664K
................................................l
dude. exe
Dennis
00
161368 K
dude.exe
.
i
1'
dude.exe
I want to point out, that upon the installation of the Dude and the Dude
server files; you will have a local server running. When you execute the
Dude application, it actually starts two copies of the Dude.exe file. One is
the server and one is the client that you are using to communicate with the
server exe that is running in the background.
332
...
r':"C;;':':'']
,- eanc.I
v...
I 1fd1
fUl Node I....,..
.. """-- -- - - - -iJ I Flo..
P" Er_
Qll.ocahla
I
I
I
These 1 ~" i:>1 buttons are very important as they are your export and import
commands. The export button, on t he right, tells the Dude to generate a
XML file with all of your Dude data, it stores this on the disk, and then
prompts you to download the file, or save it somewhere. When doing
exports, you need to keep in mind that the XML file contains everything!
What is everything? First and foremost are the devices, what and how you
are monitoring them, what map they are on and how to notify you. It also
333
_ .-
---
Above the Map window you have more commands, ,+:J or plus sign, just like
in RouterOS allows you to add a number of items into your map. Things like
your Devices, links, other maps etc. You also have a [1, minus button, to
remove objects that are selected, again just like inside RouterOS. Like most
windows applications, you also have the copy and paste rq~ L~~ commands
here as well. The lock [~j prevents movement of your devices and links on
;-SettIOgS
.1 : Discover II
"' TooIs
1The settings
settings button. We will discuss that later as well. The discover button
activates the discovery tools, and the tools section allows you to export the
map to an image file and help automatically layout devices.
Server Configuration
[ Preferences
I~
~ I. ~etti;gs l
334
lei, ,
a Server Confl9uretion
~jj8lY DNS: 10 0 0 0
~",;t1Y... . ~vdJt"j"~" IJnJc~d~~
slm 1000-0
Seco<.:"",SI4TP, lr.':oo
;o;;070 ..../lOY
[e~
ro
-~
t""-
335
- -- - - -
The Polling tab allows you to setup the default polling times and notification
events for new devices. You can enable or disable the polling options and
well as control how often, when to consider the probe timed out, as well as
how many probes must time out before you get an alert. The bottom
section is your notifications. This
--- ::-:--'~
allows you to set the default
notifications for new devices. I
typically would configure the
~. 1'1,...111. r;iIiiIii
notifications first when building
my Dude server, as I want the
notification options on all of the
_.. ..
that
I
add
anyways,
devices
---_._
_----.
....
however as you grow this may
not
be an option for your
network.
~ ;~
---
....
336
337
Nl....
Pltl~e'lCe 1
'-0:::' ' "','''',,'''.,'"',"""''''''''0'''''''''' -=':''''=3
"3
R~CU$l',ltl
i~:::J
il~ NetWDlt. 5I."O!! AJ(JW ~ ra r1
- - - - - - - - - ~Qodl:
-,-
H tlpt
AdI'Ced
I ljeril!.v DevI I:'t T~e
1-
Ad:! SS "lCelen
t,t", SmAllr"IeIO..IS
jJ
j 0,1
338
-:'--~
~--_.
Admins
The admins section of the Dude is the user management system. This allows
users to login to the Dude
application, view network status as
Admins GIOUpS Active
well as login abilities to the web
Just like
access if applicable.
B
~
RouterOS'
user
management
I GIOU~
Name
system, you have groups that you
kalob
full
can specify rights and policies. The
admin
full
ability to login remotely, via web,
rodneyb
lead
readonly
lead
locally, as well as if they have
read/write actions as well are all
policies that you can control. The
agent policy is to allow that user to
Name:
use this Dude server as an agent. If the user
account that you are trying to use in the server
- Policies --.,...-configuration for agents is not setup with the
po lead
write
agent policy then the agent relaying will not
po local P remote
work.
.
[+l B~[jJ
..
1m
Charts
web
agent
policy
Charting in the Dude is done by specifying values units, and a scale based on
some data source. Dude already has many data sources as you are collecting
data from the devices that you are monitoring. However, you can use SNMP
oids and functions to collect the data. Building functions is outside the
scope of this book. I will share a graph that I built to monitor TCP
connections on a windows
server. This may not be
,,.. I""'" c,d
:3
something that you can use,
Dal~ 1 ~!ll.o9l' lebloUe ...&~ l
:3
but you may be able to
S, oIeMedo I_
:3
s- 1""001
=-- - - - - - - - - modify it for your needs.
U, j
Ie"",,
339
Devices
The devices pane gives you lots of information about your individual devices.
Devices are objects that you wish to monitor, and this pane will give you
detailed information about each one. What is also nice, Dude has the ability
to covert the MAC to a brand, so in the image below, you will see several
MAC addresses but with the brand of device that is connected . This can be
helpful to determine what gear the customer may be using.
340
::::::J
J
MAC
Type
oil
Tmo;
M~
SomeOevce
Mastel VielJll
festus_towel
festus_tower
IeslU$_lower
le'Iu'_lower
Inside here, we have lots of information as well. You can add notes to each
device; this is extremely useful when you are swapping radios etc. As well as
creating a service history on the device. The tree view is not as useful;
however the RouterOS tab can get you some wonderful information. As you
can see below, under the RouterOS tab, you will get information on your
RouterOS devices, such as the name, version board and what packages are
installed.
litt TI
AwerOS
TyP,e$
MacMappirlg~
N_
~
~
~
""
2K DUDE
2g112 Hi.
lkrles_2ksfes
""
~ ---" .....----..........---.....-----........;,;;.;;.---_.....;;;;;.;;..,.,......_.,.......
2l"lof~
31xH LLAPl
Also you will see a status; this means that the usernamejpassword that is
stored in the Dude for the device allows us to connect to the device to get
information. If you can't connect, you cannot get this information. Dude is
constantly checking this so this gives you a good way to find out what Dude
devices needs to be updated to ensure you have the proper password to
them .
341
-- - - - -
Above you can see another useful tab in Dude. This is the wireless
registrations of your network. Any device that you can monitor Dude is
pulling data on! And due to this, we have a bunch of data as it pertains to
your wireless registrations. Here we have all of the wireless registrations
from all devices that you have listed! Along with their signals, IPs, and any
comments you wish to place on them. You can also double click on the
wireless registration, and it will give you your registration information, just
like if you were in RouterOS!
O~,
,
"
o-.t
WIF]
[doe
'
N_
a._Xi
( Qormert
llMlilrullM
'-
~Uwt IQ<
1. t.ni Ill_
100 1Z iOOl32
WIFl ~ "'w_b
100 n101132
1 29 . ~
~~~
101J 81 M 4
"''''''
, t.A bPI
101 38Z ~
10 0 5G251Jl2
1o<,lljMC
2m' ~B
~ ' 1-113
('~ 3 ...a
T~ BJIf'
29~ ""B
352 1018
1l9 . 1.vI
512 "bPlo
2~.1
He
rH6toorB
121.1 1o!1I
"'''''
1 10lbpf
ll, S Nil
50TH-Ill
R~ "'ft"
20;10
31&700
4~H
1324(;0
2lnlll6
T . ~ad<"
, ~, A"9
R.-.
21'J! S 1 8 ktp
11 ;rgl )
&o;usa
H~
' jH ~
h Ay; 1l:M,
201 ktoo
B 73 k ~
16~ ~
lj 3ll93
If>'U U
This image shows the Simple queue tab under RouterOS. Again here, we can
see queues, data rates, and limits setup from each of our RouterOS devices.
What is even better is YOU CAN CHANGE THEM! If you double-click on a
simple queue, you will update the simple queue on the device that you
double clicked! How easy is that!
Device Options
If you double-click your device, you will get a big dialog box that will show
lots of information. You will have options to set the device name and IP
address, as well as what type of device it is, if you should poll that IP address
through an agent, what SNMP profile to use as well as usernamejpassword
information for RouterOS devices.
342
Enabled
Probe Interval:
mmII
Usa Notifications
Name
EMdil
beep
eroeil-l, TI
lleth
I
The outages tab is a wonderful
~----.... :S !dt~,,,,,T:.;i"me
o~,,,"-=
Dur4lion
S..vic::;;:e_
history of outages that the
,e'.~Iy'~~.
....A..lJ?I11 01.2~ .46...0000: ~. _pino .. ..
resolved
Augl11 02:22:39 00:00 50 ping
Dude has reported on. What
resolved
Augl10 21 :1606 00 19~ ping
resolved
AugI1021 :07:56 0001:09 ping
is really nice is that you can
place notes on each outage so
that you know the reason and
why the outage occurred. Note in the image we have the t ime/date and the
duration of the outages just for this device.
Under the SNMP tab, you will have all of the information that the Dude has
probed for, typically this can be quite a bit of data, in the image below this
text, you will see IPs, Routes, ARP table entries, CPU usage, simple queues,
etc. This data is nice to be able to see inside the Dude, however, is mostly
for show in the Device. The RouterOS tab is the exact same thing as the
343
- - - - -
- - - -
- - --
Interface Ip Route Arp Bridge Fdbl Stor~~e , Cpu Wireless 9,talion Regis
~ [i]
[Q]
" H H
etherl .."_
(1)...._.v....
.................._...._.
wlen1 (15)
"
',',','
~."
.!. JIYEe.
~ " ,,
.. .
..__ethernet-csrne.,
_
_
.._..".._
~
~ ._."."
ieee80211
1500
_ _......._ 30.4
_ _._kbps
,.
1500
360 kbps
360_ kbps
_._._
_
~l
29.3 kbps
,,,'
The history tab of the device can give you detailed history information and
graphing of the services. Depending on what kind of services you are
monitoring it can be a number of different types of graphs. For instance, a
device that is monitored for DNS, ping and CPU; the DNS and ping graphs will
be response times. How long did the device take to ping, and how long did
the device take
to respond to a
,
1 "
DNS query. The
,.
I
CPU
graph
"
though will be a
1- '
.::~~~~_L~.J
II ... 5 t-!::~-..._--'
%
graph
1 e
U .OO
12:.
t
It Cl
u :oo
! _ .""
how
showing
l J.N
"
much of the
i
I"
~ illl FI f,1,o,.. I \ !
I,,,. ~JM
~6
f" 'J
344
~)
....
:X'lol(t :~ ~c:~ ,
.. ~ '''
'~~
r .,;,
....
Files
The Dude system contains a file system with two different areas. The all
section is for files such as images, graphics etc for you to use with devices,
background maps, etc.
The second
is
much
more
section,
packages,
important. What these are for is to be
All Packages Transfers
able to upload packages, RouterOS
packages to be able to force devices on
your network to do upgrades. There are
two upgrade paths in Dude, one simply transfers the file to the RouterOS
device, and the second not only transfers but reboots the unit to perform
the upgrade as well.
345
~~
",
fi"-'ile
I.C,leanu-; I
-"
' .
I Tirne
! >,..,.,,_.I Device-' ,,,.
i ,oulero,po:",,,,pcJ2~npk ..~ . . . _ _0 9 54.05 , .. . _..
loulelosm;psle1 28npk
0954:05
loulelos,86128.npk
09:54:06
,._ ,, ~
346
>,.,
.. ~ ~
~,
--, . "~_~,,,,_.,
_ _ ,,>,.
.~._, _,_ .
__
,_ , -- -- -
''--_ .
~-
Direction
..".--....._
up~~d
upload
upload
'
I Stetus -,
~"._._H_
"
~,_.>.~
I .._
Progress
"
.,.~
I
~ ..
,._ ~-"."._, -
q~ued
.O
mprocess
queued
66_
.-
..
. ""------------
_ t ...
ft~
"'.
(~ , 1 1 , lill ~I hi","" h tta l lto l
(1 1 , l(!
r,, ~ 1'1 l l:i
14
------'
347
- --
- - -
348
The logging system of the Dude contains three to four logging systems.
There is the action log, debug log, event log, and if you are running, a Syslog.
The action log will list manual operations
that are performed by an administrator.
Name: I~
This could be you changing a link speed,
Steit New File: 1~ve'V-da-v
or
adding/editing
a
device.
The
debug
log
File, To Keep: 5
are changes that occur in the system, and
Buffeled Entries: 11000
the event log is network events, such as a
device failing.
-3
3
All of your logs have a settings button that will allow you to setup how many
buffered entries to keep, entries that are in memory but not committed to
disk, how often to start new files and how many files to keep of back logs.
349
LJ'J }H
,~~ht
"""
,..
,4_
I~H ~ l
~flj ~<J~':e-.
_."..
,.
'"'' . . . ......
'. ' .
,
,,
,,
,
, .'
... ,
~"
..
..
..''."',, """"'"...,.
:
"
, ,
'" .."'." C
, .,..
": .""
~'"
,. "
"
"
,,
..
"
... ~
.......
,
'
.~ ,
,'."
"' .~ "t-
'
. ' 0 .
f K, . ... .
".
....
....... . ....
b'
' ''u
....
_
.
...... .
:
~
",
. ',,,, "'".,.
,,, . .
".
~'. : '"
.
""'
350
in oak 1 (5240) - 56
,
r~,jlJce
""''JrI' (2)
L[ Twe; ~e9J11 \
M~
1500
SOM i 11 ...t ""
"lAC 00 OC 42 3to 00 oU
S'aM ~ (<<1'"
..p;
.,
r"
"
;/ "
j ,.
ua
351
- -- -
- -- - _ ._- - - - -- - -
352
+ Add Network
+ Add Submap
+ Add Static
+ Add Link
The Add Device dialog box, asks for the IP address of the device that you
wish to monitor, as well as the username/password for Router05 devices.
You can also select to use
Enler IP add,.... 01 DNS Mme
the secure Win Box mode
here. If it is a Router05
device, check the box so
that Dude knows this and
User N~me : ~dmi n
will do the Router05
probing.
Once
r SecUle Mode
completed, click the next
r RouterOS
button to proceed.
The next box is the services that you wish to monitor. Remember in the
discovery section I suggested that you only check the services that you
would possibly wish to
monitor, such as PING or
!~l.:i::!l
141 ~
353
Settings
Appearance
Upgrades
The Dude offers two ways to upgrade your RouterOS systems. One is a
forced upgrade and another is just an upgrade. The forced upgrade not only
transfers the file to the RouterOS system, but also performs the upgrade by
354
Creating Links
Links as described in the link section can be used to show bandwidth usage
and stats on a link between two devices. To create a link, right-click on your
network maps, and then select Add Link.
Next, click and HOLD on one of
the two devices you wish to create a link from and to, and drag your mouse
from the first device to the second device, releasing once you get to the
second device . This will create a link!
Upon creating that link you will see an Add Link dialog box appear. This is for
the mastering information about the link. If this is a RouterOS link and you
have SNMP turned on,
you can get SNMP data
11.1.1 .
right away.
We
discuss the mastering
types,
link
speed
and
..
.
.
.
"
Speed rl ..
types in the links
Type. Iunknown
section further.
"
355
newMap
0 /0/0
water tower
55/013
Notifications
[]B~ [j] -:
; --'JE--'--~Name
Type
--'
.Eeep_ y ee..P _
-,~---
'
EM ail
email
erneil-.; email
flash
flash
log to .; log
log to .. . log
popup
popup
speak
speak
356
email
execute locally
flash
group
log
popup
sound
speak
syslog
The Dude does have the ability though to simply log, beep, flash the device
that went down, provide a pop-up notification window, as well as send data
to a Syslog server. All of these are simple and easy to use, but the fun ones
are the sounds effects. Dude offers two of them. Once is just a simple WAY
file that it will play. Now as you start creating more notifications, you can
have different sound effects. A customer of mine uses th is and the Dude PC
hooked to their overhead paging system. If they hear a specific sound effect
they know exactly what area and what tower has an issue, while another
357
sun
00:00
01 '00
tue
mon
.-
,
.-
hi
sol
'~'%H~
"
o~
us IU
04:00
05:00
06'00
07:00
08.00
09.00 I
10.00
11:00 ,
12:00
13:00
14:00
15.00
16.00
1700
18:00
19.0u
20:00
21.00 "
22:00
1m
-.ed
,
"
,
\
0,
.,
."
'
,',
"
I ~
'"
I
I
if
,.
,.
;r;i
"
..
'"
".
A
,
I'
j:~, .
j,,, .
v'
noo
o .Inactive hours
0.'
~.
Delay: 100:00: 00
Hepeet lrservel
00:0000
,
,
r,;;----- - - ,
Repeat Count ~
unknown -) down
unknown -> unstable
uoknown-> up
On Status
..
unstable .) acked
unsteble down
unstable -) unknown
unstable .) up
uo down
up -) unknown
up .> unstable
358
,~
"
--it.
...
Outages
The outages pane will show you your current outages, when they started
and how long they have been active. In Dudes web interface this gives some
peop le a good place to start
when they see a list of
outages
that
need
to
be
e
StatUI
TfI"ie
._
__ D
De..c::e
"ug/1 3041234 ld0450.. ",_'oCge<... ~
t _ ",:"""
addressed. You can also add
,..
ecti_
- - Aug/1 2 ir2i}91d1139- -;~(-;~;;s- ~ I"
Klw.e
" ug/12 2fr.50 30 ld 1212.. ",'t b",o .. pi-g
notes to each of these as you
r- ach'C
"ug/1 2 W 4234 ld 22 20.. HFFD
F"'ll
po
ecnve
as
well.
These
wish
" "gIl 2 10 42 08 1d 22 21
2<H PFD
Fi",
r ec....
" ug/1 0 16:3800 3d 1&25.. "'''elTo pi-g
correspond to the outages
r ",,,,,"
"ugI\J81 210 245d 20 53 "'_<>I>
~
,..
ecliY'e
AugI(l5 12 58 ~ 1 ild 20 es
nj)""... pi-g
tabs in each individual
po
!Cli...e
JW'10162506 3<d16:3 . c::<rr'9
~
,..
xh'C
J<X\Il 6 042308 59d04.4 . ",_'."1<..1 .. PI"9
device, except the outages
,..
ecfive
J"n!1 01 6 2005 S4d 16 4 ~n",,'
pi",
,..
!Clive
J<X\IlO 16:19 58 Sold 16:4.. bd_~
P"g
pane will list all outages
,..
,,~ oe~9 1 8 n dooO . "'_:1- ~
,.
ecn-e
" .,.nl 06 13 ~ 3 !l5d 02 5 SQ'a',,? ~
across your Dude system.
,..
acti...e
1,.,>10416$45101016 .. "'_:P1_i. P"g
,..
Aor11114 21 02 124018 .. !1..""Ul. ~
You
can
also
use
three
,.
ecl ive
AFII1 0 03 51 16 126d 05
nJ,nd<i.
pi""
resoved
08:5351 000027 A.." foe .. PI"9
different drop downs on the
'etohoed
03:~"H9 OOOOZ7
Ran T'e ._ ~
-esolved
06 18 <&9 000027 R... n i ll'!
pfr-g
upper right side to filter
these, including only active,
only pings and then also
have the ability to only watch a specific map.
lI~OO
~t!JIvtC
~Ir'f'e
~Ir'e
Probes
Probes are functions that the Dude does to check if services are up and
running. Common functions have been configured for you however; you
may wish to modify them. The basic probe that I will cover here is the
TCP/UDP and SNMP probe. The other types, such as functions etc, are really
outside the scope of this book. As these require programming logic,
359
S.rd 1
send. The idea here is
Receive Ir that you can carryon a
-~~---- -~---conversation with the
program on that port, to
the extent that you know
it is running. In most cases, simply connecting is fine; however, some people
wish to actually issue a function. An example would be to issue a normally
valid command to a SMTP server; if that command fails then typically there
is an issue with the server. Both TCP and UDP settings are virtually identical.
( ' _ _ mo , _
__. _
_." .
A/"'.,
360
." . _
__
::::c _:, _.
....
--
Tools
The tools pane allows you to add and control tools that you can access by
right clicking the device. There is a number of built in tools, including
WinBox,
telnet,
snmpwalk,
etc,
however, one tool that I have found
Type' execute
useful is M5T5C, or terminal services. I
Name TERM SVR
L
do use Dude to monitor w indows
~ Insert V,.i.>bIe
servers and having the ability to right
;;;;I.CIv: IDevice.F".lAddressl
click on the device and term serv right
Com mand
into the server makes it very simple.
M5T5C uses a command line of MSTC
/v:address.
So
it
is
very
simple
to
build
oevce: aI
this tool. I click the plus, to add a new
~
tool, and then give it a name. Now I
simply enter the command line, along
with the address variable.
If you wanted to build a 55H tool, simply add another tool, name it, and then
make sure the 55H application is in your path, or you will need to specify
that path. In my case, I use putty. So, my command line would be very
simple: putty address. That's it. If you have other tools you can enter them
361
362
363
User Manager
License Level
Number of
Active Users
10 Users
20 Users
50 Users
Unlimited
364
365
N u m b el" ct us: c rs :
. ........_ ,,
ri..~.~.~.
.....
:~h'\I'. j
, ......
Upload limit: [
r-
IJr~ "'illIl :
. .. .. ~.-.-.-......~-.-.-.-.~~-.~,
i r: o r r,!d: t ;
_._
~"l:
<It
_.. -.--"
'" ,"i}
_-_
__
There are a few things to note on here, the /userman page is meant for
managing your User Manager system. There is a user level access page at
/user. This would allow users to access their accounts, add time, make a
payment etc. Also, most users are used to not using a port number, so in
many cases, I would leave your RouterOS WWW service on port 80 so that
users as well as you have simple access to the management pages.
366
,;
POUYlonJ:
Without
11"":"',,,'-"" '--_..._-- - -1
1~~ljb:\
-I
PriVdlt' Infurmdtiun : ..
I
G ro up: L
Addrt"u t.tett I
I" Addr('u:
Pool
""lA f n .. :
__
.__._..I
I
1('
10
U p U m t" lll,lIl:
In
- --. - ]
1(,:.
nate lunlts:
Ilptinlf'l ll.,.d:
uownleed
n'l
lJ~f'd: (I
Uplo,)d Ust.'d : \3 B
,
r~t,.ntl: {
loUin : !ddr ur
~d~~"urd: l;===:.:::
::::::::::::::::::::::~
Pdrrlll;
! .JJ f r ll r
....
'L ,
I.,",
PubIu. t1 u.1.: 1~1I~'''::'::
. :;=:::::::::::::::::::::;
Pullli(. 10;
l r - - - - - -----,
...
Vuul.hcr Ternplatu; .
Subscribers are customers. The difference is they are the "top" customer.
They have their own authorize. net, account, their own routers, their own
367
-------
"J
:::J
Name: jl L> av
Tim ~ ,
full nrtce:
17;;;)-----.. ..---------------- - ,
L!!av;J]
N a me ,
~'12~3=:==========1
IP Address: 1172,25.0.1
I
make a Radius query against the
Sh iu'ed SeU'f.>t: ~ ..- - - - I
User Manager database. They
are Radius clients where the
User Manager system is the
o
A CCOlJ ntln g ok
Radius server. Inside here you
o Accounhn q failed
have a few options. The name
of the router, the IP that the
client request is going to come
from, the shared secret as well
as the logging options that you wish to have enabled. Note that when you
have an active system, logging every login etc, can take up considerable disk
space.
.L
NOTE: At the t ime of writing this book, v3 of User Manager does not allow
wildcards, or subnets in the IP address field. You must have the exact IP
address for this to work. If you wish to get around th is, create a PPTP tunnel
and setup policy based routing on your remote site to use the tunnel for
368
RouterOS Settings!
Yes, before you begin, of course your RouterOS system has to have an
internet connection, but more importantly, we have to configure your
RouterOS system to ensure that User Manager works! Yes, there is
configuration inside RouterOS that has to be done or your User Manger
system WILL NOT WORK. These are the requirements:
That's it, there are not many requirements, but they are requirements to
make the system work. First off, could we not run with a properly
configured e-mail tool? Nope, because User Manager sends out the e-mails
and needs configuration to accomplish this. Then what is the clock for?
When sending a request to either authorize.net or PayPal, the system
generates a hash based on the time and date to secure the communication
between the user manager system and the payment gateway. If the
payment gateway receives data that from 1970 (the default date on
RouterBoards), the system will reject it as bad data, and you will never get a
card to process!
369
s:;,.. bject:
...................................................................
~rC;-'HJrJ
0"
,::rn .'s d
f.'.(Jr.1~.. ,:
'l{,..
.~b!$W"rd;
370
IJ:: .~ It ~
371
--- - - -
Con/jguTation of Credits
Nam e:
T i m e:
full Price :
...........................................................................................
(1.~__
__---1
available
372
When users click the sign-up link from your splash page, this is where they
should be taken, remember,
that you will need to allow this
URL and/or IP in your walled
garden. This page will allow
your users to enter their email address, create a new
login and password, and select
how much prepaid time they
wish. Since this system has
authorize.net configured, they
will pay with a credit card.
choo se one
373
User Sign-In
The users also have a page that they can sign in and update their account,
and add more time . This page is http://ipaddress/user.
Summa
l'otd l n etce :
.00
us:
LJ p t lll1 e Ue e d : :JJfI
,
""
"
.... d,
"
'"
..
: 3~'( ,
_ . _ _
..............
.. .. ..
.1 uti
ic
;--
n.
.-
~ D. !-.
.-.
---
10 'v h om "rtm e
c.
.-_.....-_.__.__...
-.-
Apl! H / ': 0 0 9
(!'iI
.
3 _23
. ..
_.........
......!
iv
upt tm e L.}!\1 D l.wnl o ad ~:V unle ed ~i
I
--
H)'J
~; Ki~:
Active Sessions
The active sessions/users page will show you the users that are currently
logged in. Upon them logging out the radius system should receive
accounting information updates, showing how much time they used, as well
as data transfer information
-
~--.
0 1i/\7 Us e rn arne
0 1 ... et~ ~ ...;
.'
"'0 Prepaid
..
-. .. '< f<
~
. "
.:
-,
"
------------------._-----------------limr. left
.... ......_......_............
_._~
']
'0
HPJ
(~
,
...
j'.\
~o
':"'.' 4
.,
Mlf::
Vouchers
The User Manager system also allows you to create vouchers. These would
be some form of card, or paper that you can sell in a retail business to
customers . These cards will contain username/passwords that have a
specific amount of session time. You could give out free 1 hour vouchers;
every username/password is different so you would not have to worry about
374
..:. / t l ,>
.c:t;r ..
Cle llr
Add users
Number ot us ers:
I:o.l
--.J
I
Pool name: I
I
I
I
Uptime limit:
lOs
Gr o u p:
Download limit:
Once
you
are
happy with the
way your voucher
will look; now you
can go ahead and
generate
them.
To do this, on the
main status page of
the User Manager
admin
interface,
you use the add
users section on the
right .
375
376
Upon
logging
into
the
command
line,
you
will
get
username@systemidentity of the RouterOS system you are using.
the
Note that the command line interface also changes to show what menu
option you are in. I will now change to just the ip submenu
[admin@COREj lip address>
[admin@COREj lip>
To change to the upper menu, I simply added the dot dot and hit enter. This
will let you go up a menu item. Let's change to see the wireless registrations.
[admin@COREj lip> jinterface wireless registration-table
[admin@COREj /tntertece wireless registration-table>
Note here that I used a forward slash in front to change to another menu
that is not underneath the IP ADDRESS menu that I was in before. I could
also have used a forward slash by itself, hit enter, and then typed the rest of
the menu out. Typing the long line of menu items can be time consuming
though, so let's change to another menu, our IP -7 Firewall -7 Address-List
Menu.
377
Here, I used the forward-slash to start out with, but note that some of the
menu items are not completely typed out. If you type the first few letters of
the menu item and there is no other menu item that would match the first
few letters, that is all you need. You can also check your work by hitting the
TAB button. For example if I typed in lip fire add and then hit the TAB key, it
would auto fill with lip fire address-list for me. This will work on multiple
levels, so on the firewall menu item, I could have hit TAB then typed ADD
and then hit TAB again.
Now let's look at some options inside a menu. So switch over to the IP -7
Firewall -7 NAT menu, and list all of the NAT rules.
[admin@COREj l ip firewall address-list> lip fir nat
[admin@COREj lip firewall nat> print
Flags: X - disabled, I - invalid, 0 - dynamic
OX;;; place hotspot rules here
chain =unused-hs-chain action =passthrough
1
chain =dstnat action =dst-nat to-addresses=172.25. O. 5 protocol=tcp
dst-address=99.184.190.92
dst-port=25,143,80,443,53
2
chain=dstnat action=dst-nat to-addresses=172.25.0.5 protocol=udp
dst-address=99.184.190.92 dst-port=53
First we changed to the proper menu, and then issued a print command. In
many cases you can just type PR as well. This lists out any of the rules, if
they are valid, dynamic etc, and lists what they do. Now we will change item
two by specifying a different to-address.
[admin@COREj l ip firewall nat> set 2 to-addresses=172.25.0.99
I used the set command to set a parameter in that specific rule number. If
we wished to create a rule, we would use the add command, and to remove,
we simply use the remove command. You can also move items from one
spot to another by using the move command. To move item 2 to 1, you
would type move 21 and that's it.
99% of the commands in the command line interface are done this way. It is
very simple to use. Remember that you can always use a question mark to
378
find out what menu and options you have in any given locati on in the
command line interface.
379
, ;
'"
You want a super quick reference guide that explains how to do common
features in RouterOS? This is it! Step by Step instructions on how to get
common tasks done quickly!
running.
Power on RouterBoard
Press any key to enter RouterBoard BIOS setup
files,
ensure
compatibility
with
Press Install
RouterBoard Will install, will prompt to press any key to reboot
after installation
RouterBoard will boot to NAND, generate SSH keys, start services
and show login prompt!
380
Physical Links
Each side will need to have a RouterBoard, and individual ports for
each link, plus an extra Ethernet for your out from the failover
system.
Link one, the one we wish to prefer, will be plugged into ether 1 on
both RouterOS units on each end
381
Overdue Chain
Allow TCP and UDP Port 53
382
383
384
385
Appendix
"
,-
386
II
1
,
,
387
Index
-
Access List, 57
Access Lists, 227
Accounting, 294
Active Users, 73
Address Lists, 129
Address Resolution Protocol, 109
API, 76
Area Prefixes, 231
ARP,109
ARP List, 110
Auto Upgrades, 302
Backup / Restore, 79
Bandwidth Test Client, 304
Bandwidth Test Server, 303
BGP,322
Bindings, 275
Bonding, 177
Bridge, 170
Bridge Ports, 171
Bridged Access Point
Configuration, 104
Bridged Client, 105
Brute Force Attacks, 145
Bursting, 260
Chains, 125
Change MSS, 153
Change TOS Bit, 153
Checking Gateways, 114
Choosing a Tunnel Type, 212
Clock, 297
Command Line Interface, 377,
386
Connection
Connection
Connection
Connection
Connection
388
Bytes, 132
Limiting, 135
Lists, 230
Marks, 152
States, 122
Nth, 138
NTP,298
One-to-One NAT, 159
OpenVPN , 205
OpenVPN Client, 206
OpenVPN Server, 205
OSPF,320
Other Chains, 126
Outages, 359
Outbound NAT, 158
Output Chain, 125
Packet Flow, 124
Packet Marks, 151
Packet Sniffer, 307
Paid Hotspots, 273
Parents, 261
Peer to Peer Filtering, 133
Per Connection Load Balancing,
383
POD Attacks, 146
Policy Based Routing, 116
Pools, 296
Port Scan Detection, 136
PPP, 189
PPPoE,201
PPPoE Client, 57
Private VPN, 384
Probes, 359
Protecting Networks, 143
Protecting Your Router, 142
Pseudobridge Mode, 106
Queue Trees, 258
Queue Types, 251
Quick Reference Guide, 380
Radius Client, 290
Radius RouterOS Users, 74
Random, 137
RED Queues, 253
Redirect, 162, 382
Registration Table, 53, 229
Reset Configuration, 300
389
390
,
J
,I
391
"
1'