Balanceo de Carga usando Router Home Station
Aprovechando que Movistar con “Imagenio”, trabaja con dos VLAN una para Imagenio con la IP 10.x.x.x y la otra para Internet con la IP 192.168.x.x. La idea es configurar Mikrotik para usar Balanceo de Carga.
Lo primero es realizar una copia de seguridad de la configuración del Mikrotik para ello vamos a:
Files –> Backup
Recordar! Renombrar las interfaces y realizar comentarios si es necesario para un mejor resultado!
Para realizar el balanceo de carga, usaremos la boca 1 para “Gateway” (192.168.x.x), la boca 2 la llamaremos Imagenio (10.138.x.x), la boca 3 para el Switch o en mi caso un PLC (192.168.0.x)
En “Interfaces” veremos las bocas y podremos cambiar los nombres.
Para asignarles las IP correspondientes utilizaremos:
IP –> Addresses
Debemos configurar el “Mangle” (marcado de paquetes según el puerto de destino) en el “Firewall”, para ello utilizaremos “New Terminal” copiaremos y pegaremos las siguientes líneas:
/ IP address
add address=192.168.0.1/24 network=192.168.0.0 Broadcast=192.168.0.255 interface=ether3-PLC
add address=192.168.1.2/24 network=192.168.0.0 Broadcast=192.168.0.255 interface=ether2-Gateway
add address=10.138.55.243/8 network=10.138.0.0 Broadcast=10.138.0.255 interface=ether1-Imagenio
/ IP firewall mangle
add chain=prerouting src-address-list=ether1-Gateway in-interface=ether3-PLC action=mark-connection \
new-connection-mark=ether1-Gateway passthrough=yes
add chain=prerouting src-address-list=ether1-Gateway in-interface=ether3-PLC action=mark-routing \
new-routing-mark=ether1-Gateway passthrough=no
add chain=prerouting src-address-list=ether2-Imagenio in-interface=ether3-PLC action=mark-connection \
new-connection-mark=ether2-Imagenio passthrough=yes
add chain=prerouting src-address-list=ether2-Imagenio in-interface=ether3-PLC action=mark-routing \
new-routing-mark=ether2-Imagenio passthrough=no
add chain=prerouting in-interface=ether3-PLC connection-state=new nth=2,1 \
action=mark-connection new-connection-mark=ether1-Gateway passthrough=yes
add chain=prerouting in-interface=ether3-PLC action=add-src-to-address-list \
address-list=ether1-Gateway address-list-timeout=1d connection-mark=ether1-Gateway passthrough=yes
add chain=prerouting in-interface=ether3-PLC connection-mark=ether1-Gateway action=mark-routing \
new-routing-mark=ether1-Gateway passthrough=no
add chain=prerouting in-interface=ether3-PLC connection-state=new nth=2,2 \
action=mark-connection new-connection-mark=ether2-Imagenio passthrough=yes
add chain=prerouting in-interface=ether3-PLC action=add-src-to-address-list \
address-list=ether2-Imagenio address-list-timeout=1d connection-mark=ether2-Imagenio passthrough=yes
add chain=prerouting in-interface=ether3-PLC connection-mark=ether2-Imagenio action=mark-routing \
new-routing-mark=ether2-Imagenio passthrough=no
/ IP firewall nat
add chain=srcnat out-interface=ether1-Gateway action=masquerade
add chain=srcnat out-interface=ether2-Imagenio action=masquerade
/ IP route
add dst-address=0.0.0.0/0 Gateway=10.138.55.241 scope=255 target-scope=10 routing-mark=ether2-Imagenio
add dst-address=0.0.0.0/0 Gateway=192.168.1.1 scope=255 target-scope=10 routing-mark=ether1-Gateway
add dst-address=0.0.0.0/0 Gateway=192.168.1.1 scope=255 target-scope=10
En forma gráfica sería:
add chain=prerouting
connection-mark=ether1-Gateway (cambiamos odd por ether1-Gateway)
action=mark-routing=ether1-Gateway (cambiamos odd por ether1-Gateway)
new-connection-mark=ether1-Gateway (cambiamos odd por ether1-Gateway)
nth=2,2
Fuente:
http://wiki.mikrotik.com/wiki/Balanceo_de_carga_mejorado_atrav%C3%A9z_de_multiples_gateway_(wan)