Hi
My objective is to configure RouterOs to Load Balance 2 WAN connections (WAN 1 is up to 25 Megas and WAN 2 is up to 5 Megas )
The script I used is the following
/ip address
add address=192.168.0.1/24 disabled=no interface=LAN network=192.168.0.0
add address=192.168.1.3/24 disabled=no interface=WAN1 network=192.168.1.0
add address=192.168.2.3/24 disabled=no interface=WAN2 network=192.168.2.0
/ip dns
set allow-remote-requests=yes cache-max-ttl=1w cache-size=5000KiB max-udp-packet-size=512 servers=8.8.8.8,8.8.4.4
/ip firewall mangle
add action=accept chain=prerouting disabled=no dst-address=192.168.1.0/24 in-interface=LAN
add action=accept chain=prerouting disabled=no dst-address=192.168.2.0/24 in-interface=LAN
add action=mark-connection chain=input disabled=no in-interface=WAN1 new-connection-mark=WAN1_mark passthrough=yes
add action=mark-connection chain=input disabled=no in-interface=WAN2 new-connection-mark=WAN2_mark passthrough=yes
add action=mark-routing chain=output connection-mark=WAN1_mark disabled=no new-routing-mark=to_ISP1 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN2_mark disabled=no new-routing-mark=to_ISP2 passthrough=yes
add action=mark-connection chain=prerouting disabled=no dst-address-type=!LAN in-interface=LAN new-connection-mark=WAN1_mark passthrough=yes per-connection-classifier=both-addresses-and-ports:2/0
add action=mark-connection chain=prerouting disabled=no dst-address-type=!LAN in-interface=LAN new-connection-mark=WAN2_mark passthrough=yes per-connection-classifier=both-addresses-and-ports:2/1
add action=mark-routing chain=prerouting connection-mark=WAN1_mark disabled=no in-interface=LAN new-routing-mark=to_ISP1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN2_mark disabled=no in-interface=LAN new-routing-mark=to_ISP2 passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat disabled=no out-interface=WAN1
add action=masquerade chain=srcnat disabled=no out-interface=WAN2
/ip route
add dst-address=8.8.8.8 gateway=192.168.1.1 scope=10
add dst-address=221.132.112.8 gateway=192.168.2.1 scope=10
add distance=1 gateway=8.8.8.8 routing-mark=to_ISP1 check-gateway=ping
add distance=2 gateway=221.132.112.8 routing-mark=to_ISP2 check-gateway=ping
add dst-address=10.0.0.1 gateway=8.8.8.8 scope=10 target-scope=10 check-gateway=ping
add dst-address=10.0.0.2 gateway=221.132.112.8 scope=10 target-scope=10 check-gateway=ping
add distance=1 gateway=10.0.0.1 routing-mark=to_ISP1
add distance=2 gateway=10.0.0.2 routing-mark=to_ISP2
add distance=1 gateway=10.0.0.1
add distance=2 gateway=10.0.0.2
This is an extract of the configuration as implemented
[admin@LOADB] > /export
jul/24/2015 13:34:02 by RouterOS 6.30.1
software id = K3HJ-RS68
/interface ethernet
set [ find default-name=ether6 ] name=LAN
set [ find default-name=ether1 ] name=WAN1
set [ find default-name=ether2 ] name=WAN2
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp_pool1 ranges=192.168.0.2-192.168.0.254
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=LAN name=dhcp1
/ip address
add address=192.168.0.1/24 interface=LAN network=192.168.0.0
/ip dhcp-client
add default-route-distance=0 dhcp-options=hostname,clientid
disabled=no interface=WAN1
add default-route-distance=0 dhcp-options=hostname,clientid
disabled=no interface=WAN2
/ip dhcp-server network
add address=192.168.0.0/24 gateway=192.168.0.1
/ip dns
set allow-remote-requests=yes cache-size=5000KiB
max-udp-packet-size=512 servers=8.8.8.8,8.8.4.4
/ip firewall mangle
add chain=prerouting dst-address=192.168.1.0/24 in-interface=LAN
add chain=prerouting dst-address=192.168.2.0/24 in-interface=LAN
add action=mark-connection chain=input in-interface=WAN1
new-connection-mark=WAN1_mark
add action=mark-connection chain=input in-interface=WAN2
new-connection-mark=WAN2_mark
add action=mark-routing chain=output connection-mark=WAN1_mark
new-routing-mark=to_ISP1
add action=mark-routing chain=output connection-mark=WAN2_mark
new-routing-mark=to_ISP2
add action=mark-routing chain=prerouting connection-mark=WAN1_mark
in-interface=LAN new-routing-mark=to_ISP1
add action=mark-routing chain=prerouting connection-mark=WAN2_mark
in-interface=LAN new-routing-mark=to_ISP2
/ip firewall nat
add action=masquerade chain=srcnat out-interface=WAN1
add action=masquerade chain=srcnat out-interface=WAN2
/ip route
add check-gateway=ping distance=1 gateway=8.8.8.8 routing-mark=
to_ISP1
add distance=1 gateway=10.0.0.1 routing-mark=to_ISP1
add check-gateway=ping distance=2 gateway=221.132.112.8
routing-mark=to_ISP2
add distance=2 gateway=10.0.0.2 routing-mark=to_ISP2
add distance=1 gateway=10.0.0.1
add distance=2 gateway=10.0.0.2
add distance=1 dst-address=8.8.8.8/32 gateway=192.168.1.1 scope=10
add check-gateway=ping distance=1 dst-address=10.0.0.1/32 gateway=
8.8.8.8 scope=10
add check-gateway=ping distance=1 dst-address=10.0.0.2/32 gateway=
221.132.112.8 scope=10
add distance=1 dst-address=221.132.112.8/32 gateway=192.168.2.1
scope=10
/system clock
set time-zone-name=Europe/Madrid
/system identity
set name=LOADB
/tool romon port
add
[admin@LOADB] >
Here are my questions
- How can I check if the setup is actually load balancing correctly
- Does anyone see any mistakes
- Can I improve the configuration
My observations
I have not seen any speed improvement
Youtube stream seems to be choppy
Thanks for any help
Cheers