Advertisement
albspirit86

send http to wan2

Jul 4th, 2014
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. this works only if you have two wan ports on MIKROTIK (WAN1, WAN2), WAN1 is default route in our scenario, WAN2 will be used for HTTP traffic which will be coming from local computers.
  2.  
  3.  
  4. send only http "port80"
  5.  
  6. /ip firewall mangle
  7. add chain=prerouting action=mark-routing new-routing-mark=web_traffic passthrough=no protocol=tcp dst-address-type=!local in-interface=LAN dst-port=80
  8.  
  9. /ip route
  10. add comment="port80" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=WAN2 routing-mark=web_traffic scope=30 target-scope=10
  11.  
  12. /ip firewall nat
  13. add action=masquerade chain=srcnat disabled=no out-interface=WAN2
  14.  
  15.  
  16.  
  17. send only https "port 443"
  18.  
  19. /ip firewall mangle
  20. add chain=prerouting action=mark-routing new-routing-mark=web_traffic passthrough=no protocol=tcp dst-address-type=!local in-interface=LAN dst-port=443
  21.  
  22. /ip route
  23. add comment="port443" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=WAN2 routing-mark=web_traffic scope=30 target-scope=10
  24.  
  25. /ip firewall nat
  26. add action=masquerade chain=srcnat disabled=no out-interface=WAN2
  27.  
  28.  
  29.  
  30.  
  31. send http & https"port 80 & port 443"
  32.  
  33. /ip firewall mangle
  34. add chain=prerouting action=mark-routing new-routing-mark=web_traffic passthrough=no protocol=tcp dst-address-type=!local in-interface=LAN dst-port=80,443
  35.  
  36. /ip route
  37. add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=WAN2 routing-mark=web_traffic scope=30 target-scope=10
  38.  
  39. /ip firewall nat
  40. add action=masquerade chain=srcnat disabled=no out-interface=WAN2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement