Advertisement
hedjo1119

lb pcc

Jun 28th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.92 KB | None | 0 0
  1. Asumsi :
  2. ISP1 : 192.168.1.1
  3. ISP2 : 192.168.2.1
  4. ISP3 : 192.168.3.1
  5. ISP4 : 192.168.4.1
  6. ISP5 : 192.168.5.1
  7.  
  8. /interface ethernet
  9. set [find default-name=ether1] name=ether1
  10. set [find default-name=ether2] name=ether2
  11. set [find default-name=ether3] name=ether3
  12. set [find default-name=ether4] name=ether4
  13. set [find default-name=ether5] name=ether5
  14. set [find default-name=ether6] name=ether6
  15.  
  16. /ip address
  17. add address=192.168.254.1/24 network=192.168.254.0 broadcast=192.168.254.255 interface=ether6
  18. add address=192.168.1.10/24 network=192.168.1.0 broadcast=192.168.1.255 interface=ether1
  19. add address=192.168.2.10/24 network=192.168.2.0 broadcast=192.168.2.255 interface=ether2
  20. add address=192.168.3.10/24 network=192.168.3.0 broadcast=192.168.3.255 interface=ether3
  21. add address=192.168.4.10/24 network=192.168.4.0 broadcast=192.168.4.255 interface=ether4
  22. add address=192.168.5.10/24 network=192.168.5.0 broadcast=192.168.5.255 interface=ether5
  23.  
  24. /ip firewall mangle
  25. add chain=input in-interface=ether1 action=mark-connection new-connection-mark=WAN1_conn
  26. add chain=input in-interface=ether2 action=mark-connection new-connection-mark=WAN2_conn
  27. add chain=input in-interface=ether3 action=mark-connection new-connection-mark=WAN3_conn
  28. add chain=input in-interface=ether4 action=mark-connection new-connection-mark=WAN4_conn
  29. add chain=input in-interface=ether5 action=mark-connection new-connection-mark=WAN5_conn
  30.  
  31. add chain=output connection-mark=WAN1_conn action=mark-routing new-routing-mark=to_WAN1
  32. add chain=output connection-mark=WAN2_conn action=mark-routing new-routing-mark=to_WAN2
  33. add chain=output connection-mark=WAN3_conn action=mark-routing new-routing-mark=to_WAN3
  34. add chain=output connection-mark=WAN4_conn action=mark-routing new-routing-mark=to_WAN4
  35. add chain=output connection-mark=WAN5_conn action=mark-routing new-routing-mark=to_WAN5
  36.  
  37. add chain=prerouting dst-address=192.168.1.0/24 action=accept in-interface=ether6
  38. add chain=prerouting dst-address=192.168.2.0/24 action=accept in-interface=ether6
  39. add chain=prerouting dst-address=192.168.3.0/24 action=accept in-interface=ether6
  40. add chain=prerouting dst-address=192.168.4.0/24 action=accept in-interface=ether6
  41. add chain=prerouting dst-address=192.168.5.0/24 action=accept in-interface=ether6
  42.  
  43. add chain=prerouting dst-address-type=!local in-interface=ether6 per-connection-classifier=both-addresses-and-ports:5/0 action=mark-connection new-connection-mark=ether1_conn passthrough=yes
  44. add chain=prerouting dst-address-type=!local in-interface=ether6 per-connection-classifier=both-addresses-and-ports:5/1 action=mark-connection new-connection-mark=ether2_conn passthrough=yes
  45. add chain=prerouting dst-address-type=!local in-interface=ether6 per-connection-classifier=both-addresses-and-ports:5/2 action=mark-connection new-connection-mark=ether3_conn passthrough=yes
  46. add chain=prerouting dst-address-type=!local in-interface=ether6 per-connection-classifier=both-addresses-and-ports:5/3 action=mark-connection new-connection-mark=ether4_conn passthrough=yes
  47. add chain=prerouting dst-address-type=!local in-interface=ether6 per-connection-classifier=both-addresses-and-ports:5/4 action=mark-connection new-connection-mark=ether5_conn passthrough=yes
  48. add chain=prerouting connection-mark=ether1_conn in-interface=ether6 action=mark-routing new-routing-mark=to_ether1
  49. add chain=prerouting connection-mark=ether2_conn in-interface=ether6 action=mark-routing new-routing-mark=to_ether2
  50. add chain=prerouting connection-mark=ether3_conn in-interface=ether6 action=mark-routing new-routing-mark=to_ether3
  51. add chain=prerouting connection-mark=ether4_conn in-interface=ether6 action=mark-routing new-routing-mark=to_ether4
  52. add chain=prerouting connection-mark=ether5_conn in-interface=ether6 action=mark-routing new-routing-mark=to_ether5
  53.  
  54. /ip route
  55. add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=to_ether1 check-gateway=ping
  56. add dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=to_ether2 check-gateway=ping
  57. add dst-address=0.0.0.0/0 gateway=192.168.3.1 routing-mark=to_ether3 check-gateway=ping
  58. add dst-address=0.0.0.0/0 gateway=192.168.4.1 routing-mark=to_ether4 check-gateway=ping
  59. add dst-address=0.0.0.0/0 gateway=192.168.5.1 routing-mark=to_ether5 check-gateway=ping
  60. add dst-address=0.0.0.0/0 gateway=192.168.1.1 distance=1 check-gateway=ping
  61. add dst-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping
  62. add dst-address=0.0.0.0/0 gateway=192.168.3.1 distance=3 check-gateway=ping
  63. add dst-address=0.0.0.0/0 gateway=192.168.4.1 distance=4 check-gateway=ping
  64. add dst-address=0.0.0.0/0 gateway=192.168.5.1 distance=5 check-gateway=ping
  65.  
  66. /ip firewall nat
  67. add chain=srcnat out-interface=ether1 action=masquerade
  68. add chain=srcnat out-interface=ether2 action=masquerade
  69. add chain=srcnat out-interface=ether3 action=masquerade
  70. add chain=srcnat out-interface=ether4 action=masquerade
  71. add chain=srcnat out-interface=ether5 action=masquerade
  72.  
  73. /ip dns
  74. set servers=8.8.8.8,8.8.4.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement