jonatams
(usa Debian)
Enviado em 07/11/2012 - 00:59h
Bom sou novato em linux mas configurei um squid e funciona com acesso a internet nas máquinas clientes, bem como no servidor, porém, não consigo acessar uma conta no outlook com o IG portas 465 e 995. Percebi que não tenho conexão com a internet sem o proxy. O que posso fazer? As minhas configurações são as seguintes:
interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth1
#NetworkManager
#iface eth1 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.254.2
netmask 255.255.255.0
broadcast 192.168.254.255
network 192.168.254.0
auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0
gateway 192.168.1.1
------------------------------------------------------------
resolv.conf
search localdomain
nameserver 192.168.1.1
nameserver 192.168.254.2
------------------------------------------------------------
dhcpd.conf
INTERFACES="eth1";
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.254.0 netmask 255.255.255.0{
range 192.168.254.10 192.168.254.50;
option routers 192.168.254.2;
option domain-name-servers 192.168.254.2, 192.168.1.1;
option broadcast-address 192.168.254.255;
}
------------------------------------------------------------
iptables.conf
#!/bin/bash
# Interface da Internet
ifinternet="eth1"
# Interface da Rede Local
iflocal="eth0"
# Mascara de Rede
redemasq=192.168.254.0/24
iniciar(){
modprobe ip_tables
modprobe iptable_nat
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o $iflocal -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED, RELATED -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s $redemasq -o $ifinternet -j MASQUEREDE
iptables -A FORWARD -o $iflocal -m state --state NEW, INVALID -j DROP
iptables -A FORWARD -o $iflocal -m state --state ESTABLISHED, RELATED -j ACCEPT
iptables -A FORWARD -i $iflocal -s $redemasq -j ACCEPT
iptables -t nat -A PREROUTING -i $ifinternet -p tcp 0/0 -m multiport --dport 465,995 -j DNAT 192.168.254.10
iptables -A FORWARD -i $ifinternet -p tcp -d 192.168.254.10 -m multiport --dport 465,995 -j ACCEPT
iptables -A FORWARD -p tcp -m multport --dport 465,995 -j ACCEPT
iptables -A FORWARD -p udp -m multport --dport 53,465,995 -j ACCEPT
iptables -A FORWARD -p tcp -m multport --sport 465,995 -j ACCEPT
iptables -A FORWARD -p udp -m multport --sport 53,465,995 -j ACCEPT
# Redirecionando para a porta do squid
iptables -t nat -A PREROUTING -i $ifinternet -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp -dport 1863 -j ACCEPT
iptables -A INPUT -p tcp -dport 443 -j ACCEPT
iptables -A INPUT -p tcp --syn -j DROP
}
parar(){
iptables -F
iptables -F -t nat
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
}
case "$1" in
start)
echo "iniciar compartilhamento";;
stop)
echo "parar compartilhamento";;
restart)
echo "parar iniciar";;
*) echo "Use os parâmetros stat ou stop"
esac
------------------------------------------------------------
squid.conf
http_port 3128
visible_hostname aereotur-net
error_directory /usr/share/squid/errors/Portuguese
cache_mem 512 MB
maximum_object_size_in_memory 128 KB
maximum_object_size 512 MB
#minimum_object_size 0 KB
cache_swap_low 85
cache_swap_high 95
cache_dir ufs /var/spool/squid 5120 16 256
cache_access_log /var/log/squid/access.log
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280
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 SSL_ports port 443 563
acl Safe_ports port 21 22 53 80 443 465 995 563 70 210 280 488 1025-65535
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl libera_email url_regex -i "/etc/squid/libera_email"
http_access allow libera_email
acl bloqueados url_regex -i "/etc/squid/bloqueados"
http_access deny bloqueados
acl palavrasproibidas url_regex -i "/etc/squid/palavrasproibidas"
http_access deny palavrasproibidas
acl redelocal src 192.168.254.0/24
http_access allow localhost
http_access allow redelocal
http_access deny all
"/etc/squid/squid.conf" 38 lines, 1245 characters
Fico no aguardo de orientações.
At. Jônatas