Код: Выделить всё
/interface bridge add name=bridge disabled=no auto-mac=yes protocol-mode=rstp
/interface bridge port add bridge=bridge interface=ether3
/interface bridge port add bridge=bridge interface=ether4
#
/ip dhcp-client add interface=ether1 disabled=no add-default-route=no
/ip dhcp-client add interface=ether2 disabled=no add-default-route=no
/ip address add address=192.168.22.1/24 interface=bridge
/ip pool add name="default-dhcp" ranges=192.168.22.23-192.168.22.255
/ip dhcp-server add name=def-dhcp address-pool="default-dhcp" interface=bridge lease-time=10m disabled=no
/ip dhcp-server network add address=192.168.22.0/24 gateway=192.168.22.1
#
/ip firewall nat add action=masquerade chain=srcnat out-interface=ether1
/ip firewall nat add action=masquerade chain=srcnat out-interface=ether2
/ip route add dst-address=0.0.0.0/0 gateway=192.168.10.1,192.168.0.1 distance=1
/ip route add dst-address=0.0.0.0/0 gateway=192.168.0.1 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=192.168.10.1 check-gateway=ping
Но дальше идёт маркировка пакетов по провайдерам. И как только я добавляю правила файрволла, то теряю доступ к провайдерским подсетям.
Код: Выделить всё
/ip firewall mangle add action=mark-connection chain=input in-interface=ether1 new-connection-mark="CON-IN-ISP1"
/ip firewall mangle add action=mark-connection chain=input in-interface=ether2 new-connection-mark="CON-IN-ISP2"
/ip firewall mangle add action=mark-routing chain=output connection-mark="CON-IN-ISP1" new-routing-mark="ROUTE-ISP1"
/ip firewall mangle add action=mark-routing chain=output connection-mark="CON-IN-ISP2" new-routing-mark="ROUTE-ISP2"
/ip firewall mangle add action=mark-routing chain=prerouting dst-address-type=!local in-interface=bridge new-routing-mark="ISP1-OUT" passthrough=yes per-connection-classifier=both-addresses-and-ports:2/0
/ip firewall mangle add action=mark-routing chain=prerouting dst-address-type=!local in-interface=bridge new-routing-mark="ISP2-OUT" passthrough=yes per-connection-classifier=both-addresses-and-ports:2/1
/ip route add distance=1 gateway=192.168.10.1 routing-mark="ISP1-OUT"
/ip route add distance=1 gateway=192.168.0.1 routing-mark="ISP2-OUT"
Код: Выделить всё
[admin@MikroTik] > ping ya.ru
SEQ HOST SIZE TTL TIME STATUS
0 87.250.250.242 56 248 30ms
1 87.250.250.242 timeout
2 87.250.250.242 timeout
Подскажите, как это сделать. С учётом того, что маскарадинг(нат) будет в дальнейшем обрастать(скорее всего) новыми правилами.