Alan_MMW
(usa Slackware)
Enviado em 20/12/2007 - 12:37h
esse aki é meu rc.local:
#!/bin/sh
#Configuração do compartilhamento da internet
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo 0 > /proc/sys/net/ipv4/tcp_ecn
echo 0 > /proc/sys/net/ipv4/tcp_timestamps
echo 1 > /proc/sys/net/ipv4/ip_forward
ifconfig eth1 192.168.1.1 netmask 255.255.255.0 up
echo "Ativando Rede e Compartilhamento de internet..."
echo "....................................[OK]"
#iptables -t nat -A POSTROUTING -s 192.168.1.39 -p tcp --dport 1863 -j MASQUERADE
iptables -A FORWARD -s 192.168.1.39/24 -p tcp --dport 1863 -j ACCEPT
iptables -A FORWARD -s 192.168.1.39/24 -d loginnet.passport.com -j ACCEPT
iptables -A FORWARD -s 192.168.1.0/24 -p tcp --dport 1863 -j REJECT
iptables -A FORWARD -s 192.168.1.0/24 -d loginnet.passport.com -j REJECT
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 1863 -j REDIRECT --to-port 80
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -P POSTROUTING DROP
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT
/usr/local/squid/bin/RunCache &
agora meu squid.conf :
http_port 192.168.1.0:3128
icp_port 3130
#porta 3128
cache_dir diskd /usr/local/squid/cache/ 256 16 256 Q1=64 Q2=72
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 60 MB
cache_swap_low 30
cache_swap_high 50
maximum_object_size 500 MB
request_body_max_size 120 MB
emulate_httpd_log on
visible_hostname NetServer
client_netmask 255.255.255.0
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.0.0.0
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 1863 # Porta do Msn
acl CONNECT method CONNECT
http_access allow localhost
acl rej_URL_SCR url_regex *.SCR$
http_access deny rej_URL_SCR
acl proibir_sites dstdom_regex "/usr/local/squid/etc/bloqueio/palavra"
http_access deny proibir_sites
acl liberado src 192.168.1.39
http_access allow liberado
acl liberado src 192.168.1.159
http_access allow liberado
acl liberado src 192.168.1.30
http_access allow liberado
acl proibir_palavras dstdom_regex "/usr/local/squid/etc/bloqueio/url"
http_access deny proibir_palavras
acl msn url_regex -i /gateway/gateway.dll
http_access deny msn
acl localnet src 192.168.1.0/255.255.255.0
delay_pools 1
delay_class 1 2
delay_parameters 1 114688/114688 16384/16384
delay 1 allow localnet
http_access allow localnet
http_access allow manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
http_access deny all
icp_access deny all
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
olha eu uso um link dedicado, talvez isso tenha algo a ver, porque eh outra faixa de ip
mas, dêem uma lhada ae....