/ip firewall address-list
add address=74.125.0.0/16 comment=Google disabled=no list=youtube
add address=114.112.182.156 comment=TuDou disabled=no list=youtube
add address=221.12.89.120 comment=TuDou disabled=no list=youtube
add address=64.15.112.0/20 comment=YouTube disabled=no list=youtube
add address=64.15.120.0/21 comment=YouTube disabled=no list=youtube
add address=208.65.152.0/22 comment=YouTube disabled=no list=youtube
add address=208.117.224.0/19 comment=YouTube disabled=no list=youtube
add address=209.85.128.0/17 comment=Google disabled=no list=youtube
/ip firewall mangle
add action=mark-routing chain=prerouting \
comment="Routing Mark Youtube" disabled=no \
dst-address-list=youtube new-routing-mark=youtube passthrough=no
correction:
because if you mangle routing-mark all protocol and you have email server inside your network the email from gmail will failed to received so better you just mangle routing-mark for protocol tcp dst-port 80, like this:
/ip firewall mangle
add action=mark-routing chain=prerouting comment="Routing Mark Youtube" \
disabled=no dst-address-list=youtube dst-port=80 new-routing-mark=\
youtube passthrough=no protocol=tcp
/ip route
add comment="Routing Youtube" disabled=no dst-address=0.0.0.0/0 \
gateway=1.2.3.4 routing-mark=youtube
/ip firewall nat
add action=masquerade chain=srcnat \
comment="NAT Youtube via ISP Youtube" \
disabled=no out-interface=INTERFACE_TO_ISP_YOUTUBE
Note:
- gateway=1.2.3.4, you must using your ISP gateway for Youtube traffic depend on your choice whic one of your ISP is best for Youtube traffic
- out-interface=INTERFACE_TO_ISP_YOUTUBE, change to your ISP interface at your mikrotik router
To avoid problem if your ISP for Youtube down you can copy-paste this script to mikrotik terminal:
/system script
add name=check_youtube policy=\
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive source="\
:if ( [/ping 1.2.3.4 count=1]=1) do={\r\
\n:log info \"Youtube Up\";\r\
\n:foreach i in=[/ip route find routing-mark=\"youtube\"] do={/ip route se\
t \$i disable=no};\r\
\n/tool e-mail send to=\"your@email.net\" subject=([/system ident\
ity get name] . \" Youtube Up \" . [/system clock get date]) body=\"Youtub\
e Routing Mark Enable\";\r\
\n} else={\r\
\n:log info \"Youtube Down\";\r\
\n:foreach i in=[/ip route find routing-mark=\"youtube\"] do={/ip route se\
t \$i disable=yes};\r\
\n/tool e-mail send to=\"your@email.net\" subject=([/system ident\
ity get name] . \" Youtube Down \" . [/system clock get date]) body=\"Yout\
ube Routing Mark Disable\";\r\
\n}"
and activate this script from Netwatch
/tool netwatch
add comment="Youtube Check" disabled=no down-script=check_youtube host=\
1.2.3.4 interval=1m timeout=25ms up-script=check_youtube
Source:
http://www.robtex.com/as/as36561.html#bgp
1 komentar:
TOP bro, thank you so much
Posting Komentar