Mainos / Advertisement:

RouterOS Load Balancing

From Taisto
(Redirected from RouerOS Load Balancing)
Jump to navigation Jump to search
This page contains changes which are not marked for translation.


Tässä ohjeessa tehdään kahden WAN portin kuormantasaus. Käytössämme on RB951-2HnD (RouterOS 6.28) reititin ja kaksi WAN yhteyttä. Suosittelemme käyttämään kahta samanlaista WAN yhteyttä.


 wan1: 192.168.10.1
 wan2: 192.168.20.1
 bridge-local: 192.168.88.1

bridge-local on verkkosilta.

Määritetään staattiset IP-osoitteet:

 /ip address
     add address 192.168.88.1/24 interface=bridge-local
     add address 192.168.10.1/24 interface=wan1
     add address 192.168.20.1/24 interface=wan2

Konfiguroidaan palomuuri (Mangle)

 /ip firewall mangle
     add chain=input in-interface=wan1 action=mark-connection new-connection-mark=wan1-con
     add chain=input in-interface=wan2 action=mark-connection new-connection-mark=wan2-con
    
    add chain=output connection-mark=wan1-con action=mark-routing new-routing-mark=to-wan1
    add chain=output connection-mark=wan2-con action=mark-routing new-routing-mark=to-wan2
   
    add chain=prerouting dst-address-type=!local in-interface=bridge-local per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection new-connection-mark=wan1-con passthrough=yes
    add chain=prerouting dst-address-type=!local in-interface=bridge-local per-connection-classifier=both-addresses-and-ports:2/1 action=mark-connection new-connection-mark=wan2-con passthrough=yes
    
    add chain=prerouting connection-mark=wan1-con in-interface=bridge-local action=mark-routing new-routing-mark=to_wan1
    add chain=prerouting connection-mark=wan2-con in-interface=bridge-local action=mark-routing new-routing-mark=to_wan2

Konfiguroidaan reititys.

 /ip route
    add dst-address=0.0.0.0/0 gateway=192.168.10.1 routing-mark=to-wan1 check-gateway=ping
    add dst-address=0.0.0.0/0 gateway=192.168.20.1 routing-mark=to-wan2 check-gateway=ping

Konfiguroi NAT

 /ip firewall nat
    add chain=srcnat out-interface=wan1 action=masquerade
    add chain=srcnat out-interface=wan2 action=masquerade
Mainos / Advertisement: