Refactor multiwan_mikrotik_setup.md to improve clarity and consistency in configuration. Renamed PPPoE client interface to 'RTK-Internet', updated routing table entries for failover and health checks in the main routing table, and adjusted connection marking rules for better readability. Added commands for monitoring routes in the main table.

This commit is contained in:
2025-08-13 22:05:52 +07:00
parent 52ff4437c0
commit 5c2e569e26
8 changed files with 2979 additions and 5 deletions
+25 -5
View File
@@ -58,8 +58,8 @@ add address=192.168.88.254/24 interface=br-lan comment="LAN"
# PPPoE для Ростелеком
/interface pppoe-client
add name=pppoe-rtk interface=ether8 user=your_username password=your_password
add address=87.103.241.8/32 interface=pppoe-rtk comment="Ростелеком"
add name=RTK-Internet interface=ether8 user=your_username password=your_password
add address=87.103.241.8/32 interface=RTK-Internet comment="Ростелеком"
# DHCP для Электронного города
/ip dhcp-client
@@ -95,7 +95,7 @@ add disabled=no fib name=rtab-mts comment="МТС"
### 2. Маршруты по умолчанию
```bash
# Основные маршруты по умолчанию
# Основные маршруты по умолчанию в таблице main
/ip route
add distance=251 gateway=87.103.241.1 comment="Ростелеком основной"
add distance=252 gateway=178.49.24.1 comment="Эл.Город основной"
@@ -106,6 +106,12 @@ add distance=253 gateway=109.174.26.1 comment="МТС основной"
add gateway=87.103.241.1 routing-table=rtab-rtk comment="Ростелеком таблица"
add gateway=178.49.24.1 routing-table=rtab-elcity comment="Эл.Город таблица"
add gateway=109.174.26.1 routing-table=rtab-mts comment="МТС таблица"
# Настройка таблицы main для отказоустойчивости
/ip route
add distance=1 gateway=87.103.241.1 routing-table=main comment="Main Ростелеком"
add distance=2 gateway=178.49.24.1 routing-table=main comment="Main Эл.Город"
add distance=3 gateway=109.174.26.1 routing-table=main comment="Main МТС"
```
## Настройка маркировки (Mangle)
@@ -115,7 +121,7 @@ add gateway=109.174.26.1 routing-table=rtab-mts comment="МТС таблица"
```bash
# Маркировка соединений по входящим интерфейсам
/ip firewall mangle
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=pppoe-rtk new-connection-mark=con-rtk passthrough=yes comment="Маркировка Ростелеком"
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=RTK-Internet new-connection-mark=con-rtk passthrough=yes comment="Маркировка Ростелеком"
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether1 new-connection-mark=con-elcity passthrough=yes comment="Маркировка Эл.Город"
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether7 new-connection-mark=con-mts passthrough=yes comment="Маркировка МТС"
```
@@ -149,6 +155,11 @@ add distance=1 gateway=178.49.24.1 routing-table=rtab-rtk comment="Failover Эл
add distance=1 gateway=178.49.24.1 routing-table=rtab-mts comment="Failover Эл.Город->МТС"
add distance=1 gateway=109.174.26.1 routing-table=rtab-rtk comment="Failover МТС->Ростелеком"
add distance=1 gateway=109.174.26.1 routing-table=rtab-elcity comment="Failover МТС->Эл.Город"
# Рекурсивные маршруты для таблицы main
/ip route
add distance=1 gateway=178.49.24.1 routing-table=main comment="Main failover Эл.Город"
add distance=1 gateway=109.174.26.1 routing-table=main comment="Main failover МТС"
```
### 2. Настройка health check
@@ -165,6 +176,12 @@ add address=8.8.8.8 interval=10s name=ping-mts
add distance=1 gateway=87.103.241.1 routing-table=rtab-rtk check-gateway=ping
add distance=1 gateway=178.49.24.1 routing-table=rtab-elcity check-gateway=ping
add distance=1 gateway=109.174.26.1 routing-table=rtab-mts check-gateway=ping
# Health check для таблицы main
/ip route
add distance=1 gateway=87.103.241.1 routing-table=main check-gateway=ping comment="Main health check Ростелеком"
add distance=2 gateway=178.49.24.1 routing-table=main check-gateway=ping comment="Main health check Эл.Город"
add distance=3 gateway=109.174.26.1 routing-table=main check-gateway=ping comment="Main health check МТС"
```
## Настройка VPN соединений
@@ -213,6 +230,9 @@ add action=mark-connection chain=prerouting connection-mark=no-mark in-interface
/ip route print where routing-table=rtab-rtk
/ip route print where routing-table=rtab-elcity
/ip route print where routing-table=rtab-mts
# Просмотр маршрутов в основной таблице
/ip route print where routing-table=main
```
### 2. Проверка маркировки
@@ -249,7 +269,7 @@ add action=memory topics=firewall
```bash
# Мониторинг состояния интерфейсов
/interface monitor-traffic interface=pppoe-rtk
/interface monitor-traffic interface=RTK-Internet
/interface monitor-traffic interface=ether1
/interface monitor-traffic interface=ether7
```