S
S
sirota2015-10-25 11:01:23
Mikrotik
sirota, 2015-10-25 11:01:23

Traffic routing using Microtik. How?

I use 3g/4g internet. On one limit, but the speed is 30 (ISP 1), on the second it is unlimited, but the speed is 5-10 mb / s (ISP 2). We need to wrap, say, p2p on ISP 2, but only from 7 am to 1 am, then we need to wrap traffic on ISP 1.
Then we say youtube wrap on ISP 2. But again, only during the day, at night everything is on ISP 1. During the day, ISP 1 will live anything that is not explicitly stated in the rules.

 /ip firewall nat> print
Flags: X - disabled, I - invalid, D - dynamic 
 0 X  chain=srcnat action=masquerade src-address=192.168.0.0/24 log=no 
      log-prefix="" 

 1    ;;; ISP 1
      chain=srcnat action=masquerade out-interface=ppp-out1 log=no 
      log-prefix="" 

 2    ;;; ISP 2
      chain=srcnat action=masquerade out-interface=ppp-out2 log=no 
      log-prefix=""

 /ip firewall mangle> print 
Flags: X - disabled, I - invalid, D - dynamic 
 0    chain=prerouting action=mark-routing new-routing-mark=LocalNet 
      passthrough=no src-address=192.168.0.0/24 dst-address-list=LocalNet 
      log=no log-prefix="" 

 1    chain=prerouting action=mark-routing new-routing-mark=ISP 2 passthrough=no 
      src-address=192.168.0.0/24 content=youtube.com log=no log-prefix="" 

 2    chain=input action=mark-connection new-connection-mark=ISP 1 -> Input 
      passthrough=no in-interface=ppp-out1 log=no log-prefix="" 

 3    chain=output action=mark-routing new-routing-mark=ISP 1 passthrough=no 
      connection-mark=ISP 1 -> Input log=no log-prefix="" 

 4    chain=input action=mark-connection new-connection-mark=ISP 2 -> Input 
      passthrough=no in-interface=ppp-out2 log=no log-prefix="" 

 5    chain=output action=mark-routing new-routing-mark=ISP 2 passthrough=no 
      connection-mark=ISP 2 -> Input log=no log-prefix="" 

 6    chain=postrouting action=change-ttl new-ttl=set:64 passthrough=no 
      out-interface=!ppp-out2 log=no log-prefix=""

While fiddling with the same YouTube. At the moment, the Internet is only available on ISP 1. As can be seen from the rule:
1    chain=prerouting action=mark-routing new-routing-mark=ISP 2 passthrough=no 
      src-address=192.168.0.0/24 content=youtube.com log=no log-prefix=""

Packages with YouTube for ISP 2 are marked, then YouTube opens (although I remind you there is no Internet on ISP 2), and if you change it as ISP 1, then YouTube does not open (
Yes, and let's say changing ttl only works with !. After all, this is not correct, as I understand it - Verisya 6.32.2 (at 32.1 it was the same).

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question