RouterOS by Example Understanding MikroTik RouterOS Through Real Life Applications Stephen R.W. Discher Editor: Bruce Pinnell Cover Design: Enrique Gonzales Illustrator: Phillip Crawford Copyright © 2011 by Stephen R.W. Discher. All rights reserved. This book or any portion thereof may not be reproduced or used in any manner whatsoever without the express written permission of the author except for the use of brief quotations in a book review. Printed in the United States of America, first printing, 2011. ISBN 978-0-615-54704-6 Stephen R.W. Discher LearnMikroTik.com 10770 State Highway 30 Suite 200 College Station, Texas 77845 Table of Contents Acknowledgement INTRODUCTION Who or What is MikroTik? About The Author What is RouterOS? RouterBOARD – The MikroTik Hardware Platform RouterBOARD Product Designations About This Book Chapter 1 -- First Time Access WinBox Navigating WinBox Inside WinBox Safe Mode Example – Entering Safe Mode Command Line Terminal Options Telnet and SSH Serial Terminal Example-- Forgotten Password Creating the Basic Configuration Interfaces Example – Add an IP Address Chapter 2 – User Management Example -- User and Group Assignments and Policy Chapter 3 – Upgrading and Downgrading the Operating System, Package Management Example – Upgrading the Operating System Example – Downgrading the Operating System Example – Upgrading using FTP Example – Adding a Package Example – Best Practice for Package Management Chapter 4 – Router Identity Example – Setting the System Identity Chapter 5 – System Time and the NTP Protocol NTP Client Setup Example – Setting Up the NTP Client System Clock Example – Setting the System Clock Manually and Setting the Time Zone Advanced NTP Server Setup Example – Enabling NTP Server Chapter 6 – Backups Example – Creating a Binary Backup Example – Restoring a Binary Backup Text Based Backups Example – Creating a Text Export (text backup) Example – Importing a Text Backup Chapter 7 – Licensing Example – Determining Your License Level Example – Install a License Chapter 8 – Firewalls Connections Two Ways To Control Access Forward Chain Address Lists Example – The Basic Firewall Chapter 9 – NAT, Network Address Translation Source NAT Destination NAT Special Types of NAT Rules Source NAT With Multiple Public IP Addresses Destination NAT with Action Redirect Example – A Simple Masquerade Rule Example – Destination NAT for a Web Server on the Private Network with Port Translation Example – Source NAT to Source Traffic From a Certain IP Address Example – Destination NAT with the Action Redirect Service Ports -- NAT Helpers Connection Tracking (on and off) Example – Disable Connection Tracking Tools – Torch Example – Determining the Source of Traffic on a Network Chapter 10 -- Bandwidth Limits Simple Queues Bursting Example – Creating a Simple Queue for Computers in an Office Network Example – Creating a Queue for a Destination Host Example – Create a Queue for Local Computers with Burst Packet Mangling Example – Packet Mangling Using Optimal Mangle Traffic Prioritization For Further Study: QOS Example – Queue Priority for VoIP Traffic PCQ – Per Connection Queuing Example – Using PCQ with a Simple Queue, One Limit to All Chapter 11 – Tools Bandwidth Test Utility Example -- Bandwidth Test Utility Monitoring Tools Example – Using Torch to Troubleshoot “Slow” Networks Traffic Graphing Example – Configure a Graph for all Users in a Subnet SNMP – Simple Network Management Protocol Chapter 12 – Local Area Networks ARP Example – Create a LAN that Requires Static ARP DNS Example – Configure DNS Client and Caching DNS Server DHCP – Dynamic Host Configuration Protocol DHCP Client Example – Add a DHCP Client DHCP Server Example – Create a DHCP Server Example – DHCP Static Leases Example – DHCP Server Without an IP Pool HotSpot – Instant Public Internet Example – Set up HotSpot Example – Create IP Bindings Example – Create additional Users Example – User Profiles Example – Server Profiles Example – Walled Garden Example – Creating a Custom Login Page Web Proxy Example – Configuring a Transparent Web Proxy Example – HTTP Firewall, Allowing or Blocking Certain Sites Example – Redirect Users to Certain Sites Example – Logging Web Traffic Example – Logging to a Remote Syslog Server Chapter 13 – Storage System Stores Example – Explore Stores Example – Create a Store Chapter 14 – More RouterOS Tools Email Tool Example – Configure the Email Tool Example – Use a Script With the Email Tool and Scheduler to Create and Send a Backup Netwatch