I have two WAN connections.
- PPPoE (2mbps)
- Static IP (1mbps) (Unlimited Bandwidth for Youtube)
I want to route youtube via the second WAN (static IP), but i can’t.
Please somebody help me out.
I have tried this…
http://adminsline.wordpress.com/2012/08/03/mikrotik-youtube/
Post /export compact so everyone can see what you have done.
ip firewall mangle
add action=mark-routing chain=prerouting comment="Youtube via WS" dst-address-list=\
youtube_ips dst-port=80 new-routing-mark=youtube_route protocol=tcp
system script
add name=youtube-script policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api source
: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;
}
}
}
}
system scheduler
add interval=20s name=Youtube on-event="/system script run youtube-script" policy=\
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api start-time=startup
ip route
add distance=1 gateway=192.168.0.1 routing-mark=youtube_route scope=255
The script is working well since I am getting the youtube ips. I currently have around 140 ips.
I think The mark-routing is also working since I am getting bytes are running.
But the problem is I ain’t getting traffic through the specified WAN.
Can anyone suggest something.

