Configuring MikroTik RB912UAG-2HPnD (BaseBox 2) + Ubiquiti Sector

Recently tuned MikroTik RB912UAG-2HPnD (BaseBox 2).
The sticker says that without the antenna connected it can not be turned on :), it will be used with Ubiquiti Sector AM-2G15, I connected this sector to two contacts.

The standard IP device is 192.168.88.1, the login admin is without a password, DHCP is disabled as standard, so you need to manually register IP on the computer, for example 192.168.88.2 with a subnet mask of 255.255.255.0.

First of all we will change the password in “System” – “Users”.

Set up Wi-Fi settings in “Wireless” – “Interfaces”:
Wireless Protocol: 802.11 so that you can connect to any device

In “Wireless” – “Security Profiles”, configure:
SSID (the name of the wireless network)
Mode: dynamic keys
type of encryption WPA2 PSK AES
WPA2 Pre-Shared Key (wireless password)

Now change the device IP address, in IP – Addresses, the network where it will stand. For example, instead of 192.168.88.1 on 172.16.200.11, after that on the computer, we will manually change the IP registered on the IP from this network, for example 172.16.200.12 so that you can continue to configure.
“IP” – “Routes” add a gateway, for example Dst. Address: 0.0.0.0/0, Gateway: 172.16.200.1.

On this basic setup is completed, the device will work as an access point to the bridge, that is, it will not be issued by the IP, but by the device before it or by billing.

Repairing the Netis WF2419 Firmware via TFTP

I will describe the procedure for restoring the firmware of the Netis WF2419 router via TFTP:

1) Download the latest firmware from the official site
http://netis-systems.com/Suppory/de_details/id/1/de/44
If the firmware was downloaded in a compressed archive, then we unpack it, we need a firmware file with the extension *.bin

2) We will manually register the IP address on the computer, for example 192.168.1.100

3) Connect the computer to the router through the port LAN4.

4) Turn off the power of the router, press the reset button and hold it on, after 3 seconds, release the reset button. After that, the device will enter the recovery mode.

5) Now there will be actions with TFTP. Earlier I wrote articles about TFTP:
Starting a TFTP server in Windows
Installing and Configuring a TFTP Server in Ubuntu.
Actually, you need to send the file of the previously downloaded firmware to the router (its IP in recovery mode 192.168.1.6).
I use TFTP for example in Windows we specify the address of the client 192.168.1.6, the firmware file and press Put thereby starting transferring the file to the router, you do not need to specify anything else.
We are waiting for the completion of the process for several minutes.

Done, the firmware repair process is complete.

Jetpack error solution “Verification secrets not found”

I noticed some error when activating Jetpack:

The Jetpack server encountered the following client error: Verification secrets not found

The reason was found in restricted access over IP through .htaccess to the file wp-login.php, as it turned out that access to this file can not be blocked if Jetpack is used.

That’s why I found lines restricting access and commented them out by putting the # (before each line) symbol (the lines can be in the .htaccess file located in the root directory with WordPress and in the web server configuration files), for example:

#        <files wp-login.php>
#                order allow,deny
#                allow from 127.0.0.1 192.168.2.50
#        </files>

If the lines were in .htaccess, then Jetpack can already be activated, if in the configuration file of the web server, then you still need to restart it to apply the changes.

Also, an error can occur because of conflicting plugins, you can try to turn them off in turn.

How to convert a list of IP addresses to DNS names

In Linux, you can convert a list of IP addresses into DNS names, for example, by a simple script.

To do this, create an empty file with the extension .sh, make it executable and add the content to it:

#!/bin/sh
while read ip traf ; do
    name=`host $ip|awk '{print $NF}'`
    echo -e "$name\t$ip\t$traf"
done >name_ip_traf.lst <ip_traf.lst

Where ip_traf.lst is a file with a list of IP addresses that need to be converted to DNS names.

You can make it executable by the command:

chmod +rwx file.sh

Run the script in the directory where it is located by the command:

./file.sh

Or run by specifying the full path:

/dir/file.sh

After the startup, you must wait for a while or interrupt the execution by pressing CTRL+C.

Change the default value in MySQL columns

I’ll give an example of specifying or changing the default value in the MySQL column.
Let’s see the list of tables in the database:

SHOW TABLES;

Let’s see the structure of the table we are interested in:

DESCRIBE internet_main;

Let’s say the activate column has the type date and the default value is 0000-00-00, and we want to make 3000-01-01, then we will execute sql query:

ALTER TABLE internet_main ALTER activate SET DEFAULT '3000-01-01';

You can also delete the default value:

ALTER TABLE internet_main ALTER activate DROP DEFAULT;

Or return it as it was:

ALTER TABLE internet_main ALTER activate SET DEFAULT '0000-00-00';

In strict mode MySQL can not set the value 0000-00-00, so you can temporarily disable the strict mode:

SET sql_mode = '';