本帖最後由 167pk 於 2017-2-13 12:53 編輯
*** 注意:沒中/高階網絡+電腦知識者勿試 ***
它會自動把 host 名 resolve 做 ip address 之後您懂的
** MC16888 師兄提供 static ip 解決LE睇肉直播的問題 **
** 需要配合: 1部Mikrotik Router + 1個(月/年)租能提供中國IP的VPN服務 **
WINBOX -> SYSTEM -> SCRIPTS -> "+"
因用了 do={} on-error={} 所以此 script 只支援 ROS v6.2 及以上的版本
- #Unblock Script Version 2.12
- :log info "RESOLVE HOST: Start...";
- :global ListName "host_unblock";
- :global Servers ("cwns.qq.com","3g.music.qq.com","a.play.api.3g.youku.com","ac.qq.com","acc.music.qq.com","aid.video.qq.com","antiserver.kuwo.cn","api.3g.tudou.com","api.3g.youku.com","api.appsdk.soku.com","api.hubo.ott.sohu.com","api.itv.letv.com","api.launch.hd.sohu.com","api.le.com","api.lesports.com","api.letv.com","api.live.letv.com","api.mob.app.letv.com","api.mobile.youku.com","api.ott.tv.cp45.ott.cibntv.net","api.passport.pptv.com","api.sports.letv.com","api.tv.sohu.com","api.unipay.qq.com","api.www.letv.com","api.youku.com","apistat.wasu.cn","api.bilibili.com","ark.letv.com","bangumi.bilibili.com","bkvv.play.aiseet.atianqi.com","bkvv.play.cp81.ott.cibntv.net","bkvv.play.ott.video.qq.com","bkvv.video.qq.com","btrace.play.cp81.ott.cibntv.net","c.y.qq.com","cache.m.iqiyi.com","cache.m.ptqy.gitv.tv","cache.video.iqiyi.com","cache.video.ptqy.gitv.tv","cache.video.qiyi.com","cache.vip.ptqy.gitv.tv","cache.vip.qiyi.com","cctv1.vtime.cntv.cloudcdn.net","chrome.2345.com","cibn.api.3g.cp31.ott.cibntv.net","client.api.ttpod.com","cloud.vip.xunlei.com","comet2.music.qq.com","ctc.qzs.qq.com","data.bilibili.com","data.video.ptqy.gitv.tv","data.video.qiyi.com","dispatcher.video.sina.com.cn","dl.stream.qqmusic.qq.com","douban.fm","dyn.ugc.pps.tv","dynamic.app.m.letv.com","dynamic.cloud.vip.xunlei.com","dynamic.live.app.m.letv.com","dynamic.meizi.app.m.letv.com","dynamic.search.app.m.letv.com","epg.api.cp61.ott.cibntv.net","flvs.video.qq.com","geo.js.kankan.com","graph.qq.com","h5vv.video.qq.com","hot.vrs.cp45.ott.cibntv.net","hot.vrs.letv.com","hot.vrs.sohu.com","hot2.vrs.sohu.com","huatuo.weiyun.com","huatuocode.weiyun.com","i-play.mobile.youku.com","i.play.api.3g.youku.com","i.y.qq.com","iface.iqiyi.com","iface2.iqiyi.com","ifacelog.iqiyi.com","info.zb.qq.com","info.zb.video.qq.com","inner.kandian.com","int.dpool.sina.com.cn","interface.bilibili.cn","interface.bilibili.com","interface.url.hifuntv.com","internal.check.duokanbox.com","ip.apps.cntv.cn","ip.kankan.com","ip.kugou.com","ip.video.51togic.com","ip.ws.126.net","ip2.kugou.com","iplocation.geo.qiyi.com","ipservice.163.com","kandian.com","list.youku.com","listso.m.areainfo.ppstream.com","live.api.hunantv.com","live.g3proxy.lecloud.com","live.gslb.letv.com","live.pptv.com","live.tv.sohu.com","livep.l.aiseet.atianqi.com","livep.l.cp81.ott.cibntv.net","livep.l.ott.video.qq.com","lives.l.aiseet.atianqi.com","lives.l.cp81.ott.cibntv.net","lives.l.ott.video.qq.com","lixian.vip.xunlei.com","lixian.xunlei.com","m.api.hunantv.com","m.letv.com","m10.music.126.net","masdk.3g.qq.com","mobi.kuwo.cn","mobile.api.hunantv.com","mobilefeedback.kugou.com","module.youku.com","music.163.com","music.baidu.com","music.sina.com.cn","nmobi.kuwo.cn","openapi.youku.com","pad.api.hunantv.com","pad.tv.sohu.com","pay.tudou.com","pay.video.qq.com","paybak.video.qq.com","pcweb.api.mgtv.com","pl.youku.com","pl2.cp31.ott.cibntv.net","pl2.youku.com","play-ali.youku.com","play-dxk.youku.com","play.api.3g.tudou.com","play.api.3g.youku.com","play.api.cp61.ott.cibntv.net","play.api.pptv.com","play.baidu.com","play.youku.com","player-pc.le.com","player.pc.le.com","policy.video.ptqy.gitv.tv","proxy.music.qq.com","proxymc.qq.com","qc.hd.cp45.ott.cibntv.net","qzs.qq.com","s.music.qq.com","s.plcloud.music.qq.com","sasdk.3g.qq.com","sdk.m.youku.com","sdkconfig.video.qq.com","search.api.3g.tudou.com","search.api.3g.youku.com","search.lekan.letv.com","serviceinfo.sdk.duomi.com","sns.video.qq.com","so.open.163.com","spark.api.xiami.com","sports1pull.live.wscdns.com","st.live.letv.com","stat.3g.music.qq.com","stat.y.qq.com","static.api.sports.letv.com","static.itv.letv.com","tingapi.ting.baidu.com","tms.is.ysten.com","tv.aiseet.atianqi.com","tv.api.3g.tudou.com","tv.api.3g.youku.com","tv.weibo.com","v.api.hunantv.com","v.api.mgtv.com","v.pps.tv","v.pptv.com","v.youku.com","v2.tudou.com","v5.pc.duomi.com","vdn.apps.cntv.cn","vdn.live.cntv.cn","video.sina.com.cn","vip.sports.cntv.cn","vv.play.aiseet.atianqi.com","vv.play.cp81.ott.cibntv.net","vv.play.ott.video.qq.com","vv.video.qq.com","vxml.56.com","way.cp61.ott.cibntv.net","way.pptv.com","web-play.pplive.cn","web-play.pptv.com","xl.api.3g.youku.com","z.g3proxy.lecloud.com","zb.s.qq.com");
- :foreach aServer in=$Servers do={
- :do {
- :resolve $aServer;
- } on-error={ :log error ("RESOLVE HOST: IP not found - $aServer") };
- :foreach dnsRecord in=[/ip dns cache all find where (name=$aServer)] do={
- :if ([/ip dns cache all get $dnsRecord type]="A") do={
- :do {
- /ip firewall address-list add list=$ListName address=[/ip dns cache all get $dnsRecord data] comment=$aServer;
- } on-error={ :log warning ("RESOLVE HOST: IP already exists - $aServer") };
- }
- :if ([/ip dns cache all get $dnsRecord type]="CNAME") do={
- :local cname;
- :local nextCname;
- :set cname [/ip dns cache all find where (name=$aServer && type="CNAME")];
- :set nextCname [/ip dns cache all find where (name=[/ip dns cache all get $cname data] && type="CNAME")];
- :while ($nextCname != "") do={
- :set cname $nextCname;
- :set nextCname [/ip dns cache all find where (name=[/ip dns cache all get $cname data] && type="CNAME")];
- }
- :foreach aRecord in=[/ip dns cache all find where (name=[/ip dns cache all get $cname data] && type="A")] do={
- :do {
- /ip firewall address-list add list=$ListName address=[/ip dns cache all get $aRecord data] comment=$aServer;
- } on-error={ :log warning ("RESOLVE HOST: IP already exists - $aServer") };
- }
- }
- }
- }
- :set ListName;
- :set Servers;
- :log info "RESOLVE HOST: Finished";
複製代碼
WINBOX -> IP -> FIREWALL -> ADDRESS LISTS -> "+"
- /ip firewall address-list
- add address=101.227.139.217 comment="101.227.139.217" list=host_unblock
- add address=103.7.30.89 comment="103.7.30.89" list=host_unblock
- add address=103.7.31.186 comment="103.7.31.186" list=host_unblock
- add address=111.13.127.46 .................etc
複製代碼 WINBOX -> IP -> DNS -> STATIC -> "+"
- /ip dns static
- add address=36.110.223.251 name=api.live.letv.com
- add address=124.126.250.245 name=ssports.smgbb.cn
- add address=124.126.250.245 name=ssports.vod.smgbb.cn.cloudcdn.net
- add address=124.126.250.245 name=zhibo.ssports.com
複製代碼 WINBOX -> SYSTEM -> SCHEDULER -> "+"
- /system scheduler
- add comment="Update HostName" interval=1d name=resolve_hostnames on-event=resolve_hostnames_update policy=read,write,policy,test start-time=startup
複製代碼 WINBOX -> IP -> FIREWALL -> MANGLE -> "+"
- /ip firewall mangle
- add action=mark-routing chain=prerouting comment="Through CN VPN" dst-address-list=host_unblock dst-port=80,443,8080 new-routing-mark=through_vpn_cn p2p=!all-p2p passthrough=no protocol=tcp src-address-list=Internal-Nets
複製代碼 WINBOX -> PPP -> "+PPTP Client"
** 紅框填回VPN服務商提供的資料 **
- /interface pptp-client
- add comment="CHINA VPN" connect-to=1.1.1.1 disabled=no max-mru=1400 max-mtu=1400 name=pptp-cn2 password=********* user=vpn
複製代碼 WINBOX -> IP -> FIREWALL -> NAT -> "+"
- /ip firewall nat
- add action=masquerade chain=srcnat comment="VPN CN2" out-interface=pptp-cn2 src-address-list=Internal-Nets
複製代碼 WINBOX -> IP -> ROUTES -> "+"
- /ip route
- add check-gateway=ping distance=1 gateway=pptp-cn2 routing-mark=through_vpn_cn scope=30
複製代碼 如執行成功,於ADDRESS LISTS內會出現數百個LISTS
|