14 de Diciembre de 2017, 09:45:55 pm
  • WPSdb - Base de Datos de Pines Online

Autor Tema: Balanceo de Carga Mikrotik para 4 Lineas [Script]  (Leído 8058 veces)

Desconectado D3M0N

  • Founder
  • Usuario
  • *
  • Mensajes: 3.117
  • Reputación: +247/-4
  • El Mate, La Netbook y Wi-Fi del Vecino!
  • awards Usuario con más de 2000 Posts! Miembro registrado desde 2010 Usuario Registrado
    • Arg-Wireless.com.ar
    • Awards
Balanceo de Carga Mikrotik para 4 Lineas [Script]
« en: 03 de Agosto de 2013, 08:52:43 pm »

NOTA: Debes respetar todos los vares aclarados en este post, de lo contrario pueda que no funcione.

1.- Puedes utilizar cualquier Mirkotik que tenga al menos 5 bocas, te recomiendo el RB450G, RB750, etc. Recuerda que te recomendamos tener una v5.25 de RouterOS.

2.- Realice un Reset-Configuration a su equipamiento, al reiniciar elimine el script de configuración por defecto.

3.- Ahora debemos configurar los Modem/Routers que tengamos, en este caso tendriamos 4 de la siguiente manera:

Ether1-WAN - Gateway: 192.168.1.254 - DHCP: 192.168.1.1-192.168.1.2
Ether2-WAN - Gateway: 192.168.2.254 - DHCP: 192.168.1.1-192.168.1.2
Ether3-WAN - Gateway: 192.168.3.254 - DHCP: 192.168.1.1-192.168.1.2
Ether4-WAN - Gateway: 192.168.4.254 - DHCP: 192.168.1.1-192.168.1.2

4.- Vamos a tener la IP: 192.168.10.254 Local de Mikrotik.

Código: [Seleccionar]
/ip address
add address=192.168.10.254/24 network=192.168.10.0 broadcast=192.168.10.255 interface=Ether5-Lan
add address=192.168.1.1/24 network=192.168.1.0 broadcast=192.168.1.255 interface=Ether1-WAN
add address=192.168.2.1/24 network=192.168.2.0 broadcast=192.168.2.255 interface=Ether2-WAN
add address=192.168.3.1/24 network=192.168.3.0 broadcast=192.168.3.255 interface=Ether3-WAN
add address=192.168.4.1/24 network=192.168.4.0 broadcast=192.168.4.255 interface=Ether4-WAN
/ip firewall mangle
add chain=input in-interface=Ether1-WAN action=mark-connection new-connection-mark=Ether1-WAN_conn
add chain=input in-interface=Ether2-WAN action=mark-connection new-connection-mark=Ether2-WAN_conn
add chain=input in-interface=Ether3-WAN action=mark-connection new-connection-mark=Ether3-WAN_conn
add chain=input in-interface=Ether4-WAN action=mark-connection new-connection-mark=Ether4-WAN_conn
add chain=output connection-mark=Ether1-WAN_conn action=mark-routing new-routing-mark=to_Ether1-WAN
add chain=output connection-mark=Ether2-WAN_conn action=mark-routing new-routing-mark=to_Ether2-WAN
add chain=output connection-mark=Ether3-WAN_conn action=mark-routing new-routing-mark=to_Ether3-WAN
add chain=output connection-mark=Ether4-WAN_conn action=mark-routing new-routing-mark=to_Ether4-WAN
add chain=prerouting dst-address=192.168.1.0/24 action=accept in-interface=Ether5-Lan
add chain=prerouting dst-address=192.168.2.0/24 action=accept in-interface=Ether5-Lan
add chain=prerouting dst-address=192.168.3.0/24 action=accept in-interface=Ether5-Lan
add chain=prerouting dst-address=192.168.4.0/24 action=accept in-interface=Ether5-Lan
add chain=prerouting dst-address-type=!local in-interface=Ether5-Lan per-connection-classifier=both-addresses:4/0 \ action=mark-connection new-connection-mark=Ether1-WAN_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Ether5-Lan per-connection-classifier=both-addresses:4/1 \ action=mark-connection new-connection-mark=Ether2-WAN_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Ether5-Lan per-connection-classifier=both-addresses:4/2 \ action=mark-connection new-connection-mark=Ether3-WAN_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Ether5-Lan per-connection-classifier=both-addresses:4/3 \ action=mark-connection new-connection-mark=Ether4-WAN_conn passthrough=yes
add chain=prerouting connection-mark=Ether1-WAN_conn in-interface=Ether5-Lan action=mark-routing new-routing-mark=to_Ether1-WAN
add chain=prerouting connection-mark=Ether2-WAN_conn in-interface=Ether5-Lan action=mark-routing new-routing-mark=to_Ether2-WAN
add chain=prerouting connection-mark=Ether3-WAN_conn in-interface=Ether5-Lan action=mark-routing new-routing-mark=to_Ether3-WAN
add chain=prerouting connection-mark=Ether4-WAN_conn in-interface=Ether5-Lan action=mark-routing new-routing-mark=to_Ether4-WAN
/ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.254 routing-mark=to_Ether1-WAN check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.254 routing-mark=to_Ether2-WAN check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.3.254 routing-mark=to_Ether3-WAN check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.4.254 routing-mark=to_Ether4-WAN check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.1.254 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.254 distance=2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.3.254 distance=3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.4.254 distance=4 check-gateway=ping
/ip firewall nat
add chain=srcnat out-interface=Ether1-WAN action=masquerade
add chain=srcnat out-interface=Ether2-WAN action=masquerade
add chain=srcnat out-interface=Ether3-WAN action=masquerade
add chain=srcnat out-interface=Ether4-WAN action=masquerade
  • Antenas: Antena Komarov (Prototype), Antena Belgrain (MOD), Antenas 4, 5, 9dBi (omnis)
  • Sistemas Operativos: Microsoft Windows 7 Enterprice (x64), Ubuntu 14.10.1 LTS Desktop Edition 64-bit
  • Sistemas Operativos que utilizo para Auditar: Ubuntu 14.10.1 LTS Desktop Edition 64-bit
  • Dispositivos Inalambricos: Alfa AWUS036H 1W (USB); TP-Link TL-WN722N (USB); Ubiquiti Nanostation M2; Mikrotik RB951Ui-2HnD

