/export show-sensitive file=config
#Задаем имя устройства
/system identity set name=MikroTik
#Включаем доступ по SSH
/ip ssh set always-allow-password-login=yes forwarding-enabled=remote
#Включаем SNMP для мониторинга в Zabbix
/snmp set contact=know.sheredeka.ru enabled=yes location=Russia trap-generators="" trap-version=2
#Настраиваем часы
/system clock set time-zone-autodetect=no time-zone-name=Europe/Moscow
/system ntp client set enabled=yes
/system ntp client servers add address=ru.pool.ntp.org
#Ставим Пинг-Чек, особенно полезно для LTE моделей
/system watchdog set ping-start-after-boot=10m ping-timeout=5m watch-address=77.88.8.8
#Создаем GRE интерфейс и присваиваем адрес:
/interface gre add allow-fast-path=no name=gre-to-ideco remote-address=<внешний ip-адрес Ideco>
/ip address add address=<ip-адрес GRE интерфейса микротика>/30 interface=gre-to-ideco
#Настройка ip-sec
/ip ipsec profile add dh-group=modp4096 enc-algorithm=aes-256 hash-algorithm=sha256 name=ipsec-gre-vpn-ideco
/ip ipsec peer add address=<внешний ip-адрес Ideco>/32 exchange-mode=ike2 name=ipsec-gre-vpn-ideco rofile=ipsec-gre-vpn-ideco
/ip ipsec proposal add auth-algorithms=sha256 enc-algorithms=aes-256-cbc name=ipsec-gre-vpn-ideco pfs-group=modp4096
/ip ipsec identity add my-id=fqdn:<Идентификатор микротика в виде fqdn> peer=ipsec-gre-vpn-ideco secret=<PSK ключ>
/ip ipsec policy add dst-address=<внешний ip-адрес Ideco>/32 peer=ipsec-gre-vpn-ideco proposal=ipsec-gre-vpn-ideco protocol=gre
#Разрешаем доступ к микротику из серых сетей
/ip firewall address-list add address=192.168.0.0/16 comment="Grey Lan" list="LAN Grey IP"
/ip firewall address-list add address=10.0.0.0/8 comment="Grey Lan" list="LAN Grey IP"
/ip firewall address-list add address=172.16.0.0/12 comment="Grey Lan" list="LAN Grey IP"
/ip firewall filter add action=accept chain=input comment="Accept for list LAN Grey IP" in-interface-list=!WAN src-address-list="LAN Grey IP"
/ip firewall filter add action=accept chain=output comment="Accept for list LAN Grey IP" dst-address-list="LAN Grey IP" out-interface-list=!WAN
#Добавляем маршруты к сетям за Ideco
/ip route add disabled=no dst-address=<Подсеть за Ideco/24> gateway=gre-to-ideco