|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Apr 2003
Città: Rimini
Messaggi: 3970
|
[HELP] Apt-get e firewall = Non mi scarica + i pacchetti...
Come da topic, mi sono configurato a mano, e poi messo in uno script, il firewall utilizzando le regole di iptables. Il fw funziona perfettamente, dal PC riesco a navigare ed anke a scaricare via browser, tutti i servizi ke ho deciso d aprire funzionano anke dall'esterno ecc ecc MA nn riesco a capire come mai nn mi fa scaricare ne' l'update della source.list ne' tanto meno i pacchetti.
Se tolgo il fw invece tutto funziona correttamente... Come mai ? Apt-get utilizza una porta particolare per il DL ? Se si qual'è ? Grazie a tutti
__________________
Powered by Apple Macbook Pro Retina |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Aug 2002
Messaggi: 1909
|
a quanto ne so dipende dai repository: se sopn ftp usa ftp, se sopno http usa http. sùdevi stappare quelle porte sulle chain INPUT e OUTPUT.
__________________
AMD Athlon64X2 4400+@2700Mhz - Asus A8N32-SLI - 1GBddr400 - Dell Inspiron 6000 all powered by Gentoo-Linux Eight days of the week we're dead on our feet, take me aside just shoot me. No black and white, black and white. Wish we could drive right through you. - Eight Days - PitchShifter |
![]() |
![]() |
![]() |
#3 | |
Senior Member
Iscritto dal: Apr 2003
Città: Rimini
Messaggi: 3970
|
Quote:
__________________
Powered by Apple Macbook Pro Retina |
|
![]() |
![]() |
![]() |
#4 |
Senior Member
Iscritto dal: Aug 2002
Messaggi: 1909
|
posta il firewall
__________________
AMD Athlon64X2 4400+@2700Mhz - Asus A8N32-SLI - 1GBddr400 - Dell Inspiron 6000 all powered by Gentoo-Linux Eight days of the week we're dead on our feet, take me aside just shoot me. No black and white, black and white. Wish we could drive right through you. - Eight Days - PitchShifter |
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Jun 2003
Città: Genova
Messaggi: 5676
|
strano, che regole hai usato?
|
![]() |
![]() |
![]() |
#6 |
Senior Member
Iscritto dal: Apr 2003
Città: Rimini
Messaggi: 3970
|
#
# Variabili rete=192.168.0.0/24 server=192.168.0.1 athlon=192.168.0.2 wan=ppp0 lan=eth0 #----------------------------------------------------------- # Reset di Tutto iptables -F iptables -X iptables -t nat -F #----------------------------------------------------------- # Catena di Firewall di Default Con logging iptables -N STOP iptables -A STOP -j LOG --log-level info --log-prefix "Firewall: " iptables -A STOP -j DROP #------------------------------------------------------------------ # Blocco dei Pacchetti Non Validi iptables -A INPUT -j STOP -m state --state INVALID iptables -A OUTPUT -j STOP -m state --state INVALID iptables -A INPUT -j STOP -f iptables -A OUTPUT -j STOP -f #--------------------------------------------------------------------- # Abilitazione del traffico interno alla macchina iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT #----------------------------------------------------------------------- # Accetto pacchetti solo dagli indirizzi a me noti nella mia rete interna # e ignoro quelli provenienti da e per il mio stesso indirizzo iptables -A INPUT -i $lan -j STOP -s $server iptables -A OUTPUT -o $lan -j STOP -d $server iptables -A INPUT -i $lan -j ACCEPT -s $athlon iptables -A OUTPUT -o $lan -j ACCEPT -d $athlon iptables -A INPUT -i $lan -j STOP iptables -A OUTPUT -o $lan -j STOP #---------------------------------------------------------------- # Blocco Brutalmente tutti i pacchetti provenienti da internet # con indirizzi privati iptables -A INPUT -i $wan -j STOP -d 10.0.0.0/8 iptables -A INPUT -i $wan -j STOP -s 10.0.0.0/8 iptables -A INPUT -i $wan -j STOP -d 172.16.0.0/12 iptables -A INPUT -i $wan -j STOP -s 172.26.0.0/12 iptables -A INPUT -i $wan -j STOP -d 192.168.0.0/16 iptables -A INPUT -i $wan -j STOP -s 192.168.0.0/16 iptables -A INPUT -i $wan -j STOP -d 240.0.0.0/5 iptables -A INPUT -i $wan -j STOP -s 240.0.0.0/5 iptables -A INPUT -i $wan -j STOP -d 127.0.0.0/8 iptables -A INPUT -i $wan -j STOP -s 127.0.0.0/8 iptables -A INPUT -i $wan -j STOP -d 0.0.0.0 iptables -A INPUT -i $wan -j STOP -s 0.0.0.0 iptables -A INPUT -i $wan -j STOP -d 255.255.255.255 iptables -A INPUT -i $wan -j STOP -s 255.255.255.255 #---------------------------------------------------------------- # Blocco Brutalmente tutti i pacchetti verso internet # con indirizzi privati iptables -A OUTPUT -o $wan -j STOP -d 10.0.0.0/8 iptables -A OUTPUT -o $wan -j STOP -s 10.0.0.0/8 iptables -A OUTPUT -o $wan -j STOP -d 172.16.0.0/12 iptables -A OUTPUT -o $wan -j STOP -s 172.26.0.0/12 iptables -A OUTPUT -o $wan -j STOP -d 192.168.0.0/16 iptables -A OUTPUT -o $wan -j STOP -s 192.168.0.0/16 iptables -A OUTPUT -o $wan -j STOP -d 240.0.0.0/5 iptables -A OUTPUT -o $wan -j STOP -s 240.0.0.0/5 iptables -A OUTPUT -o $wan -j STOP -d 127.0.0.0/8 iptables -A OUTPUT -o $wan -j STOP -s 127.0.0.0/8 iptables -A OUTPUT -o $wan -j STOP -d 0.0.0.0 iptables -A OUTPUT -o $wan -j STOP -s 0.0.0.0 iptables -A OUTPUT -o $wan -j STOP -d 255.255.255.255 iptables -A OUTPUT -o $wan -j STOP -s 255.255.255.255 #---------------------------------------------------------------- # Blocco di tutto il traffico multicast in ingresso ad # eccezzione di quello in udp a patto che non sia troppo veloce # !!! NON ESEGUO IL LOG SU QUESTO !!! iptables -A INPUT -i $wan -j DROP -s 224.0.0.0/4 iptables -A INPUT -i $wan -j ACCEPT -d 224.0.0.0/4 -p udp -m limit --limit 5/second --limit-burst 10 #-------------------------------------------------------------- # Apro i servizi a cui voglio accedere # DNS iptables -A OUTPUT -o $wan -j ACCEPT -p udp --sport 1024:65535 --dport 53 -m state --state NEW,ESTABLISHED iptables -A INPUT -i $wan -j ACCEPT -p udp --dport 1024:65535 --sport 53 -m state --state ESTABLISHED #HTTP iptables -A OUTPUT -o $wan -j ACCEPT -p tcp --sport 1024:65535 --dport 80 -m state --state NEW,ESTABLISHED iptables -A INPUT -i $wan -j ACCEPT -p tcp --dport 1024:65535 --sport 80 -m state --state ESTABLISHED iptables -A INPUT -i $wan -p tcp --dport 80:80 -j ACCEPT #FTP #iptables -A OUTPUT -o $wan -j ACCEPT -p tcp --sport 1024:65535 --dport 21 -m state --state NEW,ESTABLISHED iptables -A INPUT -i $wan -p tcp --dport 21 -j LOG --log-level notice --log-prefix "FTP Access :" #iptables -A INPUT -i $wan -j ACCEPT -p tcp --dport 1024:65535 --sport 21 -m state --state ESTABLISHED iptables -A INPUT -i $wan -p tcp --dport 21 -j ACCEPT #SSH iptables -A INPUT -i $wan -p tcp --dport 22 -j LOG --log-level notice --log-prefix "SSH Access :" iptables -A INPUT -i $wan -j ACCEPT -p tcp --sport 1024:65535 --dport 22 iptables -A OUTPUT -o $wan -j ACCEPT -p tcp --dport 1024:65535 --sport 22 #ICMP iptables -A OUTPUT -o $wan -j ACCEPT -p icmp -m state --state NEW iptables -A INPUT -i $wan -j ACCEPT -p icmp -m state --state RELATED,ESTABLISHED #TRACEROUTE iptables -A OUTPUT -o $wan -j ACCEPT -p udp --sport 32769:65535 --dport 33434:33523 -m state --state NEW #xMule iptables -A INPUT -i $wan -j ACCEPT -p tcp --dport 4662 --sport 1024:65535 -m state --state NEW,ESTABLISHED iptables -A INPUT -i $wan -j ACCEPT -p tcp -m state --state ESTABLISHED,RELATED iptables -A OUTPUT -o $wan -j ACCEPT -p tcp --dport 1024:65535 iptables -A INPUT -i $wan -j ACCEPT -p udp --dport 4672 --sport 1024:65535 -m state --state NEW,ESTABLISHED iptables -A OUTPUT -o $wan -j ACCEPT -p udp --dport 1024:65535 #WebMin iptables -A INPUT -i $lan -j ACCEPT -p tcp --dport 3110 -m state --state NEW,ESTABLISHED iptables -A OUTPUT -o $lan -j ACCEPT -p tcp --sport 3110 -m state --state ESTABLISHED #----------------------------------------------------------------- # Blocco di TUTTO iptables -A INPUT -j STOP iptables -A OUTPUT -j STOP #------------------------------------------------------------------- # Abilito il Masquerating iptables -t nat -A POSTROUTING -j MASQUERADE
__________________
Powered by Apple Macbook Pro Retina |
![]() |
![]() |
![]() |
#7 |
Senior Member
Iscritto dal: Jun 2003
Città: Genova
Messaggi: 5676
|
ops, ho sbagliato
|
![]() |
![]() |
![]() |
#8 |
Senior Member
Iscritto dal: Aug 2002
Messaggi: 1909
|
le regole tipo queste:
iptables -A OUTPUT -o $wan -j ACCEPT -p udp --sport 1024:65535 --dport 53 -m state --state NEW,ESTABLISHED iptables -A INPUT -i $wan -j ACCEPT -p udp --dport 1024:65535 --sport 53 -m state --state ESTABLISHED prova a modificarle così: iptables -A OUTPUT -o $wan -j ACCEPT -p udp --dport 53 -m state --state NEW,ESTABLISHED iptables -A INPUT -i $wan -j ACCEPT -p udp --sport 53 -m state --state ESTABLISHED #HTTP iptables -A OUTPUT -o $wan -j ACCEPT -p tcp --dport 80 -m state --state NEW,ESTABLISHED iptables -A INPUT -i $wan -j ACCEPT -p tcp --sport 80 -m state --state ESTABLISHED io di solito specifico per una regola o solo la porta sorgente o solo la porta di destinazione.
__________________
AMD Athlon64X2 4400+@2700Mhz - Asus A8N32-SLI - 1GBddr400 - Dell Inspiron 6000 all powered by Gentoo-Linux Eight days of the week we're dead on our feet, take me aside just shoot me. No black and white, black and white. Wish we could drive right through you. - Eight Days - PitchShifter |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 03:08.