Mikrotik hacks

How to install Python and Virtual Environment on RouterOS Mikrotik?

/system package update
/system package install python

pip install virtualenv
virtualenv myenv
source myenv/bin/activate
pip install requests # E.T.C.

 

For show password of WLAN in Mikrotik RouterOS just run this command it in terminal:

[admin@MikroTik] > /interface wireless export

Changing MAC address for interface:

In graphic mode:

  1. Press button Interfaces
  2. Choose interface in Interface List
  3. open it
  4. in field MAC Address or Admin. MAC Address type new MAC
Ethernet
interface ethernet set ether1 mac-address=01:23:45:67:89:00
Bridge
interface bridge set bridge1 admin-mac=01:23:45:67:89:00
Wireless
interface wireless set wlan1 mac-address=01:23:45:67:89:00

Backup and restore Mikrotik configuration:

Restore

import file=config_backup_444.rsc

Backup

export file=config_backup_444.rsc

Backup MikroTik with secrets/passwords

export show-sensitive file=config_backup_444.rsc

 

See also  GNU/Linux hacks

 

Force MAC to Bridge Mikrotik

The MikroTik wiki mentions two options – admin-mac and auto-mac. These two can be used to force the bridge to use a static MAC address. I just selected the current auto-generated MAC to use for this purpose. You can get the current bridge configuration using the following command:
[admin@MikroTik] > /interface bridge print Flags: X - disabled, R - running 0 R name="bridge1" mtu=auto actual-mtu=9000 l2mtu=10218 arp=enabled arp-timeout=auto mac-address=4E:A4:50:F4:E7:1C protocol-mode=rstp fast-forward=yes igmp-snooping=no auto-mac=yes ageing-time=5m priority=0x8000 max-message-age=20s forward-delay=15s transmit-hold-count=6 vlan-filtering=yes ether-type=0x8100 pvid=1 frame-types=admit-all ingress-filtering=no dhcp-snooping=no
I then forced a specific MAC address using the following:
[admin@MikroTik] > /interface bridge set bridge1 admin-mac=4e:a4:50:f4:e7:1C auto-mac=no
And you can validate that the change stuck using the print command again:
[admin@MikroTik] > /interface bridge print Flags: X - disabled, R - running 0 R name="bridge1" mtu=auto actual-mtu=9000 l2mtu=10218 arp=enabled arp-timeout=auto mac-address=4E:A4:50:F4:E7:1C protocol-mode=rstp fast-forward=yes igmp-snooping=no auto-mac=no admin-mac=4E:A4:50:F4:E7:1C ageing-time=5m priority=0x8000 max-message-age=20s forward-delay=15s transmit-hold-count=6 vlan-filtering=yes ether-type=0x8100 pvid=1 frame-types=admit-all ingress-filtering=no dhcp-snooping=no [admin@MikroTik] >
 

Removing connections:

/ip firewall connection remove [find dst-address~"8.8.8.8" protocol~"tcp"]

 

See also  iLo server power on Python script for Telegram Bot
Author: admin

Leave a Reply

Your email address will not be published. Required fields are marked *