Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.57 KB | None | 0 0
  1. # apr/24/2017 20:09:05 by RouterOS 6.39rc79
  2. # software id = 1K0I-0HHR
  3. #
  4. /interface bridge
  5. add admin-mac=E4:8D:8C:75:E2:25 auto-mac=no fast-forward=no name=bridge-local
  6. /interface ethernet
  7. set [ find default-name=ether1 ] name=ether1-gateway
  8. set [ find default-name=ether2 ] name=ether2-master-local
  9. set [ find default-name=ether3 ] master-port=ether2-master-local name=\
  10. ether3-slave-local
  11. set [ find default-name=ether4 ] master-port=ether2-master-local name=\
  12. ether4-slave-local
  13. set [ find default-name=ether5 ] master-port=ether2-master-local name=\
  14. ether5-slave-local
  15. /interface wireless
  16. set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-Ce \
  17. distance=indoors frequency=auto mode=ap-bridge ssid=MikroTik-75E229 \
  18. wireless-protocol=802.11
  19. /ip neighbor discovery
  20. set ether1-gateway discover=no
  21. /ip ipsec proposal
  22. set [ find default=yes ] enc-algorithms=aes-128-cbc
  23. /ip pool
  24. add name=default-dhcp ranges=10.0.1.2-10.0.1.21
  25. /ip dhcp-server
  26. add address-pool=default-dhcp authoritative=after-2sec-delay disabled=no \
  27. interface=bridge-local name=default
  28. /tool user-manager customer
  29. set admin access=\
  30. own-routers,own-users,own-profiles,own-limits,config-payment-gw
  31. /interface bridge port
  32. add bridge=bridge-local interface=ether2-master-local
  33. add bridge=bridge-local interface=wlan1
  34. /interface l2tp-server server
  35. set caller-id-type=ip-address
  36. /ip address
  37. add address=10.0.1.1/24 comment="default configuration" interface=\
  38. ether2-master-local network=10.0.1.0
  39. /ip dhcp-client
  40. add comment="default configuration" dhcp-options=hostname,clientid disabled=\
  41. no interface=ether1-gateway
  42. /ip dhcp-server network
  43. add address=192.168.88.0/24 comment="default configuration" gateway=\
  44. 192.168.88.1
  45. /ip dns
  46. set allow-remote-requests=yes servers=10.0.1.85
  47. /ip dns static
  48. add address=10.0.1.1 name=router
  49. /ip firewall filter
  50. add action=accept chain=input comment="default configuration" protocol=icmp
  51. add action=accept chain=input comment="default configuration" \
  52. connection-state=established,related
  53. add action=drop chain=input comment="default configuration" in-interface=\
  54. ether1-gateway
  55. add action=fasttrack-connection chain=forward comment="default configuration" \
  56. connection-state=established,related
  57. add action=accept chain=forward comment="default configuration" \
  58. connection-state=established,related
  59. add action=drop chain=forward comment="default configuration" \
  60. connection-state=invalid
  61. add action=drop chain=forward comment="default configuration" \
  62. connection-nat-state=!dstnat connection-state=new in-interface=\
  63. ether1-gateway
  64. /ip firewall nat
  65. add action=masquerade chain=srcnat
  66. /system clock
  67. set time-zone-name=America/Kentucky/Louisville
  68. /system lcd
  69. set contrast=0 enabled=no port=parallel type=24x4
  70. /system lcd page
  71. set time disabled=yes display-time=5s
  72. set resources disabled=yes display-time=5s
  73. set uptime disabled=yes display-time=5s
  74. set packets disabled=yes display-time=5s
  75. set bits disabled=yes display-time=5s
  76. set version disabled=yes display-time=5s
  77. set identity disabled=yes display-time=5s
  78. set bridge-local disabled=yes display-time=5s
  79. set wlan1 disabled=yes display-time=5s
  80. set ether1-gateway disabled=yes display-time=5s
  81. set ether2-master-local disabled=yes display-time=5s
  82. set ether3-slave-local disabled=yes display-time=5s
  83. set ether4-slave-local disabled=yes display-time=5s
  84. set ether5-slave-local disabled=yes display-time=5s
  85. /system leds
  86. set 0 interface=wlan1
  87. /system routerboard settings
  88. set init-delay=0s
  89. /system scheduler
  90. add interval=1h name="Update FreeDNS IP Automatically" on-event=\
  91. "/system script run FreeDNS" policy=\
  92. ftp,reboot,read,write,policy,test,password,sniff,sensitive start-time=\
  93. startup
  94. /system script
  95. add name=FreeDNS owner=admin policy=\
  96. ftp,reboot,read,write,policy,test,password,sniff,sensitive source="#######\
  97. ####### Script FreeDNS.afraid.org ##################\r\
  98. \n############## PARSER EDITION ##################\r\
  99. \n############## CREATED LESHIY_ODESSA ##################\r\
  100. \n \r\
  101. \n# Specify the \"Direct URL\", which is https://freedns.afraid.org/dynami\
  102. c/\r\
  103. \n# If RouterOS version 5.xx, then remove from the URL encryption - \"http\
  104. s\" change this to \"http\". Also see below.\r\
  105. \n# In front of the sign \"\?\" put a backslash \"\\\".\r\
  106. \n:global \"direct-url\" \"http://freedns.afraid.org/dynamic/update.php\\\
  107. \?cWpIUk9oZ1UzQWNhRFZkZ1VWMzRsUjd3OjEwMDk3ODc3\"\r\
  108. \n\r\
  109. \n# Specify the URL API \"ASCII\"\r\
  110. \n# Log in under your account and open the page https://freedns.afraid.org\
  111. /api/\r\
  112. \n# Then copy the URL of your site - Available API Interfaces : ASCII (!!!\
  113. \_NOT XML !!!)\r\
  114. \n# ATTENTION!!!! Before the question mark, put a backslash \"\\\".\r\
  115. \n# If RouterOS version 5.xx, then remove from the URL encryption - \"http\
  116. s\" change this to \"http\".\r\
  117. \n:global \"api-url\" \"http://freedns.afraid.org/api/\\\?action=getdyndns\
  118. &sha=0c1180aab1c3ee45f78da2f2358fbf7e6b2577dd\"\r\
  119. \n \r\
  120. \n# Specify your domain or subdomain.\r\
  121. \n:global \"dns-domain\" \"zero3k.privatedns.org\"\r\
  122. \n\r\
  123. \n# Define variables for the external (WAN) interface\r\
  124. \n# Case sensitive.\r\
  125. \n:global \"out-interface\" \"ether1-gateway\"\r\
  126. \n \r\
  127. \n# !!!!!!!!!!!!!!!!! Nothing more do not need to edit!!!!!!!!!!!!!!!!!\r\
  128. \n \r\
  129. \n# Check whether the file with the IP domain - freedns.txt\r\
  130. \n:if ([:len [/file find name=freedns.txt]] > 0) do={\r\
  131. \n} else={\r\
  132. \n/tool fetch url=\$\"api-url\" dst-path=\"/freedns.txt\"\r\
  133. \n}\r\
  134. \n# Find out the IP address of the domain using the API and parsing.\r\
  135. \n# Split the file\r\
  136. \n:local \"result\" [/file get freedns.txt contents]\r\
  137. \n:local \"startloc\" ([:find \$\"result\" \$\"dns-domain\"] + ([:len \$\"\
  138. dns-domain\"] + 1))\r\
  139. \n:local \"endloc\" ([:find \$\"result\" \$\"direct-url\" -1] -1)\r\
  140. \n:global \"dns-domain-ip\" [:pick \$\"result\" \$\"startloc\" \$\"endloc\
  141. \"]\r\
  142. \n \r\
  143. \n# Find the current IP address on the external interface\r\
  144. \n:global \"current-ip\" [/ip address get [find interface=\$\"out-interfac\
  145. e\"] address]\r\
  146. \n \r\
  147. \n# Obtained from IP addresses to be excluded subnet mask\r\
  148. \n:set \"current-ip\" [:pick \$\"current-ip\" 0 ([:len \$\"current-ip\"]-3\
  149. ) ]\r\
  150. \n \r\
  151. \n# Compare the external IP with the IP address of the DNS domain.\r\
  152. \n:if (\$\"current-ip\" != \$\"dns-domain-ip\") do={\r\
  153. \n\r\
  154. \n# If different, then sent to freedns.afraid.org our external IP by using\
  155. \_Direct URL\r\
  156. \n:log info (\"Service Dynamic DNS: old IP address \$\"dns-domain-ip\" for\
  157. \_\$\"dns-domain\" CHANGED to -> \$\"current-ip\"\")\r\
  158. \n/tool fetch url=\$\"direct-url\" keep-result=no\r\
  159. \n# Download the file with the new IP after 5 sec.\r\
  160. \n:delay 5\r\
  161. \n/tool fetch url=\$\"api-url\" dst-path=\"/freedns.txt\"\r\
  162. \n} else={\r\
  163. \n# Not to clog the log, you need to comment out this line.\r\
  164. \n:log info (\"IP address is NOT CHANGED, the update is not required\")\r\
  165. \n}\r\
  166. \n \r\
  167. \n# Since version RouterOS version 6.0rc12 supported encryption /tool fetc\
  168. h mode=https\r\
  169. \n# In :global \"direct-url\" need to change to httpS://\r\
  170. \n# For RouterOS version 6.xx\r\
  171. \n# /tool fetch mode=https url=\$\"direct url\"\r\
  172. \n# :global \"direct-url\" \"https://freedns.afraid.org/dynamic/update.php\
  173. \\\?UVdjU2lzQmQwSkdjZW9aWkNleTdJdXFtOjg2NTI0NzE=\"\r\
  174. \n\r\
  175. \n# http://wiki.mikrotik.com/wiki/Manual:Scripting\r\
  176. \n# http://wiki.mikrotik.com/wiki/Manual:Scripting-examples\r\
  177. \n# http://wiki.mikrotik.com/wiki/Manual:Tools/Fetch\r\
  178. \n# http://forum.ixbt.com/topic.cgi\?id=14:60498-86#2373\r\
  179. \n\r\
  180. \n##############Script FreeDNS.afraid.org##################\r\
  181. \n\r\
  182. \n\r\
  183. \n"
  184. /tool mac-server
  185. set [ find default=yes ] disabled=yes
  186. add interface=ether2-master-local
  187. add interface=ether3-slave-local
  188. add interface=ether4-slave-local
  189. add interface=ether5-slave-local
  190. add interface=wlan1
  191. add interface=bridge-local
  192. /tool mac-server mac-winbox
  193. set [ find default=yes ] disabled=yes
  194. add interface=ether2-master-local
  195. add interface=ether3-slave-local
  196. add interface=ether4-slave-local
  197. add interface=ether5-slave-local
  198. add interface=wlan1
  199. add interface=bridge-local
  200. /tool romon port
  201. add
  202. /tool user-manager database
  203. set db-path=user-manager
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement