|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: May 2004
Messaggi: 606
|
Slackware e router/firewall
Ciao a tutti ragazzuoli...
Avrei bisogno (affermando sempre di più la mia ingnoranza in materia... Ossia, la rete dovrebbe essere staccata dal gateway, con in mezzo sto vecchiaccio di PC che faccia da firewall e non faccia entrare nessuna connessione, niente peer to peer caxxi e mazzi vari.. Deve permettere SOLO di andare a nasellare su internet ed utilizzare la posta elettronica senza permettere nessuna connessione dall'esterno.. neppure telnet.. E' possibile? PS: avevo pensato di utilizzare slackware 9.1 appena scaricata, ma non so come fare... sono un perfetto novellino.. Installando devo configurare il PC che fa da firewall come gateway che a sua volta punta sul gateway con la connessione sul web? Gli altri PC quindi dovrebbero puntare verso il vecchio PC con installato solo la slackware inpostata come Firewall? Qualche consiglio? Esiste qualche HOWTO in merito? Grazie mille a tutti... Ciauzzzz |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Dec 2000
Città: Trento
Messaggi: 5917
|
Inizia a dare un'occhiata qui!.. ma non scoraggiarti subito!
http://www.netfilter.org/documentati...NAT-HOWTO.html
__________________
Linux User #272700 >+++++++++[<+++++++++>-]<+.++.>++++[<---->-]<++.+++++++. HOWTO: SSH Firewall e DMZ ɐɹdosoʇʇos oʇuǝs ıɯ |
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: May 2004
Messaggi: 606
|
Grazie mille....!
Vado subito a studiarmelo... PS: perchè mi premetti di non scoraggiarmi subito? E' una cosa da paura? |
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: Dec 2000
Città: Trento
Messaggi: 5917
|
Quando hai studiato un pochino da un'occhiata qui:
http://www.linuxguruz.com/iptables/ trovi un po di esempi di firewall, che puoi adattare alle tue esigenze Ciao!
__________________
Linux User #272700 >+++++++++[<+++++++++>-]<+.++.>++++[<---->-]<++.+++++++. HOWTO: SSH Firewall e DMZ ɐɹdosoʇʇos oʇuǝs ıɯ |
|
|
|
|
|
#5 |
|
Senior Member
Iscritto dal: May 2004
Messaggi: 606
|
Azz.. mi sento parecchio ignorante.. Adesso ci studio sopra... |
|
|
|
|
|
#6 | |
|
Senior Member
Iscritto dal: May 2004
Messaggi: 606
|
Quote:
Ma sono regole già pronte? |
|
|
|
|
|
|
#7 | ||
|
Senior Member
Iscritto dal: Dec 2000
Città: Trento
Messaggi: 5917
|
Quote:
Quote:
perche' se vedi certi esempi complicati ti suicideresti!! tipo: http://www.unixpages.com/disp.php?5 (guardati lo script del firewall!) Invece per proteggere una rete relativamente semplice te la cavi con moooolto meno! (dopo dipende da che livello di paranoia hai!) Ciao!
__________________
Linux User #272700 >+++++++++[<+++++++++>-]<+.++.>++++[<---->-]<++.+++++++. HOWTO: SSH Firewall e DMZ ɐɹdosoʇʇos oʇuǝs ıɯ |
||
|
|
|
|
|
#8 | |
|
Senior Member
Iscritto dal: Dec 2000
Città: Trento
Messaggi: 5917
|
Quote:
si ci sono dei firewall pronti per l'uso.... ma trovare quello che fa "esattamente" quello che ti serve (qualunque cosa ti serva) e' difficile, invece se parti da una base gia' fatta riesci ad adattare lo script ai tuoi scopi (prima ovviamente devi studiare un pochino).... Quando diventi veramente pratico allora puoi scrivere tutto il tuo firewall partendo da zero! Ciao!
__________________
Linux User #272700 >+++++++++[<+++++++++>-]<+.++.>++++[<---->-]<++.+++++++. HOWTO: SSH Firewall e DMZ ɐɹdosoʇʇos oʇuǝs ıɯ |
|
|
|
|
|
|
#9 | |
|
Senior Member
Iscritto dal: May 2004
Messaggi: 606
|
Quote:
Fico...! Grazie mille ancora.. ora mi ci metto... |
|
|
|
|
|
|
#10 | |
|
Senior Member
Iscritto dal: May 2004
Messaggi: 606
|
Quote:
Paura.. :eeek: Cmq ci provo... |
|
|
|
|
|
|
#11 |
|
Senior Member
Iscritto dal: Feb 2004
Messaggi: 1209
|
Beh semplicemente per qello che ti dovrebbe servire basterebbe mettere tutte le policy a drop abilitare le connessioni tcp sulla porta 80 solo come estabilish e related
idem x la porta che usa il servizio di posta x fare da gateway deve nattare solo richieste provenienti dalla sua rete verso l'esterno.. Poi perche' nn posti le tue regole cosi' mi do una spolverata che nn uso iptables gia' da un bel po' ?!
__________________
...Ordunque... |
|
|
|
|
|
#12 |
|
Senior Member
Iscritto dal: Jul 2002
Città: Padova
Messaggi: 4245
|
Hai provato a valutare ipcop?
Fa da router e firewall e lo butti su in 5 minuti anche su un vecchio pentium con poca ram e quasi niente di hd. Certo che studiare NAT e IPTABLES è molto più figo Ciao. |
|
|
|
|
|
#13 |
|
Senior Member
Iscritto dal: Dec 2000
Città: Trento
Messaggi: 5917
|
Beh ecco il mio firewall (sono partito da uno gia fatto e poi ho tolto/aggiunto/modificato):
Non e' il massimo della sicurezza, ma almeno qualcosa fa' (p.s. chi usa la rete interna e' piu' che fidato: se combinano qualcosa gli spezzo le braccine!! Codice:
#!/bin/sh # The location of the IPtables binary file on your system. IPT="/sbin/iptables" # The Network Interface you will be protecting. For ADSL/dialup users, # ppp0 should be fine. If you are using a cable internet connection or # are connected to a LAN, you will have to change this to "eth0". INT="ppp0" # The following rules will clear out any existing firewall rules, # and any chains that might have been created. $IPT -F $IPT -F INPUT $IPT -F OUTPUT $IPT -F FORWARD $IPT -F -t mangle $IPT -F -t nat $IPT -X # These will setup our policies. $IPT -P INPUT DROP $IPT -P OUTPUT ACCEPT $IPT -P FORWARD ACCEPT # The following line below enables IP forwarding and thus # by extension, NAT. Turn this on if you're going to be # doing NAT or IP Masquerading. echo 1 > /proc/sys/net/ipv4/ip_forward # Source NAT everything heading out the $INT (external) # interface to be the given IP. $IPT -t nat -A POSTROUTING -o $INT -j MASQUERADE -s 192.168.0.0/24 -d 0/0 # If you would like to forward specific ports to other machines # on your home network, edit and uncomment the rules below. They are # currently set up to forward port 25 & 53 (Mail & DNS) to 10.1.1.51. # Anything incoming over your $INT through your gateway will # be automatically redirected invisibly to port 25 & 53 on 10.1.1.51 $IPT -A FORWARD -i $INT -m state --state INVALID -j DROP # regole per ridirigere sul pc interno (192.168.0.1) # -ssh: contattare l'ip pubblico sulla porta 2000 # -gnomemmeeting # -vncconnect $IPT -t nat -A PREROUTING -p tcp --dport 2000 -i ppp0 -j DNAT --to 192.168.0.1:22 $IPT -t nat -A PREROUTING -s 0/0 -i $INT -p tcp --dport 1720 -j DNAT --to-dest 192.168.0.1 $IPT -t nat -A PREROUTING -s 0/0 -i $INT -p tcp --dport 30000:30010 -j DNAT --to-dest 192.168.0.1 $IPT -t nat -A PREROUTING -s 0/0 -i $INT -p udp --dport 5000:5013 -j DNAT --to-dest 192.168.0.1 $IPT -t nat -A PREROUTING -s 0/0 -i $INT -p tcp --dport 5500 -j DNAT --to-dest 192.168.0.1 $IPT -t nat -A PREROUTING -s 0/0 -i $INT -p tcp --dport 5501 -j DNAT --to-dest 192.168.0.1 # Now, our firewall chain. We use the limit commands to # cap the rate at which it alerts to 15 log messages per minute. $IPT -N firewall $IPT -A firewall -m limit --limit 15/minute -j LOG --log-prefix Firewall: $IPT -A firewall -j DROP # Now, our dropwall chain, for the final catchall filter. $IPT -N dropwall $IPT -A dropwall -m limit --limit 15/minute -j LOG --log-prefix Dropwall: $IPT -A dropwall -j DROP # Our "hey, them's some bad tcp flags!" chain. $IPT -N badflags $IPT -A badflags -m limit --limit 15/minute -j LOG --log-prefix Badflags: $IPT -A badflags -j DROP # And our silent logging chain. $IPT -N silent $IPT -A silent -j DROP # This rule will accept connections from local machines. If you have # a home network, enter in the IP's of the machines on the # network below. $IPT -A INPUT -i lo -j ACCEPT $IPT -A INPUT -i eth0 -s 192.168.0.0/255.255.255.0 -d 192.168.0.254 -p all -j ACCEPT # # Drop those nasty packets! These are all TCP flag # combinations that should never, ever occur in the # wild. All of these are illegal combinations that # are used to attack a box in various ways, so we # just drop them and log them here. $IPT -A INPUT -p tcp --tcp-flags ALL FIN,URG,PSH -j badflags $IPT -A INPUT -p tcp --tcp-flags ALL ALL -j badflags $IPT -A INPUT -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j badflags $IPT -A INPUT -p tcp --tcp-flags ALL NONE -j badflags $IPT -A INPUT -p tcp --tcp-flags SYN,RST SYN,RST -j badflags $IPT -A INPUT -p tcp --tcp-flags SYN,FIN SYN,FIN -j badflags # Drop icmp, but only after letting certain types through. $IPT -A INPUT -p icmp --icmp-type 0 -j ACCEPT $IPT -A INPUT -p icmp --icmp-type 3 -j ACCEPT $IPT -A INPUT -p icmp --icmp-type 11 -j ACCEPT $IPT -A INPUT -p icmp --icmp-type 8 -m limit --limit 1/second -j ACCEPT $IPT -A INPUT -p icmp -j firewall # If you would like to open up port 22 (SSH Access) to various IP's # simply edit the IP's below and uncomment the line. If youw wish to # enable SSH access from anywhere, uncomment the second line only. #accetto connessioni sulle porte: #-22: ssh #-80: il mio server web #-443: https (non voglio usare il webmail con la password che gira in chiaro!) #-993: imap4 su ssl (non voglio password in chiaro!) #-995: pop3 su ssl (devo ripetermi?) #-25: smtp #-4662:4664 tcp e 4672 udp: un certo mulo! #-19150: gkrellm2 server! (ma fra poco la tolgo, e per controllare uso un tunnel ssh) #-6880:6889: beh ormai senza bittorrent dove vai?! $IPT -A INPUT -i $INT -s 0/0 -p tcp --dport 22 -j ACCEPT $IPT -A INPUT -i $INT -s 0/0 -d 0/0 -p tcp --dport 80 -j ACCEPT $IPT -A INPUT -i $INT -s 0/0 -d 0/0 -p tcp --dport 443 -j ACCEPT $IPT -A INPUT -i $INT -s 0/0 -d 0/0 -p tcp --dport 993 -j ACCEPT $IPT -A INPUT -i $INT -s 0/0 -d 0/0 -p tcp --dport 995 -j ACCEPT $IPT -A INPUT -i $INT -s 0/0 -d 0/0 -p tcp --dport 25 -j ACCEPT $IPT -A INPUT -i $INT -s 0/0 -d 0/0 -p tcp --dport 4662:4664 -j ACCEPT $IPT -A INPUT -i $INT -s 0/0 -d 0/0 -p tcp --dport 19150 -j ACCEPT $IPT -A INPUT -i $INT -s 0/0 -d 0/0 -p udp --dport 4672 -j ACCEPT $IPT -A INPUT -i $INT -s 0/0 -d 0/0 -p tcp --dport 6880:6889 -j ACCEPT # Lets do some basic state-matching. This allows us # to accept related and established connections, so # client-side things like ftp work properly, for example. $IPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT # Uncomment to drop port 137 netbios packets silently. # We don't like that netbios stuff, and it's way too # spammy with windows machines on the network. $IPT -A INPUT -p udp --sport 137 --dport 137 -j silent # Our final trap. Everything on INPUT goes to the dropwall # so we don't get silent drops. $IPT -A INPUT -j dropwall Ciao!
__________________
Linux User #272700 >+++++++++[<+++++++++>-]<+.++.>++++[<---->-]<++.+++++++. HOWTO: SSH Firewall e DMZ ɐɹdosoʇʇos oʇuǝs ıɯ Ultima modifica di HexDEF6 : 25-05-2004 alle 19:12. |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 16:36.



















