COMPARTIR INTERNET SQUID transparente+IPTABLES
Publicado por luiyi (85 intervenciones) el 06/01/2005 21:52:18
He leido manuales, howtos, todo...y esto esta al toque...no se puede pedir mas, es mas antes funcionaba y solo fue de cambiar de lugar la maquina y ahora, ya no hay transparencia...AYUDA!!!! me voy a volver LOCO!!
He caido en un problema terrible. Antes, teniamos acá una máquina Windows al frente de la empresa, y esta con el Internet Connection Sharing, entregaba internet al que pronto sería nuestro servidor Fedora2. Esta cadenita, entregaba internet al resto de las terminales por medio de una configuración de squid transparente y una regla de PREROUTING en iptables y funcionaba rebien. Pues bien, la maquina Windows fue echada a los LEONES (gracias a DIos) pero ahora que el servidor suplantó a la Windows y con los cambios pertinentes en la conexión a internet, la transparencia se perdió. Aún con la misma configuracion que antes entregaba internet a las terminales esto ya no funciona; únicamente funciona (Ahora) si voy a poner el proxy manualmente (cosa que no es lo que busco). No logro solucionar. Leí por acá en el sitio una regla que usa el echo 1 > /proc/sys/net/ipv4/ip_forward para habilitar internet con el NAT, pues que lo he implementado y tampoco tengo acceso a internet en las pcs. He deshabilitado squid por completo con el fin de probar solo el NAT con iptables y tampoco funciona (y en otra FC2 en que lo implementé si funciona) hice esto en rc.local:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables --flush
iptables --table nat --flush
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
modprobe iptable_nat
y acá sigue sin funcionar. Mi configuración anterior con la que todo funcionaba (pero con la maquina windows al frente seguido por el preservidor FC2 y la LAN obteniendo internet del FC2) para transparencia de squid.conf es esta:
http_port 3128
#http_port 80
#http_port 8080
icp_port 3130
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 8 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
cache_dir ufs /var/spool/squid 100 16 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
mime_table /etc/squid/mime.conf
client_netmask 255.255.255.0
ftp_user [email protected]
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
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 red_local src 192.168.0.0/255.255.255.0
acl to_localhost dst 127.0.0.0/8
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 CONNECT method CONNECT
# Only allow cachemgr access from localhost
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 allow our_networks
http_access allow red_local
# And finally deny all other access to this proxy
http_access deny all
http_reply_access allow all
icp_access allow all
maximum_object_size 3000 KB
store_avg_object_size 50 KB
cache_mgr [email protected]
httpd_accel_port 80
httpd_accel_host virtual
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
coredump_dir /var/lib/squid/cache
offline_mode on
ie_refresh on
acl magic_words1 url_regex -i 192.168
acl magic_words2 url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .rpm .zip .ram .rm .iso .raw .wav .mov
delay_pools 2
delay_class 1 2
delay_parameters 1 -1/-1 -1/-1
delay_access 1 allow magic_words1
delay_class 2 2
delay_parameters 2 9000/150000 9000/120000
delay_access 2 allow magic_words2
La configuración que habia en iptables cuando todo funcionaba era: (sigue en el siguiente mensaje....era muy largo....)
He caido en un problema terrible. Antes, teniamos acá una máquina Windows al frente de la empresa, y esta con el Internet Connection Sharing, entregaba internet al que pronto sería nuestro servidor Fedora2. Esta cadenita, entregaba internet al resto de las terminales por medio de una configuración de squid transparente y una regla de PREROUTING en iptables y funcionaba rebien. Pues bien, la maquina Windows fue echada a los LEONES (gracias a DIos) pero ahora que el servidor suplantó a la Windows y con los cambios pertinentes en la conexión a internet, la transparencia se perdió. Aún con la misma configuracion que antes entregaba internet a las terminales esto ya no funciona; únicamente funciona (Ahora) si voy a poner el proxy manualmente (cosa que no es lo que busco). No logro solucionar. Leí por acá en el sitio una regla que usa el echo 1 > /proc/sys/net/ipv4/ip_forward para habilitar internet con el NAT, pues que lo he implementado y tampoco tengo acceso a internet en las pcs. He deshabilitado squid por completo con el fin de probar solo el NAT con iptables y tampoco funciona (y en otra FC2 en que lo implementé si funciona) hice esto en rc.local:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables --flush
iptables --table nat --flush
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
modprobe iptable_nat
y acá sigue sin funcionar. Mi configuración anterior con la que todo funcionaba (pero con la maquina windows al frente seguido por el preservidor FC2 y la LAN obteniendo internet del FC2) para transparencia de squid.conf es esta:
http_port 3128
#http_port 80
#http_port 8080
icp_port 3130
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 8 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
cache_dir ufs /var/spool/squid 100 16 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
mime_table /etc/squid/mime.conf
client_netmask 255.255.255.0
ftp_user [email protected]
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
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 red_local src 192.168.0.0/255.255.255.0
acl to_localhost dst 127.0.0.0/8
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 CONNECT method CONNECT
# Only allow cachemgr access from localhost
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 allow our_networks
http_access allow red_local
# And finally deny all other access to this proxy
http_access deny all
http_reply_access allow all
icp_access allow all
maximum_object_size 3000 KB
store_avg_object_size 50 KB
cache_mgr [email protected]
httpd_accel_port 80
httpd_accel_host virtual
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
coredump_dir /var/lib/squid/cache
offline_mode on
ie_refresh on
acl magic_words1 url_regex -i 192.168
acl magic_words2 url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .rpm .zip .ram .rm .iso .raw .wav .mov
delay_pools 2
delay_class 1 2
delay_parameters 1 -1/-1 -1/-1
delay_access 1 allow magic_words1
delay_class 2 2
delay_parameters 2 9000/150000 9000/120000
delay_access 2 allow magic_words2
La configuración que habia en iptables cuando todo funcionaba era: (sigue en el siguiente mensaje....era muy largo....)
Valora esta pregunta


0