Configuring an FTP server on MikroTik Router OS

Usually an FTP server on MikroTik Router OS is enabled and uses ports 20 and 21 for communication.
Connection type without encryption, login and password are same as for access to mikrotik.

You can connect by typing the ip address of the router in the browser’s address bar:
ftp://192.168.88.1

Via the graphical interface, the FTP service is turned off and turned on in the “IP” – “Service”

Through the command line:

ip service disable service_number
ip service enable service_number

View a list of services:

ip service print

To view the information about the files, you can run the following command:

file print detail
disk print detail

Configuring graphs in Mikrotik

The graphs are an excellent tool for monitoring the device’s processor load, disk and RAM, voltage and temperature, and the amount of traffic transmitted through network interfaces.
Via Winbox or the web-based interface, the settings can be found in the “Tools” -> “Graphing” menu.

I will describe the following commands in order:

Frequency of recording of collected data (standard 5 minutes):

tool graphing set store-every 24hours|5min|hour

The refresh rate of the chart page (standard 300):

tool graphing set page-refresh integer|never

Graphing interface
The IP range from which graphs are allowed to be viewed (standard 0.0.0.0/0):

tool graphing interface allow-address ADDRESS

Description of the current record:

tool graphing interface comment TEXT

Determines whether the element is used:

tool graphing interface disabled yes|no

Determines which interface will be monitored (standard all):

tool graphing interface interface all|interface

Specifies whether to store collected information on the system disk (standard yes):

tool graphing interface store-on-disk yes|no

Graphing queue
The IP range from which graphs are allowed to be viewed (standard 0.0.0.0/0):

tool graphing queue allow-address ADDRESS

Whether to allow access to schedules from queue’s target-address (standard yes):

tool graphing queue allow-target yes|no

Description of the current record:

tool graphing queue comment TEXT

Determines whether the element is used:

tool graphing queue disabled yes|no

Which queues will be monitored (everything is standard):

tool graphing queue simple-queue all|NAME

Specifies whether to store collected information on the system disk (standard yes):

tool graphing queue store-on-disk yes|no

Graphing resource
The IP range from which graphs are allowed to be viewed (standard 0.0.0.0/0):

tool graphing resource allow-address ADDRESS

Description of the current record:

tool graphing resource comment TEXT

Determines whether the element is used:

tool graphing resource disabled yes|no

Specifies whether to store collected information on the system disk (standard yes):

tool graphing resource store-on-disk yes|no

You can see the graphs in the address bar of the browser http://ADDRESS/graphs/
If you reboot the router, the graphics will remain, if you update firmware, they will be deleted.

The solution of the error “Kernel failure” and “Out of memory” in Mikrotik

There was a problem, often began to reboot itself MikroTik CAS125-24G-1S-RM.
The firmware at that time was the last one – WebFig v6.9
The following information was displayed in the logs:

System rebooted because of kernel failure
Out of memory condition was detected
router was rebooted without proper shutdown

Having looked in “system” -> “resources” it was evident that the free memory of the device is constantly decreasing.
Then I began to recall what was involved and configured on the device.
Bumping into and looking “Cache Used” in “IP” -> “Web Proxy” it was evident that the size of the cache is constantly growing.
From here it was clear that when the device’s memory was running out and the kernel crashed.
Therefore, the solution to this problem was to restrict the proxy cache by specifying the maximum size in the “Max. Cache Size“.
Done.

Configuring Cloud in Mikrotik

Starting from the version of RouterOS v6.14, the Cloud function is added which allows using the Dynamic DNS name for a device that is automatically assigned and can be accessed by it even if the IP address is changed.

Example of switching through the console:

ip cloud set enabled=yes

Example of viewing parameters:

ip cloud print

Enable device time update with DDNS server time (if SNTP or NTP service is not configured):

ip cloud update-time yes/no

Immediate update of DDNS:

ip cloud force-update

View the DDNS name:

ip cloud dns-name

View the public IP address to which DDNS is bound:

ip cloud public-address

Binding DDNS to a local IP address instead of a public one, for example to 192.168.1.101, etc.)

ip cloud advanced use-local-address yes/no

View the current status of the Cloud (updated, updated, error, etc.):

ip cloud status

Through the graphical interface of the Cloud settings can be found in the menu “IP” – “Cloud”.

How to configure PPPoE in Mikrotik

To configure the PPPoE connection, open the web interface of the device by opening the link http://192.168.88.1 (its standard ip address) in any browser.
Then in the menu, open the tab “PPP“, push the button “Add” (red plus if via Winbox), choose “PPPoE Client“.
In the window that opens, specify the connection parameters, in the first tab “General” we indicate:

Name: (any word in English, this will be your PPP connection name)
Interfaces: ether1 (specify the WAN interface that looks towards the provider or PPPoE server)

Next, open the tab “Dial Out” and specify:
User: (PPP user name)
Password: (password)
Put a tick “Add Default Route” (if the routes are to be set automatically)
Put a tick “Use Peer DNS

Click “OK“, after which the connection will be configured and the letter “R” which means that the connection was successful.
If the letter does not appear, you can see the logs by clicking on the menu on the left “Log“, by which you can determine the connection error.

Mikrotik SMB – file server configuration

I will use the Mikrotik RB951G-2HnD router as an example.

Connect the media to the USB router.
Let’s look at the status:

store disk print

Format it:

store disk format-drive 1

Reboot the router:

reboot

Add storage:

store add name=share disk=usb1 type=user-manager activate=yes comment="test"

Add share:

ip smb share add name=test max-sessions=15 directory=/test disabled=no comment="test share"

Example of disabling share:

ip smb share disable

Enabling smb:

enable smb

I will give examples of some commands:
ip smb print (view parameters)
ip smb set allow-guests yes/no (allows connection to guest users without entering a password, standard yes)
ip smb set comment TEXT (comment, standard MikrotikSMB)
ip smb set domain NAME (setting the name of the workgroup, standard MSHOME)
ip smb set enabled yes/no (SMB on/off, standard no)
ip smb set interfaces all/wlan1/bridge-local/… (installation of interfaces on which SMB will be started, standard all)

ip smb users add read-only=no name=LOGIN password=PASSWORD disabled=no (user creation)
ip smb users disable (disabling the user)
ip smb users enable (user activation)
ip smb users print (view the list of users)
ip smb users remove (deletion of the user)
ip smb users set read-only=no name=LOGIN password=PASSWORD (user change)

ip smb share enable
ip smb share print (view share list)
ip smb share remove
ip smb share set (changing the parameters of the share)

To get help, use the “?” character on the command line.
To go to the level above – “..”.

Example of configuring the firewall for smb:

add action=accept chain=input disabled=no dst-port=137-138 protocol=udp src-address-list=smb-allow
add action=accept chain=input disabled=no dst-port=137,139 protocol=tcp src-address-list=smb-allow
ip firewall address-list add address=1.1.1.1 disabled=no list=smb-allow

Official documentation:
wiki.mikrotik.com/wiki/Manual:IP/SMB
wiki.mikrotik.com/wiki/Manual:Store

You can also connect a hard drive to the router via the USB-SATA adapter.

Configuring PIM on MikroTik

Here is an example of configuring PIM on two MikroTik routers:

Let us configure the first MikroTik.
Add a pim interface and check:

routing pim interface add
routing pim interface p

Add the IP address of RP (this MikroTik):

routing pim rp add address=IP-ADDRESS

Let’s specify from which IP multicast traffic is allowed:

routing pim interface set alternative-subnets=238.0.0.0/24,239.0.0.0/24

Let’s configure the second MikroTik.
Add a pim interface to the uplink WAN port, I have ether1:

routing pim interface add interface=ether1
routing pim interface p

Add the IP address of the RP (the first MikroTik):

routing pim rp add address=IP-АДРЕС

Let’s specify the route of the multicast source: (first MikroTik):

ip route add 239.0.0.0/24 via IP-АДРЕС

Done.

How to restore the standard mac-addresses of MikroTik interfaces

Recently, I had to copy the settings of one MikroTik router to another one and after I saved the settings to a file and populated them on the second, I noticed that mac addresses were also copied.

Therefore, we had to reset them to standard ones.
First, let’s see what the interface numbers are (I have ether1 for 0, ether2 for 1, etc.):

interface ethernet print

And reset their mac-addresses:

interface ethernet reset-mac-address 0
interface ethernet reset-mac-address 1
interface ethernet reset-mac-address 2
interface ethernet reset-mac-address 3
interface ethernet reset-mac-address 4

If you need to reset the mac of the wireless interface, then save the wireless settings to the file:

interface wireless export file wifibackup

Look at the wireless interfaces (I have one at number 0):

interface wireless print

Reset all settings including the mac address:

interface wireless reset-configuration 0

Restore the settings from the previously saved file (mac-address in this case will remain standard):

import wifibackup.rsc

Done.