+ Responder ao Tópico



  1. Estou tentando configurar um load balance com 2 links há dias, mas não funciona de jeito nenhum.
    Todos navegam tranquilamente, uns pelo primeiro outros pelo segundo link. Acontece que o MK está dando prioridade para o primeiro link, ou seja, coloca muito mais clientes no primeiro.
    Agora mesmo tenho 21 o primeiro e 9 no outro. Quando no meu ponto de vista deveria ter 15 em cada já que os links são de velocidades iguais.

    Estou usando a versão 2.9.51
    Abaixo posto minhas regras:

    Código :
    add chain=prerouting action=mark-connection new-connection-mark=odd passthrough=yes connection-state=new src-address=100.100.9.0/24 src-address-list=link1 \
        comment="Clientes listados" disabled=no 
    add chain=prerouting action=mark-routing new-routing-mark=odd passthrough=no connection-state=new src-address=100.100.9.0/24 connection-mark=odd comment="" \
        disabled=no 
    add chain=prerouting action=mark-connection new-connection-mark=even passthrough=yes connection-state=new src-address=100.100.9.0/24 src-address-list=link2 \
        comment="" disabled=no 
    add chain=prerouting action=mark-routing new-routing-mark=even passthrough=no connection-state=new src-address=100.100.9.0/24 connection-mark=even comment="" \
        disabled=no 
    add chain=prerouting action=mark-connection new-connection-mark=odd passthrough=yes connection-state=new src-address=100.100.9.0/24 nth=1,1,0 \
        comment="Direciona clientes para cada link" disabled=no 
    add chain=prerouting action=add-src-to-address-list src-address=100.100.9.0/24 connection-mark=odd address-list=link1 address-list-timeout=3h comment="" \
        disabled=no 
    add chain=prerouting action=mark-routing new-routing-mark=odd passthrough=no src-address=100.100.9.0/24 connection-mark=odd comment="" disabled=no 
    add chain=prerouting action=mark-connection new-connection-mark=even passthrough=yes connection-state=new src-address=100.100.9.0/24 nth=1,1,1 comment="" \
        disabled=no 
    add chain=prerouting action=add-src-to-address-list src-address=100.100.9.0/24 connection-mark=even address-list=link2 address-list-timeout=3h comment="" \
        disabled=no 
    add chain=prerouting action=mark-routing new-routing-mark=even passthrough=no src-address=100.100.9.0/24 connection-mark=even comment="" disabled=no

    Agradeço a quem puder ajudar.

  2. concordo plenamente!!
    1 simples clik tava massa!



  3. Então essas regras de load balance rolaram mo meu mikrotik, porém eu não consigo redirecionar o trafego da porta 80 para o meu squid. Como vcs fizeram isso? Tentei algumas regras e nada. Até marcar os pacotes e criar uma rota no ip route eu fiz e não rolou. Quem tá usando proxy transparente externo ao mikrotik está fazendo como?
    obrigado pela contribuição desse load balance.

  4. Citação Postado originalmente por jeanfrank Ver Post
    Bom dia a todos

    Testei vários balanceamentos e tive muitos problemas com msn, bancos conectividade social etc
    Então pesquisando implementei um load balance por nth + permanent conection e ficou muito bom, aqui estou utilizando 5 links de velocidade iguais e mesma operadora e detalhe os links tem que estar bons pra dar tudo certo no meu caso tenho 2 links locais na sede da empresa e 3 links remotos vindo de outras partes da cidade não entrarei em detalhes esta parte somente o balanceamento mas se alguem tiver duvida é só postar e ajudamos no que puder. Segue:

    Comece criando faixas de ip pras interfaces dos links no server mk tenho 7 interfaces lan;
    Minha interface que distribui o sinal chama-se clientes.

    ip/address list

    Link1 = 192.168.4.253/24
    Link2 = 192.168.2.253/24
    Link3 = 192.168.3.253/24
    Link4 = 192.168.1.253/24
    Link5 = 192.168.9.253/24

    Agora vamos criar 5 address list uma pra cada link

    ip/firewall/address list

    +/name:Link1 / 192.168.4.253/ok
    +/name:Link2 / 192.168.2.253/ok
    +/name:Link3 / 192.168.3.253/ok
    +/name:Link4 / 192.168.1.253/ok
    +/name:Link5 / 192.168.9.253/ok

    Continuando vamos criar todas as regras de mangle

    ip/firewall/mangle

    General#chain-prerouting/In. interface: Clientes#Advanced/Src. address list: Link1#Action/Action: mark connection/New connection mark:Link1/passthrough=yes
    General#chain-prerouting/In. interface: Clientes#Advanced/Src. address list: Link1#Action/Action: mark routing/New routing mark:Link1/passthrough=no

    ---------------------------------------------------------------------------------------------
    General#chain-prerouting/In. interface: Clientes#Advanced/Src. address list: Link2#Action/Action: mark connection/New connection mark:Link2/passthrough=yes
    General#chain-prerouting/In. interface: Clientes#Advanced/Src. address list: Link2#Action/Action: mark routing/New routing mark:Link2/passthrough=no

    ---------------------------------------------------------------------------------------------
    General#chain-prerouting/In. interface: Clientes#Advanced/Src. address list: Link3#Action/Action: mark connection/New connection mark:Link3/passthrough=yes
    General#chain-prerouting/In. interface: Clientes#Advanced/Src. address list: Link3#Action/Action: mark routing/New routing mark:Link3/passthrough=no

    ---------------------------------------------------------------------------------------------
    General#chain-prerouting/In. interface: Clientes#Advanced/Src. address list: Link4#Action/Action: mark connection/New connection mark:Link4/passthrough=yes
    General#chain-prerouting/In. interface: Clientes#Advanced/Src. address list: Link4#Action/Action: mark routing/New routing mark:Link4/passthrough=no

    ---------------------------------------------------------------------------------------------
    General#chain-prerouting/In. interface: Clientes#Advanced/Src. address list: Link5#Action/Action: mark connection/New connection mark:Link5/passthrough=yes
    General#chain-prerouting/In. interface: Clientes#Advanced/Src. address list: Link5#Action/Action: mark routing/New routing mark:Link5/passthrough=no

    ---------------------------------------------------------------------------------------------
    General#chain-prerouting/In. interface: Clientes/Connection State: new#Extra: nth every=4, Counter=4, Packet=0/Action/Action: mark connection/New connection mark:Link1/passthrough=yes
    General#chain-prerouting/In. interface: Clientes/Connect mark:Link1#Action/Action: add src to address list/address list:Link1/timeout: 1d 00:00:00
    General#chain-prerouting/In. interface: Clientes/Connection mark: Link1#Action/Action: mark routing/New routing mark:Link1/passthrough=no
    ---------------------------------------------------------------------------------------------
    General#chain-prerouting/In. interface: Clientes/Connection State: new#Extra: nth every=4, Counter=4, Packet=1/Action/Action: mark connection/New connection mark:Link2/passthrough=yes
    General#chain-prerouting/In. interface: Clientes/Connect mark:Link2#Action/Action: add src to address list/address list:Link2/timeout: 1d 00:00:00
    General#chain-prerouting/In. interface: Clientes/Connection mark: Link2#Action/Action: mark routing/New routing mark:Link2/passthrough=no
    ---------------------------------------------------------------------------------------------
    General#chain-prerouting/In. interface: Clientes/Connection State: new#Extra: nth every=4, Counter=4, Packet=2/Action/Action: mark connection/New connection mark:Link3/passthrough=yes
    General#chain-prerouting/In. interface: Clientes/Connect mark:Link3#Action/Action: add src to address list/address list:Link3/timeout: 1d 00:00:00
    General#chain-prerouting/In. interface: Clientes/Connection mark: Link3#Action/Action: mark routing/New routing mark:Link3/passthrough=no
    ---------------------------------------------------------------------------------------------
    General#chain-prerouting/In. interface: Clientes/Connection State: new#Extra: nth every=4, Counter=4, Packet=3/Action/Action: mark connection/New connection mark:Link4/passthrough=yes
    General#chain-prerouting/In. interface: Clientes/Connect mark:Link4#Action/Action: add src to address list/address list:Link4/timeout: 1d 00:00:00
    General#chain-prerouting/In. interface: Clientes/Connection mark: Link4#Action/Action: mark routing/New routing mark:Link4/passthrough=no
    ---------------------------------------------------------------------------------------------
    General#chain-prerouting/In. interface: Clientes/Connection State: new#Extra: nth every=4, Counter=4, Packet=4/Action/Action: mark connection/New connection mark:Link5/passthrough=yes
    General#chain-prerouting/In. interface: Clientes/Connect mark:Link5#Action/Action: add src to address list/address list:Link5/timeout: 1d 00:00:00
    General#chain-prerouting/In. interface: Clientes/Connection mark: Link5#Action/Action: mark routing/New routing mark:Link5/passthrough=no
    ---------------------------------------------------------------------------------------------
    Bom ufa...finalizado as regras de mangle vamos pra regras de nat...

    General#chain:srcnat/Connection mark: Link1#Action/Action: src-nat/to addresses:192.168.4.253/to ports: 0-65535

    General#chain:srcnat/Connection mark: Link2#Action/Action: src-nat/to addresses:192.168.2.253/to ports: 0-65535

    General#chain:srcnat/Connection mark: Link3#Action/Action: src-nat/to addresses:192.168.3.253/to ports: 0-65535

    General#chain:srcnat/Connection mark: Link4#Action/Action: src-nat/to addresses:192.168.1.253/to ports: 0-65535

    General#chain:srcnat/Connection mark: Link5#Action/Action: src-nat/to addresses:192.168.9.253/to ports: 0-65535

    ----------------------------------------------------------------------------------------------
    Finalmente as regras de ip/route list...vamos lá

    Destination: 0.0.0.0/0
    gateway: 192.168.4.254
    Mark: Link1

    Destination: 0.0.0.0/0
    gateway: 192.168.2.254
    Mark: Link2

    Destination: 0.0.0.0/0
    gateway: 192.168.3.254
    Mark: Link3

    Destination: 0.0.0.0/0
    gateway: 192.168.1.254
    Mark: Link4

    Destination: 0.0.0.0/0
    gateway: 192.168.9.254
    Mark: Link5

    Este funciona como meu link principal
    Destination: 0.0.0.0/0
    gateway: 192.168.4.254

    Então pessoal é isto se esqueci de algo pode cobrar e espero que ajude vcs, por que batalhei bastante pra chegar a este cenário e quero deixar claro que não é o balanceamento difinitivo e tem seus pros e contras mas acredito que é um excelente começo pra quem quer balancear links sem ter problemas com bancos e msn, pra aqueles que utilizam hotspot como eu e utiliza o conectividade social tem outras regras complementares pra resolver o problema se alguem tiver duvida pode perguntar... e se ajudou alguem este post por favor agradeça... Pois é o meu salario rs rs rs rs rs....

    Abraços e até a proxima.

    Felicidades pra todos!!!!!!!!!!!!


    esse comando no meu nao rolou uso mk 3.x
    General#chain:srcnat/Connection mark: Link1#Action/Action: src-nat/to addresses:192.168.4.253/to ports: 0-65535



  5. Citação Postado originalmente por lucianogf Ver Post
    vocẽ usou uma interface ethernet para cada link, por que não usou apenas uma para todos os links e um switch?
    O que voces dizem desta sujestão? Não parece mais simples? Funcionaria?






Tópicos Similares

  1. Balanceamento Links Mesmo gateway
    Por felipezatta no fórum Redes
    Respostas: 5
    Último Post: 27-08-2011, 10:45
  2. Balanceamento link dedicado e adsl
    Por MaxAdriano no fórum Redes
    Respostas: 31
    Último Post: 01-09-2009, 22:30
  3. Load balance 2 links perfeito
    Por itnet no fórum Redes
    Respostas: 7
    Último Post: 07-09-2008, 23:06
  4. Respostas: 24
    Último Post: 23-10-2007, 14:04
  5. Balanceamento - Link dedicado e Adsl da BrT
    Por rfm no fórum Servidores de Rede
    Respostas: 2
    Último Post: 23-10-2005, 21:58

Visite: BR-Linux ·  VivaOLinux ·  Dicas-L