Visite: BR-Linux ·  VivaOLinux ·  Dicas-L


Página 3 de 4 PrimeiroPrimeiro 1234 ÚltimoÚltimo
+ Responder ao Tópico

  1. bem pessoal para ver se esta certo vou colocar meu scripts aqui para ver o que acham ok


    #!/bin/bash

    #link1
    ip route flush table link1
    ip route add default via 192.168.15.2 table link1
    ip route add 127.0.0.0/8 dev lo table link1
    ip route add 192.168.15.0/24 dev eth0 table link1
    ip route add 192.168.18.0/24 dev eth1 table link1
    ip route add 192.168.20.0/24 dev eth1 table link1
    ip route add 192.168.21.0/24 dev eth1 table link1
    ip route add 192.168.55.0/24 dev eth2 table link1
    ip route add 192.168.22.0/24 dev eth1 table link1

    #link2
    ip route flush table link2
    ip route add default via 192.168.15.10 table link2
    ip route add 127.0.0.0/8 dev lo table link2
    ip route add 192.168.15.0/24 dev eth0 table link2
    ip route add 192.168.18.0/24 dev eth1 table link2
    ip route add 192.168.20.0/24 dev eth1 table link2
    ip route add 192.168.21.0/24 dev eth1 table link2
    ip route add 192.168.55.0/24 dev eth2 table link2
    ip route add 192.168.22.0/24 dev eth1 table link2

    #link3
    ip route flush table link3
    ip route add default via 192.168.15.6 table link3
    ip route add 127.0.0.0/8 dev lo table link3
    ip route add 192.168.15.0/24 dev eth0 table link3
    ip route add 192.168.18.0/24 dev eth1 table link3
    ip route add 192.168.20.0/24 dev eth1 table link3
    ip route add 192.168.21.0/24 dev eth1 table link3
    ip route add 192.168.55.0/24 dev eth2 table link3
    ip route add 192.168.22.0/24 dev eth1 table link3


    #distribuicao do trafego
    ip rule del from 192.168.20.0/25
    ip rule del from 192.168.20.128/25
    ip rule del from 192.168.21.0/26
    ip rule del from 192.168.21.64/26
    ip rule del from 192.168.21.128/25
    ip rule del from 192.168.22.0/26
    ip rule del from 192.168.22.64/26
    ip rule del from 192.168.128/25
    ip rule add from 192.168.20.0/25 lookup link1
    ip rule add from 192.168.21.64/26 lookup link1
    ip rule add from 192.168.20.128/25 lookup link2
    ip rule add from 192.168.21.0/26 lookup link2
    ip rule add from 192.168.21.128/25 lookup link3
    ip rule add from 192.168.55.2 lookup link3
    ip rule add from 192.168.22.0/25 lookup link1
    ip rule add from 192.168.22.64/26 lookup link2
    ip rule add from 192.168.22.128/26 lookup link3

    ip route del default
    ip route add default via 192.168.15.6

    ip route flush cache


    Os link 15.2, 15.10 e 15.6 sao os modens adsl em modo router


  2.    Publicidade


  3. essa foi a configuração que herdei do ex-administrador daqui, deem uma olhada e vejam o que tem de errado por favor

  4. Ola.

    Vou colocar aqui os scripts que tenho funcionando aqui 2 links utilizando iproute2. Basta alterar conforme suas necessidades

    Primeiro crie as tabelas em:

    joe /etc/iproute2/rt_tables

    200 link
    201 adsl

    Depois so executar os scripts:

    ---- adsl.sh ---- no caso usuarios que sairão pela ADSL...


    echo "--- Setando trafego pela ADSL ---"
    iptables -t nat -F
    iptables -t nat -P PREROUTING ACCEPT
    iptables -t nat -P POSTROUTING ACCEPT
    iptables -t nat -P OUTPUT ACCEPT

    insmod ip_conntrack_ftp
    insmod ip_nat_ftp

    ip route add default table adsl via 10.42.42.1 dev eth2
    ip route flush cache

    #### EVANDRO #####
    iptables -t nat -A POSTROUTING -s 192.168.1.43 -j MASQUERADE -o eth2
    ip rule add from 192.168.1.43 table adsl
    ip route flush cache

    #### TECNICA #####
    iptables -t nat -A POSTROUTING -s 192.168.1.44 -j MASQUERADE -o eth2
    ip rule add from 192.168.1.44 table adsl
    ip route flush cache

    ... entre outros ....


    ---- link.sh ---- no caso usuarios que sairão pelo LINK...

    echo "--- Setando trafego pelo LINK ---"

    ip route add default table link via 200.XXX.XXX.XXX dev eth0
    ip route flush cache

    #### PAPITO #####
    iptables -t nat -A POSTROUTING -s 192.168.1.40 -j MASQUERADE -o eth0
    ip rule add from 192.168.1.40 table link
    ip route flush cache

    #### MICHELE #####
    iptables -t nat -A POSTROUTING -s 192.168.1.41 -j MASQUERADE -o eth0
    ip rule add from 192.168.1.41 table link
    ip route flush cache

    ..entre outros usuarios....

    -----------------
    Batata.. ta funcionando legal... com 3 ou mais links e na mesma lógica...

    Espero ter ajudado

    t+

  5. sim quanto a isso tudo bem, ajuda, mas o meu problema e como setar todo um range de usuario tipo dividir um subnet em 3 ranges diferentes

    1 de 192.168.22.0 a 192.168.22.64 - link1
    2 de 192.168.22.65 a 192.168.22.128 - link2
    3 de 192.168.22.129 a 192.168.22.250 - link3

  6. Ola.

    Meu, ou vc "subneta" a rede em redes menores ou entaum faz um, por um..

    t+


  7.    Publicidade