Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.99 KB | None | 0 0
  1. # feb/07/2016 09:51:08 by RouterOS 6.34.1
  2. # software id = AAAA-AA11
  3. #
  4. /interface ethernet
  5. set [ find default-name=ether1 ] name=ether1-isp1
  6. set [ find default-name=ether2 ] name=ether2-isp2
  7. set [ find default-name=ether3 ] name=ether3-LAN
  8. set [ find default-name=ether4 ] master-port=ether3-LAN name=ether4-LAN
  9. set [ find default-name=ether5 ] master-port=ether3-LAN name=ether5-LAN
  10. /ip neighbor discovery
  11. set ether1-isp1 discover=no
  12. /ip ipsec proposal
  13. set [ find default=yes ] enc-algorithms=aes-128-cbc
  14. /ip pool
  15. add name=dhcp ranges=192.168.7.10-192.168.7.254
  16. /ip dhcp-server
  17. add address-pool=dhcp disabled=no interface=ether3-LAN lease-time=15m name=\
  18. default
  19. /ppp profile
  20. add change-tcp-mss=no name=PPPoE use-compression=no use-encryption=no \
  21. use-mpls=no use-upnp=no
  22. /interface pppoe-client
  23. add add-default-route=yes default-route-distance=8 disabled=no interface=\
  24. ether1-isp1 max-mru=1500 max-mtu=1500 mrru=1600 name=isp1-PPPoE \
  25. password=N/A profile=PPPoE service-name=isp1 user=Username
  26. /system logging action
  27. set 1 disk-file-name=log
  28. /ip settings
  29. set send-redirects=no
  30. /ip address
  31. add address=192.168.7.1/24 comment="LAN IP" interface=ether3-LAN network=\
  32. 192.168.7.0
  33. /ip dhcp-client
  34. add comment="isp2 DHCP" default-route-distance=7 dhcp-options=\
  35. hostname,clientid disabled=no interface=ether2-isp2 use-peer-dns=\
  36. no
  37. /ip dhcp-server network
  38. add address=192.168.7.0/24 comment="default configuration" dns-server=\
  39. 192.168.7.1 gateway=192.168.7.1 netmask=24
  40. /ip dns
  41. set allow-remote-requests=yes servers=4.2.2.2,208.67.222.222
  42. /ip dns static
  43. add address=192.168.7.1 name=router
  44. /ip firewall address-list
  45. add address=192.168.7.250 list="isp1 IPs"
  46. /ip firewall filter
  47. add chain=input comment="Allow LAN" in-interface=ether3-LAN
  48. add chain=input comment="Allow router management" dst-port=\
  49. 8291,65109,8728,8729 protocol=tcp
  50. add chain=input comment="Allow ICMP" protocol=icmp
  51. add chain=input comment="Stateful Firewall" connection-state=\
  52. established,related
  53. add action=drop chain=input comment="Default Drop isp1" in-interface=\
  54. isp1-PPPoE
  55. add action=drop chain=input comment="Default Drop isp2" in-interface=\
  56. ether2-isp2
  57. /ip firewall mangle
  58. add action=mark-connection chain=prerouting comment=\
  59. "Mark route for new connection on isp1 link" connection-state=new \
  60. in-interface=isp1-PPPoE new-connection-mark=isp1
  61. add action=mark-routing chain=output comment=\
  62. "Mark route for local isp1 source out isp1 link" \
  63. connection-mark=isp1 new-routing-mark=isp1
  64. add action=mark-routing chain=prerouting comment="Mark isp1 NATted IP's" \
  65. new-routing-mark=isp1 passthrough=no src-address-list=\
  66. "isp1 IPs"
  67. /ip firewall nat
  68. add action=masquerade chain=srcnat comment="SNAT for isp1" \
  69. out-interface=isp1-PPPoE src-address=192.168.7.0/24
  70. add action=masquerade chain=srcnat comment="SNAT for isp2" \
  71. out-interface=ether2-isp2 src-address=192.168.7.0/24
  72. /ip route
  73. add check-gateway=ping comment=\
  74. "isp1 Table - isp1 Gateway (default)" distance=4 gateway=\
  75. 8.8.4.4 routing-mark=isp1
  76. add check-gateway=ping comment=\
  77. "isp1 Table - isp2 Gateway (backup)" distance=6 gateway=\
  78. 8.8.8.8 routing-mark=isp1
  79. add comment="Table for isp1 Static Gateway" distance=1 gateway=\
  80. 104.237.99.35 routing-mark=isp1-gw
  81. add comment="Table for isp2 Static Gateway" distance=1 gateway=\
  82. 71.1.96.1 routing-mark=isp2-gw
  83. add check-gateway=ping comment="Main Table - isp2 Gateway (default)" \
  84. distance=4 gateway=8.8.8.8
  85. add check-gateway=ping comment="Main Table - isp1 Gateway (backup)" \
  86. distance=6 gateway=8.8.4.4
  87. add comment="isp1 Gateway Check" distance=1 dst-address=8.8.4.4/32 \
  88. gateway=104.237.99.35 scope=10
  89. add comment="isp2 Gateway Check" distance=1 dst-address=8.8.8.8/32 \
  90. gateway=71.1.96.1 scope=10
  91. /ip route rule
  92. add dst-address=8.8.8.8/32 table=isp2-gw
  93. add dst-address=8.8.4.4/32 table=isp1-gw
  94. /ip service
  95. set telnet disabled=yes
  96. set ftp disabled=yes
  97. set www address=192.168.7.0/24 port=8080
  98. set ssh port=65109
  99. /system clock
  100. set time-zone-name=America/Chicago
  101. /system ntp client
  102. set enabled=yes primary-ntp=107.170.242.27 secondary-ntp=129.250.35.250
  103. /system routerboard settings
  104. set cpu-frequency=720MHz protected-routerboot=disabled
  105. /system scheduler
  106. add interval=10s name=GWCheck-isp2 on-event=\
  107. "/system script run GWCheck-isp2" policy=\
  108. ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=\
  109. jan/01/1970 start-time=00:00:03
  110. add interval=10s name=GWCheck-isp1 on-event=\
  111. "/system script run GWCheck-isp1" policy=\
  112. ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=\
  113. jan/01/1970 start-time=00:00:03
  114. /system script
  115. add name=GWCheck-isp2 owner=admin policy=\
  116. ftp,reboot,read,write,policy,test,password,sniff,sensitive source="# Scrip\
  117. t to modify recursive route checks for failover with DHCP clients\r\
  118. \n\r\
  119. \n# Define Variables\r\
  120. \n:global \"DHCP_ISP_Name\" \"isp2\"\r\
  121. \n:global \"DHCP_ISP_IF_Name\" \"ether2-isp2\"\r\
  122. \n:global \"DHCP_ISP_Route_Check_Comment\" \"isp2 Gateway Check\"\r\
  123. \n:global \"DHCP_ISP_Route_Check_Comment2\" \"Table for isp2 Static\
  124. \_Gateway\"\r\
  125. \n\r\
  126. \n# Grab gateway IP of DHCP interface\r\
  127. \n:global \"DHCP_GW_IF\" [ /ip dhcp-client get [/ip dhcp-client find inter\
  128. face=\$\"DHCP_ISP_IF_Name\" status=\"bound\" ] gateway ]\r\
  129. \n\r\
  130. \n# Grab existing route check gateway\r\
  131. \n:global \"DHCP_Route_GW\" [ /ip route get [/ip route find comment=\$\"DH\
  132. CP_ISP_Route_Check_Comment\"] gateway ]\r\
  133. \n\r\
  134. \n# Update gateway check route if different\r\
  135. \n:if ( \$\"DHCP_GW_IF\" != \$\"DHCP_Route_GW\" ) do={\r\
  136. \n\t:log warning (\"Setting default gateway for interface:\" . \$\"DHCP_IS\
  137. P_IF_Name\" .\" to gateway:\" . \$\"DHCP_GW_IF\")\r\
  138. \n\t:local a [ /ip route find comment=\$\"DHCP_ISP_Route_Check_Comment\" ]\
  139. \r\
  140. \n\t:local b [ /ip route find comment=\$\"DHCP_ISP_Route_Check_Comment2\" \
  141. ]\r\
  142. \n\t/ip route set \$a gateway=\$\"DHCP_GW_IF\"\r\
  143. \n\t/ip route set \$b gateway=\$\"DHCP_GW_IF\"\r\
  144. \n}"
  145. add name=GWCheck-isp1 owner=admin policy=\
  146. ftp,reboot,read,write,policy,test,password,sniff,sensitive source="# Scrip\
  147. t to modify recursive route checks for failover with PPPoE clients\r\
  148. \n\r\
  149. \n# Define Variables\r\
  150. \n:global \"PPPoE_ISP_Name\" \"isp1 PPPOE\"\r\
  151. \n:global \"PPPoE_ISP_IF_Name\" \"isp1-PPPoE\"\r\
  152. \n:global \"PPPoE_ISP_Route_Check_Comment\" \"isp1 Gateway Check\"\r\
  153. \n:global \"PPPoE_ISP_Route_Check_Comment2\" \"Table for isp1 Static \
  154. Gateway\"\r\
  155. \n\r\
  156. \n# Grab gateway IP of PPPoE interface\r\
  157. \n:global \"PPPoE_GW_IF\" \r\
  158. \n/interface pppoe-client monitor [/interface pppoe-client find name=\$\"P\
  159. PPoE_ISP_IF_Name\" running=yes] once do={ :global \"PPPoE_GW_IF\" \$\"remo\
  160. te-address\" }\r\
  161. \n\r\
  162. \n# Grab existing route check gateway\r\
  163. \n:global \"PPPoE_Route_GW\" [ /ip route get [/ip route find comment=\$\"P\
  164. PPoE_ISP_Route_Check_Comment\"] gateway ]\r\
  165. \n\r\
  166. \n# Update gateway check route if different\r\
  167. \n:if ( \$\"PPPoE_GW_IF\" != \$\"PPPoE_Route_GW\" ) do={\r\
  168. \n\t:log warning (\"Setting default gateway for interface:\" . \$\"PPPoE_I\
  169. SP_IF_Name\" .\" to gateway:\" . \$\"PPPoE_GW_IF\")\r\
  170. \n\t:local a [ /ip route find comment=\$\"PPPoE_ISP_Route_Check_Comment\" \
  171. ]\r\
  172. \n\t:local b [ /ip route find comment=\$\"PPPoE_ISP_Route_Check_Comment2\"\
  173. \_]\r\
  174. \n\t/ip route set \$a gateway=\$\"PPPoE_GW_IF\"\r\
  175. \n\t/ip route set \$b gateway=\$\"PPPoE_GW_IF\"\r\
  176. \n}"
  177. /tool graphing interface
  178. add
  179. /tool mac-server
  180. set [ find default=yes ] disabled=yes
  181. add interface=ether2-isp2
  182. add interface=ether3-LAN
  183. add interface=ether4-LAN
  184. add interface=ether5-LAN
  185. /tool mac-server mac-winbox
  186. set [ find default=yes ] disabled=yes
  187. add interface=ether2-isp2
  188. add interface=ether3-LAN
  189. add interface=ether4-LAN
  190. add interface=ether5-LAN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement