Table of Contents

MikroTik

See also other Mikrotik pages in this wiki

See also Sonora Comm Default MikroTik Configuration Script

See also Mikrotik Failover to a Second Internet Connection

http://www.mikrotik.com/index.html

http://www.mikrotik.com/download

http://routerboard.com/

Mikrotik offers a lot of value:

Configurators

Firewall Configurator: QoS Configurator: http://mikrotikconfig.com/firewall/

QoS Configurator: http://mikrotikconfig.com/qos/

Load Balance Configurator: http://mikrotikconfig.com/loadBalance2WANs/

Load Balance Configurator: http://mikrotikconfig.com/loadBalance3WANs/

Third Party Products

http://www.mikrotik.com/mfm

Distributors

http://routerboard.com/distributors

Upgrading

http://wiki.mikrotik.com/wiki/Manual:Upgrading_RouterOS

http://wiki.mikrotik.com/wiki/Bootloader_upgrade

http://blog.butchevans.com/2010/08/routeros-upgrade-process/

http://wiki.bluecrow.net/index.php/Mikrotik_Upgrading

http://www.mikrotik.com/download

Safe Mode

http://wiki.mikrotik.com/wiki/Console#Safe_Mode

Enter Safe Mode: [CTRL]+[X]

Save Changes and Exit: [CTRL]+[X] again

Exit Without Saving: [CTRL]+[D]

Safe mode can be used to minimize the risk of losing contact with the router while performing configuration changes.

Backup and Restore

http://wiki.mikrotik.com/wiki/Manual:Configuration_Management#System_Backup

Command Line

/system backup load name=[filename]

/system backup save name=[filename]

You can also export or import the configuration to the console or to a file.

export compact file=mikrotik_config_backup

Configuration

:!: Winbox runs well under Wine on Linux.

http://wiki.mikrotik.com/wiki/Manual:Initial_Configuration

http://wiki.mikrotik.com/wiki/How_to_configure_a_home_router

http://wiki.mikrotik.com/wiki/How_to_Connect_your_Home_Network_to_xDSL_Line

Default Configurations and Useful Command Line Examples

http://wiki.mikrotik.com/wiki/Manual:Default_Configurations

Reset to Defaults

CLI

/system reset-configuration

or

/system reset-configuration no-defaults=yes 

Reset Button

The reset button has three functions.

Hold the button, then apply power.

Depending on when you release the button, it will do these things:

Link how to use Netinstall: http://wiki.mikrotik.com/wiki/Netinstall

First Login

:!: Changing the LAN interface and DHCP pool probably requires a reboot!

Set Password

System → Users → Double-Click 'admin' → Password

WAN Interface

Dynamic Address

IP → DHCP Client → Add New → ether1

Static Address

IP → DHCP Client → Delete if exists IP → Addresses → Add New

NAT

IP → Firewall → NAT → Add New

DMZ

This is like the DMZ feature of other router/firewall devices:

/ip firewall nat add chain=dstnat dst-address=<external-IP> action=dst-nat to-addresses=<internal-IP>

Default Gateway

IP → Routes → Add New

Name Resolution

IP → DNS → Add New

Time

SNTP Client → Primary → 199.102.46.73 SNTP Client → Secondary → 64.16.214.60

Clock → Time Zone Name → America/Phoenix

Interfaces

Interfaces can be:

WAN Interfaces

IP → Addresses → Add New → Use Ether1 as WAN IP → Addresses → Add New → Use Ether2 if WAN2 is needed

LAN Interfaces

IP → Addresses → Add New → Use others as LAN

Wireless

http://wiki.mikrotik.com/wiki/Manual:Initial_Configuration#Wireless

Wireless Channels

:!: The scan feature cannot be run if you are connected wirelessly

Bridged

Wireless Security

Wireless → Security Profiles → Add New

DHCP Server

:!: If you have any problems with the DHCP server (maybe it didn't hand out a gateway address?), try deleting all existing pools and all existing DHCP servers, then run the DHCP Setup Wizard. In fact, this is probably the fastest, easiest way to configure the DHCP server in most all cases.

IP → DHCP Server → DHCPDHCP Setup

/ip dhcp-server setup

/ip dns set allow-remote-requests=yes

Manual DHCP Server Configuration

Create the address pool first:

IP → Pool → Add New

Add the DHCP server:

IP → DHCP Server → Add New

This will also create a caching DNS server for use by DHCP clients:

IP → DNS → Settings → Click (+) twice then enter two DNS server IPs → DNS → Settings → Allow Remote Requests

Port Forwarding (Destination NAT)

http://wiki.mikrotik.com/wiki/Manual:Initial_Configuration#Port_forwarding

IP → Firewall → NAT → Add New

/ip firewall nat add chain=dstnat dst-address=<external address> protocol=tcp dst-port=<external port> \
 action=dst-nat to-address=<internal address> to-ports=<internal port>

Remote Management

http://aacable.wordpress.com/2011/08/15/mikrotik-howto-prevent-mt-host-from-invalid-login-attempts-from-lanwan-users/

IP → Services → www

Firewall

http://wiki.mikrotik.com/wiki/Home_Firewall

http://wirelessconnect.eu/articles/securing_mikrotik_router_firewall

http://wiki.mikrotik.com/wiki/Manual:IP/Firewall

/ ip firewall filter
add chain=input connection-state=established comment="Accept established connections"
add chain=input connection-state=related comment="Accept related connections"
add chain=input connection-state=invalid action=drop comment="Drop invalid connections" 
add chain=input protocol=udp action=accept comment="Allow all UDP" disabled=no 
add chain=input protocol=icmp limit=50/5s,2 comment="Allow limited ICMP" 
add chain=input protocol=icmp action=drop comment="Drop excess ICMP" 
add chain=input in-interface=ether2 src-address=192.168.1.0/24 comment="From our LAN" action=accept
add chain=input action=log log-prefix="DROP INPUT" comment="Log everything else"
add chain=input action=drop comment="Drop everything else"

Dynamic DNS

http://networkingforintegrators.com/2012/08/dyndns-updater-for-mikrotik/

http://wiki.mikrotik.com/wiki/Dynamic_DNS_Update_Script_for_dynDNS

http://wiki.mikrotik.com/wiki/Dynamic_DNS_Update_Script_for_dynDNS_behind_NAT

Scripts

http://networkingforintegrators.com/2013/02/mikrotik-how-to-import-a-script-in-an-rsc-file/

Serial Port

http://wiki.mikrotik.com/wiki/Manual:System/Serial_Console

Serial Console

The Serial Console feature is for configuring the router.

:!: If choosing a USB serial adapter, choose one with a FTDI chipset such as this one:

http://www.amazon.com/Premium-Speed-Serial-RS-232-Converter/dp/tech-data/B006PIU2KO

:!: When choosing a serial terminal program, you can use Putty:

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

System → Console System → Ports

/system console print
/port print detail

Serial Terminal

http://wiki.mikrotik.com/wiki/Serial_Port_Usage