[MIKROTIK] GAME X BROWSING - fourslickz/notes GitHub Wiki
/routing table
add name=TO-ISP-GAME fib
add name=TO-ISP-BROWSING fib
---
/ip route
add dst-address=0.0.0.0/0 gateway=103.113.117.209 routing-table=TO-ISP-GAME comment=GATEWAY-TO-ISP-GAME disable=yes
add dst-address=0.0.0.0/0 gateway=10.10.2.1 routing-table=TO-ISP-BROWSING comment=GATEWAY-TO-ISP-BROWSING disable=yes
add dst-address=203.130.196.7 gateway=103.113.117.209 routing-table=TO-ISP-GAME comment=DNS-TO-ISP-GAME disable=yes
add dst-address=45.126.80.8 gateway=10.10.2.1 routing-table=TO-ISP-BROWSING comment=DNS-TO-ISP-BROWSING disable=yes
---
/ip firewall mangle
add chain=prerouting protocol=tcp dst-port=80,443,8080 in-interface=ether1 action=mark-connection new-connection-mark=conn_browsing passthrough=yes
add chain=prerouting protocol=udp dst-port=80,443,8080 in-interface=ether1 action=mark-connection new-connection-mark=conn_browsing passthrough=yes
add chain=prerouting connection-mark=conn_browsing in-interface=ether1 action=mark-routing new-routing-mark=TO-ISP-BROWSING passthrough=yes
add chain=prerouting connection-mark=!conn_browsing in-interface=ether1 action=mark-routing new-routing-mark=TO-ISP-GAME passthrough=yes
add chain=prerouting protocol=udp dst-port=53 in-interface=ether1 connection-mark=!conn_browsing action=mark-routing new-routing-mark=TO-ISP-GAME passthrough=yes
add chain=prerouting protocol=udp dst-port=53 in-interface=ether1 connection-mark=conn_browsing action=mark-routing new-routing-mark=TO-ISP-BROWSING passthrough=yes
---
/ip firewall nat
add chain=dstnat protocol=udp dst-port=53 in-interface=ether1 action=redirect to-ports=53
---
/ip dns
set servers=203.130.196.6,180.131.144.144 allow-remote-requests=yes
SCRIPT
# Disable all active static routes
/ip/route/disable [find where active && static];
# Enable and set GATEWAY-TO-ISP-GAME
/ip/route/enable [find comment="GATEWAY-TO-ISP-GAME"];
/ip/route/set [find comment="GATEWAY-TO-ISP-GAME"] gateway=103.113.117.209;
# Enable and set GATEWAY-ISP-BROWSING
/ip/route/enable [find comment="GATEWAY-ISP-BROWSING"];
/ip/route/set [find comment="GATEWAY-ISP-BROWSING"] gateway=10.10.2.1;
# Enable and set DNS-TO-ISP-GAME
/ip/route/enable [find comment="DNS-TO-ISP-GAME"];
/ip/route/set [find comment="DNS-TO-ISP-GAME"] dst-address=203.130.196.7 gateway=103.113.117.209;
# Enable and set DNS-TO-ISP-BROWSING
/ip/route/enable [find comment="DNS-TO-ISP-BROWSING"];
/ip/route/set [find comment="DNS-TO-ISP-BROWSING"] dst-address=45.126.80.8 gateway=10.10.2.1;
# Set DNS server
/ip/dns/set servers=202.158.3.7,45.126.80.8;