3 Wan Load Balance PCC with HOTSPOT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
| #Set Ethernet name as WAN1,WAN2,WAN3,Local and copy below script on terminal window. #After adding this script please goto hotspot and run hotspot setup manually #Reboot my Mikrotik and test your setup. /ip pool add name=dhcp_pool1 ranges=192.168.21.2-192.168.21.254 /ip dhcp-server add address-pool=dhcp_pool1 disabled=no interface=Local name=dhcp1 /ip address add address=192.168.1.2/24 interface=WAN1 add address=192.168.2.2/24 interface=WAN2 add address=192.168.3.2/24 interface=WAN3 add address=192.168.21.1/24 interface=Local /ip dhcp-server network add address=192.168.21.0/24 gateway=192.168.21.1 /ip dns set allow-remote-requests=yes cache-size=5000KiB max-udp-packet-size=2048 servers=192.168.1.1,192.168.2.1 /ip firewall mangle add action=mark-routing chain=output connection-mark=WAN1_conn new-routing-mark=to_WAN1 add action=mark-routing chain=output connection-mark=WAN2_conn new-routing-mark=to_WAN2 add action=mark-routing chain=output connection-mark=WAN3_conn new-routing-mark=to_WAN3 add chain=prerouting dst-address=192.168.1.0/24 in-interface=Local add chain=prerouting dst-address=192.168.2.0/24 in-interface=Local add chain=prerouting dst-address=192.168.3.0/24 in-interface=Local add
action=mark-connection chain=prerouting dst-address-type=!local
hotspot=auth in-interface=Local new-connection-mark=WAN1_conn
per-connection-classifier=both-addresses-and-ports:3/0 add
action=mark-connection chain=prerouting dst-address-type=!local
hotspot=auth in-interface=Local new-connection-mark=WAN2_conn
per-connection-classifier=both-addresses-and-ports:3/1 add
action=mark-connection chain=prerouting dst-address-type=!local
hotspot=auth in-interface=Local new-connection-mark=WAN3_conn
per-connection-classifier=both-addresses-and-ports:3/2 add action=mark-routing chain=prerouting connection-mark=WAN1_conn in-interface=Local new-routing-mark=to_WAN1 add action=mark-routing chain=prerouting connection-mark=WAN2_conn in-interface=Local new-routing-mark=to_WAN2 add action=mark-routing chain=prerouting connection-mark=WAN2_conn in-interface=Local new-routing-mark=to_WAN3 /ip firewall nat add action=masquerade chain=srcnat out-interface=WAN1 add action=masquerade chain=srcnat out-interface=WAN2 add action=masquerade chain=srcnat out-interface=WAN3 /ip route add check-gateway=ping distance=1 gateway=192.168.1.1 routing-mark=to_WAN1 add check-gateway=ping distance=1 gateway=192.168.2.1 routing-mark=to_WAN2 add check-gateway=ping distance=1 gateway=192.168.3.1 routing-mark=to_WAN3 add check-gateway=ping distance=1 gateway=192.168.1.1 add check-gateway=ping distance=2 gateway=192.168.2.1 add check-gateway=ping distance=3 gateway=192.168.3.1 |