hello all
I have two WAN connections. One is providing me unlimited bandwidth for youtube. so I want to redirect all traffic to youtube via the that connection.
Both wan connections are PPPoE Client.
is it possible?
:foreach i in=[/ip dns cache find] do={
:local bNew "true";
:local cacheName [/ip dns cache all get $i name] ;
# :put $cacheName;
:if ([:find $cacheName "youtube"] != 0) do={
:local tmpAddress [/ip dns cache get $i address] ;
# :put $tmpAddress;
# if address list is empty do not check
:if ( [/ip firewall address-list find ] = "") do={
:log info ("added entry: $[/ip dns cache get $i name] IP $tmpAddress");
/ip firewall address-list add address=$tmpAddress list=youtube_ips comment=$cacheName;
} else={
:foreach j in=[/ip firewall address-list find ] do={
:if ( [/ip firewall address-list get $j address] = $tmpAddress ) do={
:set bNew "false";
}
}
:if ( $bNew = "true" ) do={
:log info ("added entry: $[/ip dns cache get $i name] IP $tmpAddress");
/ip firewall address-list add address=$tmpAddress list=youtube_ips comment=$cacheName;
}
}
}
}
[admin@greenTIK]/ip firewall mangle add chain=prerouting protocol=tcp dst-port=80
dst-address-list=youtube_ips action=mark-routing
new-routing-mark=YOUTUBE_RT passthrough=yes
[admin@greenTIK]/ip route add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=x.y.z.w routing-mark= YOUTUBE_RT scope=255 target-scope=10
[admin@greenTIK]/ip route add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=x.y.z.w routing-mark= YOUTUBE_RT scope=255 target-scope=10