Mikrotik

Nat-Pat Operations from outside to Inside using Mikrotik

Fadıl

In this article, we will learn about NAT-PAT operations and will use the services that will be directed from the outside world through a Mikrotik device. These operations are limited and we will ensure that the services that we determine through port forwarding are used only, not accessing the whole network from outside to inside. What? If you say these services, NAT-PAT will help us to use HTTP and RDP services from outside to inside. However, we will ensure that the HTTP service is used by default over certain ports 80, and RDP over 3344, not 3389. The reason why I do this is to understand the subject a little better and to understand it more. Let’s take a look at the NAT-PAT concepts before starting the process.

Receive Sms Notification from Telegram When Mikrotik Wifi Signal Level Is Distorted

Receive Sms Notification from Telegram When Mikrotik Wifi Signal Level Is Distorted

Fadıl

Follow the signal levels in the Mikrotik AP to which our customers are connected.
in such cases, we can check the signal level and send information SMS to us via telegram.

For this process, we can define the following code as a 3-5 minute task to the scheduler.

You can reach our article about creating telebotID and TeleChatID from the link below.

http://techsoftcenter.com/how-to-create-a-telegram-bot-id-chat-id/ for telebotID and TeleChatID.

:local TELEBOTID xxxxxx
:local  TELECHATID xxxxxx
:local level -65;
:local sub1 ([/system identity get name]);
:local signal;
:local radio;
:foreach i in=[ /int wir reg find] do={ 
  :set signal [int wir reg get $i signal-strength];
  :set signal [ :pick $signal 0 [:find $signal "dBm"]]
  :set radio [/interface wireless registration-table get $i radio-name]
  :if ($signal < $seviye) do={
      /tool fetch url="https://api.telegram.org/$TELEBOTID/sendMessage\?chat_id=$TELECHATID&text=$sub1 $ radio subscriber signal is broken. Signal value $ signal "
  }
}

Keeping the name of your Mikrotik device in / system identity section will keep the device’s name information coming to you correctly.

Sending a Notification Message When the Telegram Mikrotik Ethernet Port Status Changes

Sending a Notification Message When the Telegram Mikrotik Ethernet Port Status Changes

Fadıl

If the port level (10Mbps / 100Mbps 1G or 10G) of the devices connected to the ports of your Switch or Router changes in any way, you may need an application to monitor this situation. A simple application was developed with a telegram on this side. It checks the status of the Ethernet and sends you a telegram message if it has a value other than the one you specified.

If The MikroTik WAN IP Changes, Get a Message To The Telegram

If The MikroTik WAN IP Changes, Get a Message To The Telegram

Fadıl

When the IP information changes in wan interfaces (DSL, Local, any DHCP or VPN client) in Mikrotik, we can use telegram application to ensure that this information can be reached by SMS.
This example has been prepared with telegram since Telegram has become a popular application in the near future. If you change the relevant URL after the “/tool fetch ” the command to SMS API URL, the information will be sent to you as SMS.

How to Create a Telegram Bot ID/Chat ID

How to Create a Telegram Bot ID/Chat ID

Fadıl

To create a bot in today’s popular application Telegram and use it as API in applications;
primarily;
Membership of Telegram.org is required. For this, it is enough to have a working mobile number.

We are installing the Telegram application on our phone.
We validate our mobile phone number for membership and the fields to be requested in the follow-up.
After the membership process, we log on to the telegram web page.
Log in with your member login at https://web.telegram.org the web site and send it to the Telegram application on your phone (not as SMS). The telegram application on our phone will now appear in the browser.
Robot for bot preparation (telegram robot) We are adding BotFather to contact list.
He starts a chat with us, asking us what we want to do.