nene_guitar
(usa openSUSE)
Enviado em 16/07/2013 - 00:25h
boa noite.
cara realmente acho que voce nao leu o post...
antes de sair dando pedradas...
mais uma vez...
configuraçoes de rede
eth0 (internet ADSL oi 10.1.1.1)
eth1 (rede local 192.168.1.254)
segue arquivos de configuração
iptables
etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Sun Jul 14 06:28:49 2013
*mangle
:PREROUTING ACCEPT [7870:5552182]
:INPUT ACCEPT [7866:5551617]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [9050:4884061]
:POSTROUTING ACCEPT [9050:4884061]
COMMIT
# Completed on Sun Jul 14 06:28:49 2013
# Generated by iptables-save v1.4.7 on Sun Jul 14 06:28:49 2013
*filter
:INPUT DROP [12:594]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [9050:4884061]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -m limit --limit 1/sec -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 0 -m limit --limit 1/sec -j DROP
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i eth1 -p tcp -m tcp --dport 3128 -j ACCEPT
-A INPUT -i eth1 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i eth1 -p tcp -m tcp --dport 21 -j ACCEPT
-A INPUT -i eth1 -p tcp -m tcp --dport 123 -j ACCEPT
-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
COMMIT
# Completed on Sun Jul 14 06:28:49 2013
# Generated by iptables-save v1.4.7 on Sun Jul 14 06:28:49 2013
*nat
:PREROUTING ACCEPT [184:9987]
:POSTROUTING ACCEPT [2:120]
:OUTPUT ACCEPT [258:15609]
-A PREROUTING -s 10.0.0.0/8 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
-A POSTROUTING -o eth1 -j MASQUERADE
-A POSTROUTING -s 10.0.0.0/8 -o eth0 -j MASQUERADE
COMMIT
# Completed on Sun Jul 14 06:28:49 2013
obs. nao sei de onde ele tirou essas regras.
##################################################
segue squid.conf
squid.conf
http_port 3128 transparent (jatentei intercept)
visible_hostname pxy.br
acl lan src 192.168.1.0/24
http_access allow lan
(ja fiz so com essas linhas para testes)
ja usei o padrão
e fiz as alterações conforme postei no video do inicio do post...
###################################################
o por ultimo
etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
sh /usr/local/bin/squidfw.sh (criei esse arquivo)
chmod +x /usr/local/bin/squidfw.sh
#####################################################
e aqui o direcionamento
/usr/local/bin/squidfw.sh
# Limite contra ping da morte e DoS
iptables -A INPUT -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-reply -m limit --limit 1/s -j DROP
# Liberando portas SSH a partir de qualquer interface
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
# Liberando portas squid, http e NTP.
iptables -A INPUT -p tcp --dport 3128 -i eth1 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -i eth1 -j ACCEPT
iptables -A INPUT -p tcp --dport 21 -i eth1 -j ACCEPT
iptables -A INPUT -p tcp --dport 123 -i eth1 -j ACCEPT
iptables -A INPUT -p udp --dport 123 -i eth1 -j ACCEPT
# Nat Global
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# NAT Rede
iptables -t nat -A POSTROUTING -s 10.1.1.0/255.0.0.0 -o eth0 -j MASQUERADE
# Jogando tráfego da porta 80 para o SQUID3 TRANSPARENT
iptables -t nat -A PREROUTING -s 10.1.1.0/255.0.0.0 -p tcp --dport 80 -j REDIRECT --to-port 3128
squid -v
root@upload jarce]# squid -v
Squid Cache: Version 3.1.10
configure options: '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i686-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-internal-dns' '--disable-strict-error-checking' '--exec_prefix=/usr' '--libexecdir=/usr/lib/squid' '--localstatedir=/var' '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid' '--with-logdir=$(localstatedir)/log/squid' '--with-pidfile=$(localstatedir)/run/squid.pid' '--disable-dependency-tracking' '--enable-arp-acl' '--enable-follow-x-forwarded-for' '--enable-auth=basic,digest,ntlm,negotiate' '--enable-basic-auth-helpers=LDAP,MSNT,NCSA,PAM,SMB,YP,getpwnam,multi-domain-NTLM,SASL,DB,POP3,squid_radius_auth' '--enable-ntlm-auth-helpers=smb_lm,no_check,fakeauth' '--enable-digest-auth-helpers=password,ldap,eDirectory' '--enable-negotiate-auth-helpers=squid_kerb_auth' '--enable-external-acl-helpers=ip_user,ldap_group,session,unix_group,wbinfo_group' '--enable-cache-digests' '--enable-cachemgr-hostname=localhost' '--enable-delay-pools' '--enable-epoll' '--enable-icap-client' '--enable-ident-lookups' '--with-large-files' '--enable-linux-netfilter' '--enable-referer-log' '--enable-removal-policies=heap,lru' '--enable-snmp' '--enable-ssl' '--enable-storeio=aufs,diskd,ufs' '--enable-useragent-log' '--enable-wccpv2' '--enable-esi' '--with-aio' '--with-default-user=squid' '--with-filedescriptors=16384' '--with-dl' '--with-openssl' '--with-pthreads' 'build_alias=i386-redhat-linux-gnu' 'host_alias=i386-redhat-linux-gnu' 'target_alias=i686-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -fpie' 'LDFLAGS=-pie' 'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -fpie' --with-squid=/builddir/build/BUILD/squid-3.1.10
obrigado por enquanto