Posts

Showing posts from December, 2023

MikroTik RouterOS v7 dual DHCP WAN recursive failover PCC load-balancing

ip settings set allow-fast-path=no /interface bridge add admin-mac=FF:FF:FF:FF:FF:FF auto-mac=no name=bridge /interface bridge port add bridge=bridge ingress-filtering=no interface=ether3 /interface bridge port add bridge=bridge ingress-filtering=no interface=ether4 /interface bridge port add bridge=bridge ingress-filtering=no interface=ether5 /interface list add name=WAN /interface list add name=LAN /interface list member add interface=bridge list=LAN /interface list member add interface=ether1 list=WAN /interface list member add interface=ether2 list=WAN #/interface bridge port add bridge=bridge ingress-filtering=no interface=ether6 #/interface bridge port add bridge=bridge ingress-filtering=no interface=ether7 #/interface bridge port add bridge=bridge ingress-filtering=no interface=ether8 #/interface bridge port add bridge=bridge ingress-filtering=no interface=sfp-sfpplus1 /ip address add address=192.168.88.1/24 interface=bridge network=192.168.88.0 /ip dns static add address=1...

RouterOS 7 multiwan pppoe loadbalance script

/interface/list/add name=WAN comment="For Internet" /interface/list/add name=LAN comment="For Local Area Networks" /interface pppoe-client add disabled=no interface=ether1 name=pppoeout-01 add-default-route=no user=fpt1 password=fpt1 add disabled=no interface=ether2 name=pppoeout-02 add-default-route=no user=vnpt1 password=vnpt1 /interface/bridge/ add name=bridge-lan-01 comment=LAN1 add name=bridge-lan-02 comment=LAN2 /interface/bridge/port add bridge=bridge-lan-01 interface=ether3 add bridge=bridge-lan-01 interface=ether4 add bridge=bridge-lan-01 interface=ether5 /interface/list/member/add interface=ether1 list=WAN comment="Uplink WAN for PPPoE-01" /interface/list/member/add interface=ether2 list=WAN comment="Uplink WAN for PPPoE-02" /interface/list/member/add interface=pppoe-01 list=WAN comment=PPPoE-01 /interface/list/member/add interface=pppoe-02 list=WAN comment=PPPoE-02 /interface/list/member/add interface=bridge-lan-01 list=LAN /interf...

Load Balance RouterOS Version7

interface bridge add name=bridge1 /interface wireless security-profiles set [ find default=yes ] supplicant-identity=MikroTik /routing table add disabled=no name=to_ether1 add disabled=no name=to_ether2 /interface bridge port add bridge=bridge1 interface=ether3 add bridge=bridge1 interface=ether4 add bridge=bridge1 interface=ether5 /ip address add address= 192.168.10.1/24 interface=bridge1 network= 192.168.10.0 add address= 192.168.1.254/24 interface=ether1 network= 192.168.1.0 add address= 192.168.0.254/24 interface=ether2 network= 192.168. 0.0 /ip dns set allow-remote-requests=yes cache-size=5000KiB max-udp-packet-size=512 \ servers=8.8.8.8 /ip firewall mangle add action=mark-connection chain=input in-interface=ether1 \ new-connection-mark=ether1_conn add action=mark-connection chain=input in-interface=ether2 \ new-connection-mark=ether2_conn add action =mark-routing chain=output connection-mark=ether1_conn passthrough=\ yes add action=mark-routing chain=...

Failover With Scripting

Basic Info This is an easy to use script for your failover needs. It is currently written for 2 connections and works by pinging any IP address you specify using both of your connections. If a ping failure is detected a certain number of times, the script increases distance of all default routes that use the gateway present on the interface that failed the ping. What to configure To get this script working you need to fill in these values: Exact names of both interfaces you use to connect to the internet. IPs of both gateways that you use. An IP address that you want to check connectivity against. The ammount of ping failures after which the script fails-over. The distance that the default routes will get increased by in order to become secondary. The script # ------------------- header ------------------- # Script by Tomas Kirnak, version 1.0.7 # If you use this script, or edit and # re-use it, please keep the header intact. # # For more information and details about # this s...

Automatic Expired Hotspot Page Without A Proxy

Create an automatic expired hotspot page without a proxy First download "expired.html" here if you have entered "expired.html" into the hotspot folder section, then please edit the "login.html" page search for tag and place the script below above it Notes: this script is not made by me, I just modified it, whoever owns it, because I have been using it for a long time.

Failover with Netwatch MikroTik Script

The purpose of this script is to provide an immediate solution to service outages provided by ISPs. It is designed for a topology where there are 2 connections with different ISPs, one of them provides us with fixed IP while the other with Dynamic IP. It is important to clarify that not just any DNS can be used for any ISP. Each ISP has its own DNS service, that is why if we drop a connection, it is likely that ISP2 will not be recognized by ISP1's DNS and will not allow us to resolve DNS requests. The solution to this would be to use public DNS servers. OpenDNS /tool netwatch add comment=Test1 disabled=no down-script="/tool netwatch set [find comment=\"Test2\"] disabl\ ed=no\r\ /tool netwatch set [find comment=\"Test1\"] disabled=yes" host=74.125.47.104 interval=\ 30s timeout=2s up-script="" add comment=Test2 disabled=yes down-script=":global GA\r\ :global GA [/ip dhcp-client get \"ether2 Fibertel\" gateway ]\r\ /ip route set ...

How To Enable FastTrack MikroTik Script

To mark a connection as fast-tracked new action was implemented "fasttrack-connection" for firewall filter and mangle. Currently, only IPv4 TCP and UDP connections can be fast-tracked and to maintain connection tracking entries some random packets will still be sent to a slow path. This must be taken into consideration when designing firewalls with enabled "fasttrack". FastTrack handler also supports source and destination NAT, so special exceptions for NATed connections are not required. Traffic that belongs to a fast-tracked connection travels in FastPath, which means that it will not be visible by other router L3 facilities (firewall, queues, IPsec, IP accounting, VRF assignment, etc). The easiest way to start using this feature on home routers is to enable "fasttrack" for all established, related connections: /ip firewall filter add chain=forward action=fasttrack-connection connection-state=established,related \ comment="fasttrack established...

How to Configure MikroTik RouterOS v7 First Time

How to configure MikroTik - Initial Configuration In this article you will learn how to quickly set up RouterOS MikroTik for working in a simple version, which is suitable for many small offices, home network, etc. So, for example we have access channel to the Internet, a local area network for 5 computers, 1 of which is server, you must enable the ordinary users via standard protocols (http, https, icq, jabber, ftp), for system administrators workplace do full access to the network, enable the e-mail, ftp and web servers. LAN IP addresses: Mikrotik - 192.168.0.1 PC 5 - 192.168.0.2 PC 4 - 192.168.0.10 PC 1 - 192.168.0.20 PC 2 - 192.168.0.21 PC 3 - 192.168.0.22 Provider can provide you with both white and gray ip address, for example, that in our case it is the gray address somewhere in a local network provider. Step 1. Let’s connect to the router locally to the console, and to protect the “admin” user from breaking off, we will disable him, and instead create a new one. [admin@Mikr...