Mikrotik Routeros Training Advanced Wireless Mtcwe
Mikrotik Routeros Training Advanced Wireless Mtcwe
Advanced Wireless
MTCWE
2013
©MikroTik 2010 1
Schedule
• 16:00 – 18 Session I
• 15 min Break
• 18:15 – 20:30 Session II
• 30 min Break
• 21 – 22 Session III
©MikroTik 2010 2
Housekeeping
• Course materials
• Routers, cables
• Break times and lunch
• Restrooms and smoking area locations
©MikroTik 2010 3
Course Objective
• Provide thorough knowledge and hands-on
training for MikroTik RouterOS advanced
wireless capabilities for small and medium
size networks
• Introduce the 802.11n wireless networking
• Upon completion of the course you will be
able to plan, implement, adjust and debug
wireless MikroTik RouterOS network
configurations
©MikroTik 2010 4
Topics Overview
• Wireless Standard overview
• Wireless tools
• Troubleshooting wireless clients
• Wireless Advanced settings
– DFS and country regulation
– Data Rates and TX-power
– Virtual AP
©MikroTik 2010 5
Topics Overview (cont.)
• Wireless Security measures
– Access List and Connect List
– Management Frame Protection
– RADIUS MAC Authentication
– Encryption
• Wireless WDS and MESH
• Wireless Transparent Bridge
– WDS
– VPLS/MPLS transparent bridging
• Wireless Nstreme Protocol
• 802.11n
©MikroTik 2010 6
Introduce Yourself
• Please, introduce yourself to the class
• Your name
• Your Company
• Your previous knowledge about RouterOS
• Your previous knowledge about networking
• What do you expect from this course?
My
number is:_________
©MikroTik 2010 7
Class Setup Lab
• Create an 192.168.XY.0/24 Ethernet network
between the laptop (.1) and the router (.254)
• Connect routers to the AP SSID “AP_N”
• Assign IP address 10.1.1.XY/24 to the wlan1
• Main GW and DNS address is 10.1.1.254
• Gain access to the internet from your laptops via
local router
• Create new user for your router and change
“admin” access rights to “read”
©MikroTik 2010 8
Class Setup
©MikroTik 2010 9
Class setup Lab (cont.)
• Set system identity of the board and wireless
radio name to “XY_<your_name>”. Example:
“00_Janis”
• Upgrade your router to the latest Mikrotik
RouterOS version 4.x
• Upgrade your Winbox loader version
• Set up NTP client – use 10.1.1.254 as server
• Create a configuration backup and copy it to the
laptop (it will be default configuration)
©MikroTik 2010 10
©MikroTik 2010
Wireless Standards
• 802.11b – 11Mbps, 2.4Ghz
• 802.11g – 54Mbps, 2.4Ghz
• 802.11a – 54Mbps, 5Ghz
• 802.11n – 300Mbps, 2.4/5Ghz
©MikroTik 2010 12
Wireless Bands
• 2Ghz
– B, B/G, Only-G, G-Turbo, Only-N, B/G/N,
5mhz, 10mhz
• 5Ghz
– A, A-Turbo, Only-N, A/N, 5mhz, 10mhz
©MikroTik 2010 13
Supported Bands by chipsets
• AR5213/AR5414
– A/B/G, G-Turbo, A-Turbo, 5Mhz, 10Mhz
• AR5416/AR9160/AR9220
– A/B/G/N, 5Mhz*, 10Mhz*
©MikroTik 2010 14
Supported Frequencies
• A/B/G Atheros chipset cards usually
support such frequencies
– 2Ghz band: 2192-2539Mhz
– 5Ghz band: 4920-6100Mhz
• N Atheros chipset cards usually support
such frequencies
– 2Ghz band: 2192-2539Mhz
– 5Ghz band: 4800-6075Mhz
©MikroTik 2010 15
Scan List
• Default frequencies from the scan-list shown
bold in the frequency field (Winbox only)
• Default scan-list value from the country shown
as ‘default’
• Frequency range is specified by the dash
– 5500-5700
• Exact frequencies specified by comma
– 5500,5520,5540
• Mixed option also possible
– default,5520,5540,5600-5700
©MikroTik 2010 16
Wireless tools for finding the best
band/frequency
©MikroTik 2010 17
Wireless Tools
• Scan
• Frequency Usage
• Spectral Scan/History
• Snooper
• Align
• Sniffer
©MikroTik 2010 18
Scan and Frequency Usage
• Both tools use the Scan-list
• Interface is disabled during the usage of
tools
• Scan shows all 802.11 based APs
• Frequency usage shows every 802.11
traffic
©MikroTik 2010 19
Spectral Scan/History
• Uses only Atheros Merlin 802.11n chipset
wireless cards
• Range
– 2ghz, 5ghz, current-channel, range
• Value
– avg, avg-peak, interference, max, min
• Classify-samples
– wifi, bluetooth, microwave-oven, etc
©MikroTik 2010 20
Spectral-history
• Plot spectrogram
• Power values are printed in different colors
• Audible option - plays each line as it is
printed on the routers speaker
– Each line is played from left to right, with
higher frequencies corresponding to higher
values in the spectrogram
©MikroTik 2010 21
Spectral-history
©MikroTik 2010 22
Spectral-scan
• Continuously monitor spectral data
• Each line displays one spectrogram bucket:
– Frequency
– Numeric value of power average
– Character graphic bar
• average power value - ':'
• average peak hold - '.'
• maximum lone floating - ':'
• Show Interference option
©MikroTik 2010 23
Spectral-scan
©MikroTik 2010 24
Wireless Snooper Tool
©MikroTik 2010 25
Alignment Tool
©MikroTik 2010 26
Wireless Sniffer
©MikroTik 2010 27
Wireless Tools Lab
• Enable your AP on one of the 5ghz
frequencies
• Check if that frequency is the less
occupied by using the RouterOS wireless
tools
©MikroTik 2010 28
Use of DFS for automatic
frequency selection
©MikroTik 2010 29
DFS
• Dynamic Frequency Selection (DFS)
• “no radar detect” - at startup AP scans channel
list from "scan-list" and chooses the frequency
which is with the lowest amount of other
networks detected
• “radar detect” - adds capability to detect radar
at start up for 60 seconds and avoid them by
changing frequency
• By most country regulations DFS must be
set to “radar detect”
©MikroTik 2010 30
DFS Lab
• Enable the AP on frequency 5180Mhz
• Enable DFS mode to “no radar detect”
• Disable wireless interface on the AP for few
seconds and enable it back
• Observe frequency jumps
©MikroTik 2010 31
©MikroTik 2010
Analyzing registration table for
troubleshooting the wireless
connection
©MikroTik 2010 33
Troubleshooting Wireless Client
• ACK-timeout
• CCQ
• TX/RX Signal Strength
• Frames vs. HW-frames
• Data-rate jumping
©MikroTik 2010 34
Registration table
©MikroTik 2010 35
CCQ – Client Connection Quality
• Value in percent that shows how effective
the bandwidth is used regarding the
theoretically maximum available
bandwidth
• Weighted average of values Tmin/Treal
calculated for every transmitted frame
– Tmin is time it would take to transmit given
frame at highest rate with no retries
– Treal is time it took to transmit frame in real
life
©MikroTik 2010 36
Frames vs. HW-frames
• Wireless retransmission is when the card sends
out a frame and you don't receive back the
acknowledgment (ACK), you send out the frame
once more till you get back the acknowledgment
• If the hw-frames value is bigger
than frames value then it means that the
wireless link is making retransmissions
• I case of Nstreme you can’t compare the frames
with hw-frames
©MikroTik 2010 37
Using advanced settings for
troubleshooting and fine tuning the
wireless connection
©MikroTik 2010 38
Wireless Advanced Settings
• Advanced Wireless Tab settings
• HW-retries
• HW-protection
– RTS/CTS
– CTS to self
• Adaptive-noise-immunity
• Configuration Reset
• WMM
©MikroTik 2010 39
Wireless Advanced Tab
©MikroTik 2010 40
Advanced Wireless Tab
• Area – string that describes the AP, used in the
clients Connect-list for choosing the AP by the
area-prefix
• Ack-timeout – acknowledgement code timeout in
µs; “dynamic” by default
• Periodic-calibration – to ensure performance of
chipset over temperature and environmental
changes
• Hide-ssid – whether to hide ssid or not in the
beacon frames
©MikroTik 2010 41
HW-retries
• Number of frame sending retries until the
transmission is considered failed
• Data rate is decreased upon failure
• But if there is no lower rate, 3 sequential
failures activate on-fail-retry-time
transmission pause and the counter
restarts
• The frame is being retransmitted either
until success or until client is disconnected
– disconnect-timeout reached
©MikroTik 2010 42
HW-protection
• Frame protection helps to fight "hidden
node" problem
• CTS/RTS protection
• “CTS to self” protection
• hw-protection-threshold – frame size
threshold at which protection should be
used; 0 – used for all frames
©MikroTik 2010 43
RTS/CTS based protection
• RTS/CTS based protection
– Device willing to send frame at first sends
RequestToSend frame and waits for
ClearToSend frame from intended destination
– By "seeing" RTS or CTS frame 802.11
compliant devices know that somebody is
about to transmit and therefore do not initiate
transmission themselves
©MikroTik 2010 44
“CTS to self” based protection
• "CTS to self" based protection
– Device willing to send frame sends CTS frame
"to itself“
– As in RTS/CTS protocol every 802.11
compliant device receiving this frame know
not to transmit.
– "CTS to self" based protection has less
overhead, but it must be taken into account
that this only protects against devices
receiving CTS frame
©MikroTik 2010 45
“CTS to self” or RTS/CTS
• If there are 2 "hidden" stations, there is no
use for them to use "CTS to self"
protection, because they will not be able to
receive CTS sent by other station - in this
case stations must use RTS/CTS so that
other station knows not to transmit by
seeing CTS transmitted by AP
• Use only one protection
©MikroTik 2010 46
HW-fragmentation-threshold
• Maximum fragment size in bytes when
transmitted over wireless medium
• Fragmentation allows packets to be fragmented
before transmiting over wireless medium to
increase probability of successful transmission
• Only fragments that did not transmit correctly are
retransmitted
• Transmission of fragmented packet is less
efficient than transmitting unfragmented packet
because of protocol overhead and increased
resource usage at both - transmitting and
receiving party
©MikroTik 2010 47
Adaptive-noise-immunity
• Adjusts various receiver parameters dynamically
to minimize interference and noise effect on the
signal quality
• Works on Atheros 5212 or newer Atheros
chipset
• Uses CPU power
• 3 options:
– None – disabled
– Client-mode – will be enabled only if station or
station-wds used
– Ap-and-client-mode – will be enabled in any mode
©MikroTik 2010 48
Wireless Configuration reset
• Sometimes after
reconfiguring
advanced settings
you might want to get
back the default
settings
• Use the “Reset
Configuration” option
– resets the current
wireless cards all
configuration
©MikroTik 2010 49
Wireless MultiMedia (WMM)
• 4 transmit queues with priorities:
• 1,2 – background
• 0,3 – best effort
• 4,5 – video
• 6,7 – voice
• Priorities set by
• Bridge or IP firewall
• Ingress (VLAN or WMM)
• DSCP
©MikroTik 2010 50
Modifying data rates and tx-power
for stabilizing wireless connection
©MikroTik 2010 51
©MikroTik 2010
Data rates changing options
• Lower the higher supported data-rates on the
client which have stability issues
• Lower the higher supported data-rates on the AP
if most of the clients have problems running on
higher data rates.
• Not recommended to disable lower data rates
and leave only the higher data rates as
disconnection of the link could happen more
often
• Note that AP and the Client should support the
same Basic rates to establish the wireless
connection
©MikroTik 2010 53
TX power
• Different TX-power for
each data-rate –
higher date rate, less
power
• Disabling the higher
data-rates could
improve the signal as it
uses higher tx-power
on lower data-rates
©MikroTik 2010 54
TX-power-mode
• Default – uses tx-power values from cards
eeeprom
• Card-rates – use tx-power, that for different rates
is calculated according the cards transmit power
algorithm, which as an argument takes tx-
power value
• All-rates-fixed – use one tx-power value for all
rates
• Manual-table – use the tx-power as defined
in /interface wireless manual-tx-power-table
©MikroTik 2010 55
Data rates Lab
• Configure the AP to allow the data-rates
up to 24Mbps data rates and test the max
throughput
• Configure the AP to allow only the 54Mbps
data rate and check the max throughput
and check how stable is the connection
©MikroTik 2010 56
Use of Virtual AP feature for
creating multiple APs
©MikroTik 2010 57
Virtual AP
• Used for creating a new AP on top of the
physical wireless card
• Works for AR5212 and newer Atheros
Chipset cards
• Up to 128 Virtual AP per wireless card
• Uses different MAC address and can be
changed
• Can have different SSID, security profile,
Access/Connect-list, WDS options
©MikroTik 2010 58
Virtual AP Setup
©MikroTik 2010 59
Virtual AP Lab
• Work two together
• Connect both routers using Ethernet cable
• First router
– Create 2 VLAN interfaces on that Ethernet
– Create 2 hotspots – one on each VLAN
– For one Hotspot change the background color of login page
• add background-color: #A9F5A9; in the body line in the login.html page
• Second router
– Create 2 VLAN interfaces on the Ethernet interfaces with the VLAN ID
from the first router
– Create 2 Virtual APs with different SSID
– Bridge first VLAN with first Virtual AP
– Create second bridge with second VLAN and second Virtual AP
• Connect to each Virtual AP and check if one AP has different login
page
• Reset the configuration and switch places
©MikroTik 2010 60
Managing access for AP/Clients
using Access-List and Connect-List
©MikroTik 2010 61
Access Management
• default-forwarding (on AP) – whether the
wireless clients may communicate with each
other directly (access list may override this
setting for individual clients)
• default-authentication – default authentication
policy that applies to all hosts not mentioned in
the AP's access list or client's connect list
©MikroTik 2010 63
Wireless Access List
• It is possible to specify authentication policy for
specific signal strength range
• Example: allow clients to connect with good signal
level or not connect at all
• It is possible to specify authentication policy for
specific time periods
• Example: allow clients to connect only on weekends
• It is possible to specify authentication policy for
specific security keys:
• Example: allow clients only with specific security key
to connect to the AP.
©MikroTik 2010 64
Wireless Access List
©MikroTik 2010 65
Wireless Connect List
• Used for allowing/denying access based on:
• SSID
• MAC address of the AP
• Area Prefix of the AP
• Signal Strength Range
• Security Profile
• It is possible to prioritize one AP over another AP
by changing order of the entries
• Connect list is used also for WDS links, when
one AP connects to other AP
©MikroTik 2010 66
©MikroTik 2010
Access/Connect List Lab
• Peer up with other group (so that there will
be two APs and two clients in one group)
• Leave default-forwarding, default-
authentication enabled
• On APs:
• Ensure that only clients from your group and
with -70..120 signal strength are able to
connect
• (Advanced) Try out Time settings
©MikroTik 2010 68
Access/Connect List Lab
• On clients:
• Ensure that your client will connect only to
your group APs
• Try to prioritize one AP over another
• When APs have same SSID
• When APs have different SSID
• Delete all access list and connect list rules
– change places and repeat the lab
©MikroTik 2010 69
Centralized Access List
Management – RADIUS
©MikroTik 2010 70
RADIUS MAC Authentication
• Option for remote centralized MAC RADIUS
authentication and accounting
• Possibility of using radius-incoming feature to
disconnect specific MAC address from the AP
• MAC mode – username or username and
password
• MAC Caching Time – how long the RADIUS
authentication reply for MAC address
authentication if considered valid for caching
©MikroTik 2010 71
©MikroTik 2010
RADIUS Client Configuration
• Create a RADIUS
client under ‘Radius’
menu
• Specify the Service,
IP address of
RADIUS Server and
Secret
• Use Status section to
monitor the
connection status
©MikroTik 2010 73
Wireless security for protecting
wireless connection
©MikroTik 2010 74
Wireless Security
• Authentication
– PSK Authentication
– EAP Authentication
• Encryption
– AES
– TKIP
– WEP
• EAP RADIUS Security
©MikroTik 2010 75
Security Principles
• Authentication - ensures acceptance of
transmissions only from confirmed source
• Data encryption
• Confidentiality - ensures that information is
accessible only to those authorized to have
access
• Integrity – ensures that information is not
changed by any other source and are exactly
the same as it was sent out
©MikroTik 2010 76
©MikroTik 2010 77
PSK Authentication
• Pre-Shared Key is a authentication
mechanism that uses a secret which was
previously shared between the two parties
• Most common used wireless security type
• Multiple authentication types for one profile
• Optional PSK key for each MAC address
(using Access list)
©MikroTik 2010 78
EAP Authentication
• Extensible Authentication Protocol provides
a negotiation of the desired authentication
mechanism (a.k.a. EAP methods)
• There are about 40 different EAP methods
• RouterOS support EAP-TLS method and
also is capable to passtrough all methods
to the RADIUS server
©MikroTik 2010 79
©MikroTik 2010 80
AES-CCM
• AES-CCM – AES with CTR with CBC-MAC
©MikroTik 2010 84
©MikroTik 2010
Pre-Shared Key (PSK)
• To make PSK authentication
• Use “Dynamic Keys” mode
• Enable WPAx-PSK authentication type
• Specify Unicast and Group Ciphers (AES
CCM, TKIP)
• Specify WPAx-Pre-Shared Key
• Keys generated on association from PSK
will be used in ciphers as entry key
©MikroTik 2010 86
©MikroTik 2010
Unicast Cipher
• On the AP and on Station at least one
unicast cipher should match to make the
wireless connection between 2 devices
©MikroTik 2010 88
Group Cipher
• For the AP
– If on AP the group cipher will be AES and
TKIP the strongest will be used – AES
– It is advised to choose only one group cipher
on the AP
• For the Station
– If on the Station both group ciphers are used it
means that it will connect to the AP that
supports any of these ciphers
©MikroTik 2010 89
EAP RADIUS Security
• To make the EAP passthrough authentication
• Enable WPAx-EAP authentication type
• Enable MAC authentication
• Set EAP Method to passthrough
• Enable RADIUS client
• To make EAP-TLS authentication
• Enable WPAx-EAP authentication type
• Configure TLS option if you plan to use certificate
• Import and decrypt certificate
©MikroTik 2010 90
©MikroTik 2010
Wireless Security Lab
• Make wireless link with your neighbour
using WPA-PSK:
• Create a security profile and use the same
pre-shared key to establish a wireless
connection with your neighbour router.
• On the AP add an Access List entry with
the neighbours MAC address and specify
different PSK key, ask your neighbour to
connect to it again
©MikroTik 2010 92
Protecting wireless clients from
deauthentication and MAC cloning
attacks
©MikroTik 2010 93
Management Frame Protection
• RouterOS implements proprietary
management frame protection algorithm
based on shared secret
• RouterOS wireless device is able to verify
source of management frame and confirm
that particular frame is not malicious
• Allows to withstand deauthentication and
disassociation attacks on RouterOS based
wireless devices.
©MikroTik 2010 94
Management Protection Settings
• Configured in the security-profile
– disabled - management protection is disabled
– allowed - use management protection if supported by
remote party
• for AP - allow both, non-management protection and
management protection clients
• for client - connect both to APs with and without management
protection
– required - establish association only with remote
devices that support management protection
• for AP - accept only clients that support management
protection
• for client - connect only to APs that support management
protection
©MikroTik 2010 95
Management Protection key
• Configured with security-
profile management-protection-
key setting
• When interface is in AP mode, default
management protection key can be
overridded by key specified in access-list
or RADIUS attribute.
©MikroTik 2010 96
Management Protection Lab
• Work in group with 3 persons
• One makes an AP
• Other two connect to the AP
• One of the client clones the other clients MAC
address
• Check connectivity from both clients to the AP
• Set the management protection to required and
specify a key on the AP and on the original client
• Check which client connected – original or
cloned
©MikroTik 2010 97
Wireless WDS and MESH
©MikroTik 2010 98
WDS and MESH
• WDS
– Dynamic WDS Interface
– Static WDS Interface
• RSTP Bridge
• HWMP+ MESH
– Reactive mode
– Proactive mode
– Portals
©MikroTik 2010 99
WDS – Wireless Distribution
System
• WDS allows to create custom wireless
coverage using multiple APs what is
impossible to do only with one AP
• WDS allows packets to pass from one AP
to another, just as if the APs were ports on
a wired Ethernet switch
• APs must use the same band, same SSID
and operate on the same frequency in
order to connect to each other
• Create WDS link with your neighbor router and add that
to the mesh port
• Check again the MESH traceroute to your neighbor