DeMarchi
(usa Debian)
Enviado em 31/05/2008 - 08:26h
Bom dia xD
primeiro post no VOL!
eu to precisando montar um servidor com 4 placas de rede pra compartilhar a internet.
Segue o seguinte contexto:
eth0-Entra o Speedy
eth1-Sai a Net pra Lan House
eth2-Sai Net com 250kbps para uma casa
eth3-Sai Net com 60kbps para outra casa
alguem me ajuda?
to precisando muito disso :'(
eu achei um script na net só q não tá dando certo!!
dêem uma olhada :D
***********************************************
vim /etc/fire.sh
#!/bin/bash
#Contexto (que vc me passou)
#eth0=speedy
#eth1=lan house
#eth2=casa1
#eth3=casa2
# (criei.... vc adequa ai...)
# 192.168.10.0/24 = Rede da Lan
# 192.168.20.0/24 = Rede Casa 1
# 192.168.30.0/24 = Rede Casa 2
#####################################################################
INT_WAN=ppp+ ##### importante isso!!!!!
INT_LAN=eth1
INT_C1=eth2
INT_C2=eth3
REDE_LAN=192.168.10.0/24
REDE_C1=192.168.20.0/24
REDE_C2=192.168.30.0/24
######################################################################
# Carga de Modulos
modprobe iptable_nat
# colocar outros modulos aqui ..... recomendado....
# Limpar regras
iptables -F
iptables -Z
iptables -X
iptables -t nat -F
iptables -t nat -Z
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -Z
iptables -t mangle -X
---------------------------------------------------------------------------------------------
# Politica Padrao
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# Libera Loopback
iptables -A INPUT -i lo -j ACCEPT
# Libera SSH
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
# Libera Resposta para Servidor
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# Libera Net para Lan
iptables -A INPUT -i $INT_LAN -s $REDE_LAN -j ACCEPT
iptables -A FORWARD -i $INT_LAN -s $REDE_LAN -o $INT_WAN -d 0/0 -j ACCEPT
iptables -A FORWARD -o $INT_LAN -d $REDE_LAN -m state --state RELATED,ESTABLISHED -j ACCEPT
# Libera Casa 1
iptables -A INPUT -i $INT_C1 -s $REDE_LAN -j ACCEPT
iptables -A FORWARD -i $INT_C1 -s $REDE_LAN -o $INT_WAN -d 0/0 -j ACCEPT
iptables -A FORWARD -o $INT_C1 -d $REDE_C1 -m state --state RELATED,ESTABLISHED -j ACCEPT
# Libera Casa 2
iptables -A INPUT -i $INT_C2 -s $REDE_C2 -j ACCEPT
iptables -A FORWARD -i $INT_C2 -s $REDE_C2 -o $INT_WAN -d 0/0 -j ACCEPT
iptables -A FORWARD -o $INT_C2 -d $REDE_C2 -m state --state RELATED,ESTABLISHED -j ACCEPT
# Compartilha a Net
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o $INT_WAN -j MASQUERADE
****************************************************
valeu galera, aguardo ajuda aew
flw