Desconectado mcguti

  • Usuario
  • *
  • Mensajes: 2
  • Reputación: +0/-0
  • Usuario
  • awards Usuario Registrado
    • Awards
Re:Balanceo de Carga Mikrotik para 4 Lineas [Script]
« Respuesta #1 en: 28 de Octubre de 2015, 11:01:48 pm »
Trae Balanceo recursivo, y failover?
  • Antenas: Direccional 10DBi
  • Sistemas Operativos: Windows 7 , Linux Ubuntu
  • Sistemas Operativos que utilizo para Auditar: Wifislax
  • Dispositivos Inalambricos: Ralink 3070 Melon N400

Desconectado D3M0N

  • Founder
  • Usuario
  • *
  • Mensajes: 3.117
  • Reputación: +247/-4
  • El Mate, La Netbook y Wi-Fi del Vecino!
  • awards Usuario con más de 2000 Posts! Miembro registrado desde 2010 Usuario Registrado
    • Arg-Wireless.com.ar
    • Awards
Re:Balanceo de Carga Mikrotik para 4 Lineas [Script]
« Respuesta #2 en: 29 de Octubre de 2015, 01:35:36 pm »
es un balanceo común, sin ip publica no hay failover.
  • Antenas: Antena Komarov (Prototype), Antena Belgrain (MOD), Antenas 4, 5, 9dBi (omnis)
  • Sistemas Operativos: Microsoft Windows 7 Enterprice (x64), Ubuntu 14.10.1 LTS Desktop Edition 64-bit
  • Sistemas Operativos que utilizo para Auditar: Ubuntu 14.10.1 LTS Desktop Edition 64-bit
  • Dispositivos Inalambricos: Alfa AWUS036H 1W (USB); TP-Link TL-WN722N (USB); Ubiquiti Nanostation M2; Mikrotik RB951Ui-2HnD