+ Responder ao Tópico



  1. #1

    Padrão Balanceamento

    Gente, atualmente possuo 2 link velox de 1mb, mais só um está sendo usado no mikrotik. Gostaria de saber se é possivel fazer um balance com os dois link's da seguinte forma. Supondo que eu tena 50 clientes, que a cada um deles que fosse logando no HOTSPOT fosse direcionado para um dos link. Ex: Cliente João logou no hostpot usando o link1, Maria logou no hotspot e foi direcionada para o link2, e assim por diante.

    É possivel fazer desta forma ? Se não fui claro na explicação, postem que tentarei ser mais claro.


    Grato, Dennis Rezende

  2. #2

    Padrão

    eu tenho algo semelhante a isto mas é com ip X mac, se for igual eu te passo por aqui...só verifica se é igual.

  3. #3

    Padrão Balanceamento

    Olá Anderson.
    Sou novato em mikrotik e tenho problemas com balanceamento.
    É possivel você me enviar um script de balanceamento igual ao solicitado pelo Dennis Resende?
    Tenho dois link´s e um fica ocioso. Gostaria que ao se conectar um cliente saisse por um dos link´s e o próximo saisse por outro e assim sucessivamente.
    Agradeço primeiro pela oportunidade de postar e também se for possivel emplementar esta solução em meu servidor.
    Obrigado

    Giovani

  4. #4

    Padrão

    Citação Postado originalmente por scinfovirtual Ver Post
    eu tenho algo semelhante a isto mas é com ip X mac, se for igual eu te passo por aqui...só verifica se é igual.
    Sim, o uso do hotspot foi só para tentar explicar 'melhor'. Mas ipxmac vai me ser bem útil tb.

    Obrigado

  5. #5

    Padrão

    tem no forum balanceamento PCC
    https://under-linux.org/f131343-pcc-...links-por-m4d3
    https://under-linux.org/f128610-pcc
    estou usando esta perfeito,so tem que ter uma rb so para o balanceamento.

  6. #6

    Padrão

    segue a forma que eu ja usei aqui, que é assim....um cliente conecta vai para o link 1 outro conecta vai para o link 2, outro link1, outro link2, e assim sucessivamente....

    / ip firewall mangle
    add chain=prerouting in-interface=Saida src-address-list=link1 \
    action=mark-connection new-connection-mark=link1 passthrough=yes \
    comment="" disabled=no
    add chain=prerouting in-interface=Saida src-address-list=link1 \
    action=mark-routing new-routing-mark=link1 passthrough=no comment="" \
    disabled=no
    add chain=prerouting in-interface=Saida src-address-list=link2 \
    action=mark-connection new-connection-mark=link2 passthrough=yes \
    comment="" disabled=no
    add chain=prerouting in-interface=Saida src-address-list=link2 \
    action=mark-routing new-routing-mark=link2 passthrough=no comment="" \
    disabled=no
    add chain=prerouting in-interface=Saida connection-state=new nth=1,1,0 \
    action=mark-connection new-connection-mark=link1 passthrough=yes \
    comment="" disabled=no
    add chain=prerouting in-interface=Saida src-address=192.168.0.0/16 \
    connection-mark=link1 action=add-src-to-address-list address-list=link1 \
    address-list-timeout=1d comment="" disabled=no
    add chain=prerouting in-interface=Saida connection-mark=link1 \
    action=mark-routing new-routing-mark=link1 passthrough=no comment="" \
    disabled=no
    add chain=prerouting in-interface=Saida connection-state=new nth=1,1,1 \
    action=mark-connection new-connection-mark=link2 passthrough=yes \
    comment="" disabled=no
    add chain=prerouting in-interface=Saida src-address=192.168.0.0/16 \
    connection-mark=link2 action=add-src-to-address-list address-list=link2 \
    address-list-timeout=1d comment="" disabled=no
    add chain=prerouting in-interface=Saida connection-mark=link2 \
    action=mark-routing new-routing-mark=link2 passthrough=no comment="" \
    disabled=no


    / ip firewall nat
    add chain=srcnat connection-mark=link1 action=src-nat \
    to-addresses=192.168.5.103 to-ports=0-65535 comment="" disabled=no
    add chain=srcnat connection-mark=link2 action=src-nat \
    to-addresses=192.168.4.103 to-ports=0-65535 comment="" disabled=no



    / ip route
    add dst-address=0.0.0.0/0 gateway=192.168.5.254 scope=255 target-scope=10 \
    comment="ROTA PADRAO" disabled=no
    add dst-address=0.0.0.0/0 gateway=192.168.5.254 scope=255 target-scope=10 \
    routing-mark=link1 comment="" disabled=no
    add dst-address=0.0.0.0/0 gateway=192.168.4.254 scope=255 target-scope=10 \
    routing-mark=link2 comment="" disabled=no

    abração....

    Kildare....receita de bolo vai ser dificel vc encontrar aqui amigo...mas use a ferramenta pesquisar que vc vai encontrar oque precisa....pode se basear tbm nestas regras que enviei ai....
    Última edição por scinfovirtual; 21-11-2009 às 22:02.

  7. #7

    Padrão

    Citação Postado originalmente por scinfovirtual Ver Post
    segue a forma que eu ja usei aqui, que é assim....um cliente conecta vai para o link 1 outro conecta vai para o link 2, outro link1, outro link2, e assim sucessivamente....

    / ip firewall mangle
    add chain=prerouting in-interface=Saida src-address-list=link1 \
    action=mark-connection new-connection-mark=link1 passthrough=yes \
    comment="" disabled=no
    add chain=prerouting in-interface=Saida src-address-list=link1 \
    action=mark-routing new-routing-mark=link1 passthrough=no comment="" \
    disabled=no
    add chain=prerouting in-interface=Saida src-address-list=link2 \
    action=mark-connection new-connection-mark=link2 passthrough=yes \
    comment="" disabled=no
    add chain=prerouting in-interface=Saida src-address-list=link2 \
    action=mark-routing new-routing-mark=link2 passthrough=no comment="" \
    disabled=no
    add chain=prerouting in-interface=Saida connection-state=new nth=1,1,0 \
    action=mark-connection new-connection-mark=link1 passthrough=yes \
    comment="" disabled=no
    add chain=prerouting in-interface=Saida src-address=192.168.0.0/16 \
    connection-mark=link1 action=add-src-to-address-list address-list=link1 \
    address-list-timeout=1d comment="" disabled=no
    add chain=prerouting in-interface=Saida connection-mark=link1 \
    action=mark-routing new-routing-mark=link1 passthrough=no comment="" \
    disabled=no
    add chain=prerouting in-interface=Saida connection-state=new nth=1,1,1 \
    action=mark-connection new-connection-mark=link2 passthrough=yes \
    comment="" disabled=no
    add chain=prerouting in-interface=Saida src-address=192.168.0.0/16 \
    connection-mark=link2 action=add-src-to-address-list address-list=link2 \
    address-list-timeout=1d comment="" disabled=no
    add chain=prerouting in-interface=Saida connection-mark=link2 \
    action=mark-routing new-routing-mark=link2 passthrough=no comment="" \
    disabled=no


    / ip firewall nat
    add chain=srcnat connection-mark=link1 action=src-nat \
    to-addresses=192.168.5.103 to-ports=0-65535 comment="" disabled=no
    add chain=srcnat connection-mark=link2 action=src-nat \
    to-addresses=192.168.4.103 to-ports=0-65535 comment="" disabled=no



    / ip route
    add dst-address=0.0.0.0/0 gateway=192.168.5.254 scope=255 target-scope=10 \
    comment="ROTA PADRAO" disabled=no
    add dst-address=0.0.0.0/0 gateway=192.168.5.254 scope=255 target-scope=10 \
    routing-mark=link1 comment="" disabled=no
    add dst-address=0.0.0.0/0 gateway=192.168.4.254 scope=255 target-scope=10 \
    routing-mark=link2 comment="" disabled=no

    abração....

    Kildare....receita de bolo vai ser dificel vc encontrar aqui amigo...mas use a ferramenta pesquisar que vc vai encontrar oque precisa....pode se basear tbm nestas regras que enviei ai....

    Amigo, no caso aqui do src-address-list=link1 , vou cadastrar os gateway's do link1 e 2 no adress list correto ?

  8. #8
    g.kildare
    Visitante

    Thumbs up Balanceamento

    Legal Junior

    Muito obrigado. É isto mesmo que preciso
    Tomara que este espaço possa contar com pessoas que como você, contribui com o conhecimento do próximo. Valeu.

  9. #9

    Padrão

    Oi Zau eu gostaria de saber como formatar um pc pq o meu entrou vírus.

    Laura!

  10. #10

    Padrão Simples e Funcional

    Ótimo!
    simples e Funcional.
    Justamente o que muita gente precisa!
    Como não sou o primeiro e não vou ser o ultimo a usar vários links simultaneos e preciso dividir uma quantidade de clientes entro links diferentes, atualmente utilizo um servidor em cada link mas com esse código vou poder usar o mesmo servidor para dividir os links entre os clientes.
    Gostaria de sua ajuda pois tentei configurar mais de 2 link e não consegui, quando coloco uma terceira configuracao ele usa a rota do link 2. segue codigo modificado!

    / ip firewall mangle

    add chain=prerouting in-interface=clientes1 src-address-list=link1 action=mark-connection new-connection-mark=link1 passthrough=yes comment="balanceamento de links" disabled=no
    add chain=prerouting in-interface=clientes1 src-address-list=link1 action=mark-routing new-routing-mark=link1 passthrough=no comment="" disabled=no
    add chain=prerouting in-interface=clientes1 src-address-list=link2 action=mark-connection new-connection-mark=link2 passthrough=yes comment="" disabled=no
    add chain=prerouting in-interface=clientes1 src-address-list=link2 action=mark-routing new-routing-mark=link2 passthrough=no comment="" disabled=no
    add chain=prerouting in-interface=clientes1 src-address-list=link3 action=mark-connection new-connection-mark=link3 passthrough=yes comment="" disabled=no
    add chain=prerouting in-interface=clientes1 src-address-list=link3 action=mark-routing new-routing-mark=link3 passthrough=no comment="" disabled=no

    add chain=prerouting in-interface=clientes1 connection-state=new nth=1,1,0 action=mark-connection new-connection-mark=link1 passthrough=yes comment="balanceamento de ips" disabled=no
    add chain=prerouting in-interface=clientes1 src-address=172.1.1.0/24 connection-mark=link1 action=add-src-to-address-list address-list=link1 address-list-timeout=1d comment="" disabled=no
    add chain=prerouting in-interface=clientes1 connection-mark=link1 action=mark-routing new-routing-mark=link1 passthrough=no comment="" disabled=no
    add chain=prerouting in-interface=clientes1 connection-state=new nth=1,1,1 action=mark-connection new-connection-mark=link2 passthrough=yes comment="" disabled=no
    add chain=prerouting in-interface=clientes1 src-address=172.2.1.0/24 connection-mark=link2 action=add-src-to-address-list address-list=link2 address-list-timeout=1d comment="" disabled=no
    add chain=prerouting in-interface=clientes1 connection-mark=link2 action=mark-routing new-routing-mark=link2 passthrough=no comment="" disabled=no

    add chain=prerouting in-interface=clientes1 connection-state=new nth=1,1,3 action=mark-connection new-connection-mark=link3 passthrough=yes comment="" disabled=no
    add chain=prerouting in-interface=clientes1 src-address=172.3.1.0/24 connection-mark=link3 action=add-src-to-address-list address-list=link3 address-list-timeout=1d comment="" disabled=no
    add chain=prerouting in-interface=clientes1 connection-mark=link3 action=mark-routing new-routing-mark=link3 passthrough=no comment="" disabled=no

    / ip firewall nat
    add chain=srcnat connection-mark=link1 action=src-nat to-addresses=10.254.221.3 to-ports=0-65535 comment="balanceamento de links" disabled=no
    add chain=srcnat connection-mark=link2 action=src-nat to-addresses=10.254.222.3 to-ports=0-65535 comment="" disabled=no
    add chain=srcnat connection-mark=link3 action=src-nat to-addresses=10.254.230.3 to-ports=0-65535 comment="" disabled=no

    / ip route
    add dst-address=0.0.0.0/0 gateway=10.254.221.1 scope=255 target-scope=10 comment="link-default" disabled=no
    add dst-address=0.0.0.0/0 gateway=10.254.221.1 scope=255 target-scope=10 routing-mark=link1 comment="" disabled=no
    add dst-address=0.0.0.0/0 gateway=10.254.222.1 scope=255 target-scope=10 routing-mark=link2 comment="" disabled=no
    add dst-address=0.0.0.0/0 gateway=10.254.230.1 scope=255 target-scope=10 routing-mark=link3 comment="" disabled=no

    Aguardo,

    Luciano Santos


    Citação Postado originalmente por scinfovirtual Ver Post
    segue a forma que eu ja usei aqui, que é assim....um cliente conecta vai para o link 1 outro conecta vai para o link 2, outro link1, outro link2, e assim sucessivamente....

    / ip firewall mangle
    add chain=prerouting in-interface=Saida src-address-list=link1 \
    action=mark-connection new-connection-mark=link1 passthrough=yes \
    comment="" disabled=no
    add chain=prerouting in-interface=Saida src-address-list=link1 \
    action=mark-routing new-routing-mark=link1 passthrough=no comment="" \
    disabled=no
    add chain=prerouting in-interface=Saida src-address-list=link2 \
    action=mark-connection new-connection-mark=link2 passthrough=yes \
    comment="" disabled=no
    add chain=prerouting in-interface=Saida src-address-list=link2 \
    action=mark-routing new-routing-mark=link2 passthrough=no comment="" \
    disabled=no
    add chain=prerouting in-interface=Saida connection-state=new nth=1,1,0 \
    action=mark-connection new-connection-mark=link1 passthrough=yes \
    comment="" disabled=no
    add chain=prerouting in-interface=Saida src-address=192.168.0.0/16 \
    connection-mark=link1 action=add-src-to-address-list address-list=link1 \
    address-list-timeout=1d comment="" disabled=no
    add chain=prerouting in-interface=Saida connection-mark=link1 \
    action=mark-routing new-routing-mark=link1 passthrough=no comment="" \
    disabled=no
    add chain=prerouting in-interface=Saida connection-state=new nth=1,1,1 \
    action=mark-connection new-connection-mark=link2 passthrough=yes \
    comment="" disabled=no
    add chain=prerouting in-interface=Saida src-address=192.168.0.0/16 \
    connection-mark=link2 action=add-src-to-address-list address-list=link2 \
    address-list-timeout=1d comment="" disabled=no
    add chain=prerouting in-interface=Saida connection-mark=link2 \
    action=mark-routing new-routing-mark=link2 passthrough=no comment="" \
    disabled=no


    / ip firewall nat
    add chain=srcnat connection-mark=link1 action=src-nat \
    to-addresses=192.168.5.103 to-ports=0-65535 comment="" disabled=no
    add chain=srcnat connection-mark=link2 action=src-nat \
    to-addresses=192.168.4.103 to-ports=0-65535 comment="" disabled=no



    / ip route
    add dst-address=0.0.0.0/0 gateway=192.168.5.254 scope=255 target-scope=10 \
    comment="ROTA PADRAO" disabled=no
    add dst-address=0.0.0.0/0 gateway=192.168.5.254 scope=255 target-scope=10 \
    routing-mark=link1 comment="" disabled=no
    add dst-address=0.0.0.0/0 gateway=192.168.4.254 scope=255 target-scope=10 \
    routing-mark=link2 comment="" disabled=no

    abração....

    Kildare....receita de bolo vai ser dificel vc encontrar aqui amigo...mas use a ferramenta pesquisar que vc vai encontrar oque precisa....pode se basear tbm nestas regras que enviei ai....