sebastiaoitz
(usa Debian)
Enviado em 26/02/2013 - 10:19h
Ola amigos meu primeiro topico aqui na comu espero o apoio de voces.
vou tentar explicar meu problema o mais facil possivel para que alguem possa me ajudar. Tenho uma lanhouse com 10 pcs e 6 clientes que forneco internet.
Eu montei um servidor debian seguindo as instrucoes desse artigo
http://www.vivaolinux.com.br/artigo/Servidor-de-internet-para-iniciantes-%28Debian-Squeeze%29?pagina...
apenas fiz umas modificacoes na hora de configurar o squid pois inseri controle de banda.
Config do pc servidor Processador pentium dual core, 512 de memoria e HD de 80 gb
Minha internet e velox 5mb
modem tplink 8816 roteado ppoe fonercendo ip automatico. Dns Manual 8.8.8.8, 8.8.4.4
versao debian debian-6.0.6-i386-netinst
Minhas config no servidor
Interfaces de rede
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 10.0.0.1
netmask 255.255.255.0
___________________________________________________
# ifconfig
eth0 Link encap: Ethernet Endereco de HW 08:00:27:f6:c4:fb
inet end.: 192.168.1.101 Bcast:192.168.1.255 Masc:255.255.255.0
endereco inet6: fe80::a00:27ff:fef6:c4fb/64 Escopo:Link
UP BROADCASTRUNNING MULTICAST MTU:1500 Metrica:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
colisoes:0 txqueuelen:1000
RX bytes:1797 (1.7 B) TX bytes:1982 (1.9 B)
eth1 Link encap: Ethernet Endereco de HW 08:00:27:8b:28:34
inet end.: 10.0.0.1 Bcast:10.0.0.255 Masc:255.255.255.0
endereco inet6: fe80::a00:27ff:fe8b:2834/64 Escopo:Link
UP BROADCASTRUNNING MULTICAST MTU:1500 Metrica:1
RX packets:11 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
colisoes:0 txqueuelen:1000
RX bytes:2359 (2.3 KiB) TX bytes:510 (510.0 B)
IRQ:9 Endereco de E/S:0xd240
lo Link encap:Loopback Local
inet end.: 127.0.0.1 Masc: 255.0.0.0
endereco inet6: ::1/128 Escopo Maquina
UP LOOPBACKRUNNING MTU:16436 Metrica:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
colisoes:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
_________________________________________________________
DHCP
# nano /etc/dhcp/dhcpd.conf
ddns-update-style none;
log-facility local7;
subnet 10.0.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.125;
option domain-name-servers 192.168.1.1;
option domain-name "mylan.com.br";
option routers 10.0.0.1;
option broadcast-address 255.255.255.255;
default-lease-time 600;
max-lease-time 7200;
}
__________________________________________________________
RESOLV.CONF
nameserver 8.8.8.8
nameserver 8.8.4.4
___________________________________________________________
SQUID
http_port 3128 transparent
visible_hostname servidor
error_directory /usr/share/squid/errors/English
hierarchy_stoplist cgi-bin?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 32 MB
maximum_object_size_in_memory 200 KB
maximum_object_size 512 MB
minimum_object_size 0 KB
ipcache_size 1024
ipcache_low 90
ipcache_high 95
cache_replacement_policy heap LRU
memory_replacement_policy heap LRU
logformat squid %ts.%03tu %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
access_log /var/log/squid/access.log squid
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/spool/squid 5048 16 256
cache_access_log /var/log/squid/access.log #
cache_log /var/log/squid/cache.log
cache_swap_log /var/spool/squid/swap.log
cache_mgr seuemail@seuprovedor.com.br
coredump_dir /var/spool/squid
refresh_pattern ^ftp: 10 20% 2280
refresh_pattern ^gopher: 10 0% 1440
refresh_pattern . 15 20% 2280
# Definicao das ACLs
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl redelocal src 192.168.0.0/24
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80
# Travando micros locais para usaram o proxy
http_access allow localhost
http_access allow redelocal
http_access deny all
_________________________________________________
CONTROLE DE BANDA
# Limitando Largura de banda
acl liberado src "/etc/squid/liberado"
acl limitado src "/etc/squid/limitado"
delay_pools 2
delay_class 1 2
delay_parameters 1 -1/-1 -1/-1
delay_access 1 allow liberado
delay_class 2 2
delay_parameters 2 174762/174762 32768/32768
delay_access 2 allow limitado
_________________________________________
FIREWALL
#!/bin/sh
modprobe iptable_nat
iptables -F
iptables -t nat -F
iptables -X
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 80 -j REDIRECT --to 3128
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
assim esta meu servidor o que eu nao escrevi aqui é porque esta do mesmo jeito no artigo onde peguei as config.
o servidor inicia normal sem erros.
os pcs da rede receberam ip e estavam acessando a internet normal e eu feliz da vida kkkk (primeiro servidor que montei) so que depois de 3 hs + ou - a internet nas estacoes comecou ficar lenta e depois nao entrava e mais nenhum site.
entao espero que alguem possa detectar o erro e me ajudar.