Advertisement
Amakesh

Untitled

Dec 17th, 2023
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.22 KB | None | 0 0
  1. # 2023-12-17 16:00:50 by RouterOS 7.13
  2. # software id = 6TID-ZMFN
  3. #
  4. # model = CRS109-8G-1S-2HnD
  5. # serial number = D25008D19038
  6. /interface bridge
  7. add admin-mac=CC:2D:E0:99:EF:0A auto-mac=no comment=defconf name=bridge \
  8. port-cost-mode=short
  9. /interface list
  10. add comment=defconf name=WAN
  11. add comment=defconf name=LAN
  12. /interface wireless security-profiles
  13. set [ find default=yes ] supplicant-identity=MikroTik
  14. /ip pool
  15. add name=default-dhcp ranges=192.168.88.10-192.168.88.254
  16. /ip dhcp-server
  17. add address-pool=default-dhcp interface=bridge lease-time=10m name=defconf
  18. /port
  19. set 0 name=serial0
  20. /interface bridge port
  21. add bridge=bridge comment=defconf interface=ether2 internal-path-cost=10 \
  22. path-cost=10
  23. add bridge=bridge comment=defconf interface=ether3 internal-path-cost=10 \
  24. path-cost=10
  25. add bridge=bridge comment=defconf interface=ether4 internal-path-cost=10 \
  26. path-cost=10
  27. add bridge=bridge comment=defconf interface=ether5 internal-path-cost=10 \
  28. path-cost=10
  29. add bridge=bridge comment=defconf interface=ether7 internal-path-cost=10 \
  30. path-cost=10
  31. add bridge=bridge comment=defconf interface=ether8 internal-path-cost=10 \
  32. path-cost=10
  33. add bridge=bridge comment=defconf interface=sfp1 internal-path-cost=10 \
  34. path-cost=10
  35. add bridge=bridge comment=defconf interface=wlan1 internal-path-cost=10 \
  36. path-cost=10
  37. /ip neighbor discovery-settings
  38. set discover-interface-list=LAN
  39. /interface list member
  40. add comment=defconf interface=bridge list=LAN
  41. add comment=defconf interface=ether1 list=WAN
  42. /ip address
  43. add address=192.168.88.1/24 comment=defconf interface=bridge network=\
  44. 192.168.88.0
  45. /ip dhcp-client
  46. add comment=defconf interface=ether1
  47. /ip dhcp-server lease
  48. add address=192.168.88.253 client-id=1:ec:71:db:e8:9b:9 mac-address=\
  49. EC:71:DB:E8:9B:09 server=defconf
  50. /ip dhcp-server network
  51. add address=192.168.88.0/24 comment=defconf dns-server=192.168.88.1 gateway=\
  52. 192.168.88.1
  53. /ip dns
  54. set allow-remote-requests=yes servers=94.140.14.14,94.140.15.15
  55. /ip dns static
  56. add address=192.168.88.1 comment=defconf name=router.lan
  57. /ip firewall address-list
  58. add address=tadmir.ddns.net list=DDNS
  59. /ip firewall filter
  60. add action=accept chain=input comment=\
  61. "defconf: accept established,related,untracked" connection-state=\
  62. established,related,untracked
  63. add action=drop chain=input comment="defconf: drop invalid" connection-state=\
  64. invalid
  65. add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
  66. add action=accept chain=input comment=\
  67. "defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
  68. add action=drop chain=input comment="defconf: drop all not coming from LAN" \
  69. in-interface-list=!LAN
  70. add action=accept chain=forward comment="defconf: accept in ipsec policy" \
  71. ipsec-policy=in,ipsec
  72. add action=accept chain=forward comment="defconf: accept out ipsec policy" \
  73. ipsec-policy=out,ipsec
  74. add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
  75. connection-state=established,related hw-offload=yes
  76. add action=accept chain=forward comment=\
  77. "defconf: accept established,related, untracked" connection-state=\
  78. established,related,untracked
  79. add action=drop chain=forward comment="defconf: drop invalid" connection-state=\
  80. invalid
  81. add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" \
  82. connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
  83. /ip firewall nat
  84. add action=dst-nat chain=dstnat dst-address-list=DDNS dst-port=8000 log=yes \
  85. protocol=tcp to-addresses=192.168.88.253 to-ports=8000
  86. add action=dst-nat chain=dstnat dst-address-list=DDNS dst-port=4000 log=yes \
  87. protocol=tcp to-addresses=192.168.88.253 to-ports=4000
  88. add action=dst-nat chain=dstnat dst-address-list=DDNS dst-port=4000 log=yes \
  89. protocol=udp to-addresses=192.168.88.253 to-ports=4000
  90. add action=dst-nat chain=dstnat dst-address-list=DDNS dst-port=8000 log=yes \
  91. protocol=udp to-addresses=192.168.88.253 to-ports=8000
  92. add action=dst-nat chain=dstnat dst-address-list=DDNS dst-port=1935 protocol=\
  93. tcp to-addresses=192.168.88.253 to-ports=1935
  94. add action=dst-nat chain=dstnat dst-address-list=DDNS dst-port=1935 protocol=\
  95. udp to-addresses=192.168.88.253 to-ports=1935
  96. add action=dst-nat chain=dstnat dst-address-list=DDNS dst-port=9000 protocol=\
  97. tcp to-addresses=192.168.88.253 to-ports=9000
  98. add action=dst-nat chain=dstnat dst-address-list=DDNS dst-port=9000 \
  99. in-interface=ether1 protocol=udp to-addresses=192.168.88.253 to-ports=9000
  100. add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=\
  101. out,none out-interface-list=WAN
  102. /ip upnp
  103. set enabled=yes show-dummy-rule=no
  104. /ip upnp interfaces
  105. add interface=ether1 type=external
  106. add interface=bridge type=internal
  107. /ipv6 firewall address-list
  108. add address=::/128 comment="defconf: unspecified address" list=bad_ipv6
  109. add address=::1/128 comment="defconf: lo" list=bad_ipv6
  110. add address=fec0::/10 comment="defconf: site-local" list=bad_ipv6
  111. add address=::ffff:0.0.0.0/96 comment="defconf: ipv4-mapped" list=bad_ipv6
  112. add address=::/96 comment="defconf: ipv4 compat" list=bad_ipv6
  113. add address=100::/64 comment="defconf: discard only " list=bad_ipv6
  114. add address=2001:db8::/32 comment="defconf: documentation" list=bad_ipv6
  115. add address=2001:10::/28 comment="defconf: ORCHID" list=bad_ipv6
  116. add address=3ffe::/16 comment="defconf: 6bone" list=bad_ipv6
  117. /ipv6 firewall filter
  118. add action=accept chain=input comment=\
  119. "defconf: accept established,related,untracked" connection-state=\
  120. established,related,untracked
  121. add action=drop chain=input comment="defconf: drop invalid" connection-state=\
  122. invalid
  123. add action=accept chain=input comment="defconf: accept ICMPv6" protocol=icmpv6
  124. add action=accept chain=input comment="defconf: accept UDP traceroute" port=\
  125. 33434-33534 protocol=udp
  126. add action=accept chain=input comment=\
  127. "defconf: accept DHCPv6-Client prefix delegation." dst-port=546 protocol=\
  128. udp src-address=fe80::/10
  129. add action=accept chain=input comment="defconf: accept IKE" dst-port=500,4500 \
  130. protocol=udp
  131. add action=accept chain=input comment="defconf: accept ipsec AH" protocol=\
  132. ipsec-ah
  133. add action=accept chain=input comment="defconf: accept ipsec ESP" protocol=\
  134. ipsec-esp
  135. add action=accept chain=input comment=\
  136. "defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
  137. add action=drop chain=input comment=\
  138. "defconf: drop everything else not coming from LAN" in-interface-list=!LAN
  139. add action=accept chain=forward comment=\
  140. "defconf: accept established,related,untracked" connection-state=\
  141. established,related,untracked
  142. add action=drop chain=forward comment="defconf: drop invalid" connection-state=\
  143. invalid
  144. add action=drop chain=forward comment="defconf: drop packets with bad src ipv6" \
  145. src-address-list=bad_ipv6
  146. add action=drop chain=forward comment="defconf: drop packets with bad dst ipv6" \
  147. dst-address-list=bad_ipv6
  148. add action=drop chain=forward comment="defconf: rfc4890 drop hop-limit=1" \
  149. hop-limit=equal:1 protocol=icmpv6
  150. add action=accept chain=forward comment="defconf: accept ICMPv6" protocol=\
  151. icmpv6
  152. add action=accept chain=forward comment="defconf: accept HIP" protocol=139
  153. add action=accept chain=forward comment="defconf: accept IKE" dst-port=500,4500 \
  154. protocol=udp
  155. add action=accept chain=forward comment="defconf: accept ipsec AH" protocol=\
  156. ipsec-ah
  157. add action=accept chain=forward comment="defconf: accept ipsec ESP" protocol=\
  158. ipsec-esp
  159. add action=accept chain=forward comment=\
  160. "defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
  161. add action=drop chain=forward comment=\
  162. "defconf: drop everything else not coming from LAN" in-interface-list=!LAN
  163. /lcd interface pages
  164. set 0 interfaces=ether1,ether2,ether3,ether4,ether5,ether6,ether7,ether8,sfp1
  165. /system clock
  166. set time-zone-name=Europe/Berlin
  167. /system note
  168. set show-at-login=no
  169. /system scheduler
  170. add interval=5m name=DDNSUpdate on-event="/system script run ddnsUpdate" \
  171. policy=read,write,test start-time=startup
  172. /system script
  173. add dont-require-permissions=no name=ddnsUpdate owner=admin policy=\
  174. read,write,test source=":local ddnsuser \"monika.dal3@yahoo.de\"\r\
  175. \n:local ddnspass \"@kx267336\"\r\
  176. \n:local ddnshost \"tadmir.ddns.net\"\r\
  177. \n:local ddnsinterface \"ether1\"\r\
  178. \n\r\
  179. \n:global ddnslastip\r\
  180. \n:global ddnsip [ /ip address get [find interface=\$ddnsinterface disabled=\
  181. no] address ]\r\
  182. \n\r\
  183. \n:if ([ :typeof \$ddnslastip ] = nil ) do={:global ddnslastip 0.0.0.0/0 }\r\
  184. \n:if ([ :typeof \$ddnsip ] = nil ) do={\r\
  185. \n:log info (\"DDNS: No ip address present on \" . \$ddnsinterface . \", ple\
  186. ase check.\") } else={\r\
  187. \n\r\
  188. \n:if (\$ddnsip != \$ddnslastip) do={\r\
  189. \n:log info \"DDNS: Sending UPDATE!\"\r\
  190. \n/tool fetch url=\"http://dynupdate.no-ip.com/nic/update\?hostname=\$ddnsho\
  191. st&myip=\$ddnsip\" user=\$ddnsuser password=\$ddnspass keep-result=no;\r\
  192. \n:delay 5s\r\
  193. \n:global ddnslastip \$ddnsip } else={\r\
  194. \n:log info \"DDNS: No change\" }\r\
  195. \n}"
  196. /tool mac-server
  197. set allowed-interface-list=LAN
  198. /tool mac-server mac-winbox
  199. set allowed-interface-list=LAN
  200.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement