Squid - jak wykluczy

Konfiguracja serwerów, usług, itp.
nero.ps
Posty: 10
Rejestracja: 02 kwietnia 2012, 10:53

Squid - jak wykluczyć z przekierowania port ssl

Post autor: nero.ps »

Witam.

C
hciałbym zapytać się o to jak można wykluczyć port 443 ze skanowania go przez squida. Problem jest tego typu, że mam dostęp do stron https jednak czasami nie mogę wysłać jakiegoś załącznika. Podobnie z programami, które przekazują sobie dane przez port 443 a w logach mam tylko tyle, że jest nieprawidłowy nagłówek.

System Debian 6.0.4, squid 2.7

Przekierowanie na squida wygląda tak:

Kod: Zaznacz cały

iptables -t nat -A PREROUTING -s 192.168.1.0/24   -p tcp --dport 80 -j REDIRECT --to-port 3128
konfig squida:

Kod: Zaznacz cały

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.0/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563 955 #poczta
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # httpd. snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 #niezarejestrowane porty
acl Safe_ports port 9022 # ssh
acl Safe_ports port 8074 # gg
acl Safe_ports port 8080 # www
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
acl lista url_regex /etc/squid/lista.acl

# tutaj wpisujesz wszystkich [b]użytkowników[/b]
alc    [b]użytkownik[/b]2    src    192.168.1.2
alc     [b]użytkownik[/b]3    src    192.168.1.3
alc    [b]użytkownik[/b]4    src    192.168.1.4
# port na którym pracuje squid
http_port 3128 transparent

#pamiec dla squida
cache_mem 1200 MB

#maksymalny rozmiar obiek[B]t[/B]u w ram
maximum_object_size_in_memory 256 KB

#metoda [B]odświeżania[/B] ram
memory_replacement_policy heap GDSF

#metoda  [B]odświeżania[/B] dla hdd
cache_dir aufs /backup/squid_cache 2048 16 256

#minimalny rozmiar object dla dysku
minimum_object_size 0 KB

#maksymalny rozmair obejct dla dysku
maximum_object_size 500 MB

#poziomy, na których ma nastÄ™poować agresywna wymiana cache
cache_swap_low 90
cache_swap_high 97

#lokalizacja logĂłw

access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log

#maska klienta
client_netmask 255.255.255.0

#maksymalny rozmiar wysyłanego nagłówka
request_header_max_size 1 MB

#maksymaly rozmiar treśći zapytania
request_body_max_size 2 MB

#odrzuca niedokończone połączenia
half_closed_clients off
#czas zamkniecia/restartu squida
shutdown_lifetime 10 second
#użytkownic uprawiony do korzystania z proxy
cache_effective_user proxy
#grupa uprawniona do uzywania cache
cache_effective_group proxy
#logi bledow
error_directory /var/log/squid/errors/Polish
#wsparcie dla dns
dns_defnames on
#adresy ip dns
dns_nameservers 194.204.152.34 194.204.159.1
#coś tam z ip
ipcache_size 10240
ipcache_low 90
ipcache_size 97
#buforowanie nazw domen
fqdncache_size 8192
#squid trzyma pamięć dla potencjalnego usera
memory_pools on
#limit zarezerwowanej pamięci
memory_pools_limit 100 MB
 
#odswiezanie plikow
 
#odswiezanie dla obrazkow
refresh_pattern -i \.(gif|tif|tiff|bmp|jpg|jpeg|png|ico) 1440 50% 10080
#odswiezanie dla obrazkow
refresh_pattern -i \.(wav|mp3|mp2|wmp|mid) 10080 50%  20160
#odswiezanie dokumentow
refresh_pattern -i \.(txt|pdf|doc|xls|docx|odf|ppt|pptx) 4320 50%  10080
#odswiezanie statycznych elementow stron
refresh_pattern -i \.(css|html|htm) 2880 50% 43200
#odswiezanie filmow
refresh_pattern -i \.(flv|swf|mp4|wmv|) 10080 70% 43200
Bardzo proszę o jakieś podpowiedzi.

Pozdrawiam.
Awatar użytkownika
Bastian
Member
Posty: 1424
Rejestracja: 30 marca 2008, 16:09
Lokalizacja: Poznañ

Post autor: Bastian »

Wyklucz połączenia na port 443 ze squida i tyle.

PS. Oczywiście na poziomie iptables.

PS2. Dlaczego w temacie napisałeś o ssh?
nero.ps
Posty: 10
Rejestracja: 02 kwietnia 2012, 10:53

Post autor: nero.ps »

Witam.

Dziękuję za odpowiedzi. Z ssh to pomyłka, miałem na myśli ssl, przepraszam.
Mógłbyś mi napisać regułkę która ominie port 443? Nie bardzo wiem jak można ją napisać.
Awatar użytkownika
Bastian
Member
Posty: 1424
Rejestracja: 30 marca 2008, 16:09
Lokalizacja: Poznañ

Post autor: Bastian »

Pokaz wszystkie reguly firewalla, gdyz ta powyższa w ogole nie przekierowuje 443 na squida.
nero.ps
Posty: 10
Rejestracja: 02 kwietnia 2012, 10:53

Post autor: nero.ps »

Firewall:

Kod: Zaznacz cały

#!/bin/bash
echo "1" > /proc/sys/net/ipv4/ip_forward


INTER="eth0"
# tutaj podaj swoj interfejs internetowy


PRIVPORTS="0:1023"
UNPRIVPORTS="1024:65535"
Firewall=DROP
# tutaj mozesz wpisac 2 zmienne ACCEPT -(firewall wylaczony) lub DROP -(firewall wlaczony)

iptables -F
iptables -X
iptables -F -t nat
iptables -X -t nat
iptables -F -t filter
iptables -X -t filter
iptables -P INPUT   ACCEPT
iptables -P OUTPUT  ACCEPT
iptables -P FORWARD $Firewall
iptables -N lstat
iptables -A FORWARD -j lstat
# zapis do logĂłw 15 razy na godzine
iptables -A INPUT -j LOG -m limit --limit 15/h
iptables -A OUTPUT -j LOG -m limit --limit 15/h
iptables -A FORWARD -j LOG -m limit --limit 15/h

#iptables -A INPUT -p icmp -i $INTER -j DROP
#iptables -A OUTPUT -p icmp -o $INTER -j DROP
# usuwajac znaczek # z linijek powyzej wylaczasz odpowiedzi na pingi dla interfejsu internetowego

iptables -A INPUT -p tcp --dport 135:139 -j DROP
iptables -A OUTPUT -p tcp --dport 135:139 -j DROP
iptables -A FORWARD -p tcp --dport 135:139 -j DROP
iptables -A INPUT -p udp --dport 135:139 -j DROP
iptables -A OUTPUT -p udp --dport 135:139 -j DROP
iptables -A FORWARD -p udp --dport 135:139 -j DROP
iptables -A INPUT -p tcp --dport 445 -j DROP
iptables -A OUTPUT -p tcp --dport 445 -j DROP
iptables -A FORWARD -p tcp --dport 445 -j DROP
iptables -A INPUT -p udp --dport 445 -j DROP
iptables -A OUTPUT -p udp --dport 445 -j DROP
iptables -A FORWARD -p udp --dport 445 -j DROP
# a oto blokada portow znanych wirusow typu blaster czy sasser ! :)

iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i $INTER -p icmp -s any/0 --icmp-type 0 -j ACCEPT
iptables -A INPUT -i $INTER -p icmp -s any/0 --icmp-type 4 -j ACCEPT
iptables -A INPUT -i $INTER -p icmp -s any/0 --icmp-type 12 -j ACCEPT
iptables -A INPUT -i $INTER -p icmp -s any/0 --icmp-type 3 -j ACCEPT
iptables -A INPUT -i $INTER -p tcp -m multiport --dport 22,21,80,110,113,443,465,995,9022,8080,3128 -j ACCEPT
iptables -A INPUT -i $INTER -p tcp --dport $PRIVPORTS -j $Firewall
iptables -A INPUT -i $INTER -p udp --dport $PRIVPORTS -j $Firewall
iptables -A INPUT -i $INTER -p tcp --sport $UNPRIVPORTS -j ACCEPT
iptables -A INPUT -i $INTER -p udp --sport $UNPRIVPORTS -j ACCEPT


# udostępnianie połaczenia dla sieci
iptables -t filter -A FORWARD -s 192.168.1.0/255.255.255.0 -d 0/0 -j ACCEPT
iptables -t filter -A FORWARD -s 0/0 -d 192.168.1.0/255.255.255.0 -j ACCEPT
# tu zobacz czy twoje podsiec wew zgadza sie z wpisem 192.168.1.0/255.255.255.0 - jesli nie to zmien wedlug uznania w obu linijkach

iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.2 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.3 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.4 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.5 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.6 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.7 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.8 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.9 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.10 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.11 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.12 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.13 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.14 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.15 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.16 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.17 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.18 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.19 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.20 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.21 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.22 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.23 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.24 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.25 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.26 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.27 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.28 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.29 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.30 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.31 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.32 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.33 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.34 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.35 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.36 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.37 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.38 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.39 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.40 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.41 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.42 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.43 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.44 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.45 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.46 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.47 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.48 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.49 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.50 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.51 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.52 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.53 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.54 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.55 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.56 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.57 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.58 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.59 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.60 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.61 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.62 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.63 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.64 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.65 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.66 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.67 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.68 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.68 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.70 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.71 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.72 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.73 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.74 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.75 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.76 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.77 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.78 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.79 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.80 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.81 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.82 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.83 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.84 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.85 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.86 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.87 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.88 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.89 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.90 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.91 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.92 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.93 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.94 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.94 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.95 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.96 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.97 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.98 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.99 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.100 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.101 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.102 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.103 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.104 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.105 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.105 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.106 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.107 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.108 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.109 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.110 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.111 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.112 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.113 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.114 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.115 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.116 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.117 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.118 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.119 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.120 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.121 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.122 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.123 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.124 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.125 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.126 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.127 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.128 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.129 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.130 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.131 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.132 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.133 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.134 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.135 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.136 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.137 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.138 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.139 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.140 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.141 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.142 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.143 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.144 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.145 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.146 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.147 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.148 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.149 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.150 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.151 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.152 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.153 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.154 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.155 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.156 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.157 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.158 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.159 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.160 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.161 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.162 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.163 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.164 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.165 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.166 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.167 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.168 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.169 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.170 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.171 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.172 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.173 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.174 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.175 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.176 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.177 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.178 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.179 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.180 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.181 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.182 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.183 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.184 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.185 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.186 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.187 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.188 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.189 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.190 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.191 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.192 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.193 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.194 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.195 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.196 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.197 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.198 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.199 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.200 -d 0/0 -j MASQUERADE

iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.240 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.241 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.242 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.243 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.244 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.245 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.246 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.247 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.248 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.249 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.250 -d 0/0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.251 -d 0/0 -j MASQUERADE
#squid
#iptables -t nat -A PREROUTING -s 192.168.1.0/24   -p tcp --dport 80 -j REDIRECT --to-port 3128

#do tych plikow zajrzyj
#/sbin/rc.p2p
#/sbin/rc.blokady

#iptables -t nat -A PREROUTING -i $INTER -p tcp -d 83.14.144.1 --dport 8080 -j DNAT --to-destination 192.168.1.1:8080
#iptables -t nat -A PREROUTING -i $INTER -p tcp -d IP_ZEW --dport 1552 -j DNAT --to-destination 192.168.0.3:1552
#iptables -t nat -A PREROUTING -i $INTER -p tcp -d IP_ZEW --dport 1553 -j DNAT --to-destination 192.168.0.4:1553
# to regulki do przekierowania portu potrzebnego dla danego usera - np gg aby mogl wysylac-odbierac pliki oraz rozmawiac przez mikrofon
# w miejsce IP_ZEW wpisz swoj ip zew lacza


siec=192.168.1
eth_siec=eth1

#ilosc polaczen na usera
ILOSC=80

#ilosc ip z sieci od ip nr 2 ( w tym przypadku do ip 254)
ILE=254

echo " Limity polaczen !!! "
for (( (i=$ILE,IP=2); (i=$i-1); (IP=$IP+1) )) ; do
iptables -A PREROUTING -t mangle -p tcp -s ${siec}.${IP} -m connlimit --connlimit-above $ILOSC -i $eth_siec -j DROP
done;
echo " Koniec $eth_siec "

W Iptables mam przekierowany port 80 ale w konfigu squida mam dodane acl z portem 443.
Awatar użytkownika
Bastian
Member
Posty: 1424
Rejestracja: 30 marca 2008, 16:09
Lokalizacja: Poznañ

Post autor: Bastian »

Twój squid nie dostaje połączeń na port 443 więc problem raczej nie jest taki jak go przedstawiłeś. Napisałeś, ze "czasami" występuje problem z połączeniami szyfrowanymi. Przedstaw jakiś konkretny przykład.
nero.ps
Posty: 10
Rejestracja: 02 kwietnia 2012, 10:53

Post autor: nero.ps »

Występuje to zawsze przy przesyłaniu wniosków przez przeglądarkę przez https, tak samo aplikacje bestia (sprawozdawczość finansowa). Po wyłączeniu squida wszystko działa poprawnie.
W logach squida widać tylko błąd 417 i informacje o błędnym nagłówku.
Cyphermen
Beginner
Posty: 426
Rejestracja: 24 maja 2009, 10:56
Lokalizacja: cze-wa

Post autor: Cyphermen »

Ja tam widzę, w squidzie, port 443. Niby nie ma przekierowania na iptables ale w samych acl jest wpis.

A co masz w liście wyrażeń regularnych? Może tutaj jest problem?
nero.ps
Posty: 10
Rejestracja: 02 kwietnia 2012, 10:53

Post autor: nero.ps »

Nie mam nic jeszcze, czysty plik, miałem dopiero zacząć dodawać blokowane strony.
Awatar użytkownika
grzesiek
Junior Member
Posty: 932
Rejestracja: 06 stycznia 2008, 10:41
Lokalizacja: Białystok

Post autor: grzesiek »

Kod: Zaznacz cały

[LEFT][color=#333333]iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.2 -d 0/0 -j MASQUERADE
[/color][/LEFT]...
[LEFT][color=#333333]iptables -t nat -A POSTROUTING -o $INTER -s 192.168.1.251 -d 0/0 -j MASQUERADE[/color][/LEFT]
Matko, czegoś takiego jeszcze nie widziałem! Wiesz ile to pracy dla procesora ;) przy każdym pakiecie...
ODPOWIEDZ