|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Jul 2000
Città: Amsterdam
Messaggi: 217
|
Parere su Firewall tramite iptables
Dopo innumerevoli prove sono arrivato ad un insieme di regole per iptables che dovrebbero essere soddisfacenti.
![]() ![]() Potete mica darmi un parere, come avvisarmi se ho dimenticato qsa di importante? Thx mille ![]() ![]() P.s.: Lasciate stare i commenti che li ho scritti in un momento di delirio pre esame ![]() ![]() ![]() Codice:
#!/bin/bash # Let's flush all the chains iptables -F # Setting standard policies iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT ACCEPT # Then allow incoming connection for Apache iptables -A INPUT -p tcp --dport 80 -j ACCEPT iptables -A INPUT -p udp --dport 80 -j ACCEPT # And for SSH iptables -A INPUT -p tcp --dport 22 -j ACCEPT iptables -A INPUT -p udp --dport 22 -j ACCEPT # Also for Samba. This time only from trusted network iptables -A INPUT -s 10.0.0.0/24 -i eth1 -p tcp --dport 139 -j ACCEPT iptables -A INPUT -s 10.0.0.0/24 -i eth1 -p udp --dport 138 -j ACCEPT iptables -A INPUT -s 10.0.0.0/24 -i eth1 -p udp --dport 137 -j ACCEPT # In the meanwhile allow routing from trusted to untrusted net iptables -A FORWARD -s 10.0.0.0/24 -i eth1 -j ACCEPT iptables -A FORWARD -d 10.0.0.0/24 -m state --state ESTABLISHED,RELATED -j ACCEPT # Had to allow communications from server itself iptables -A INPUT -i lo -j ACCEPT iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # Then allow ping, ping6 and ipv6 iptables -A INPUT -p icmp -j ACCEPT iptables -A INPUT -p ipv6-icmp -j ACCEPT iptables -A INPUT -p ipv6 -j ACCEPT # Let's masquerade...february? Dont touch ipv6! iptables -t nat -A POSTROUTING --proto ! 41 -o eth0 -j MASQUERADE |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Apr 2000
Città: Roma
Messaggi: 15625
|
Re: Parere su Firewall tramite iptables
Codice:
iptables -A INPUT -p tcp --dport 80 -j ACCEPT iptables -A INPUT -p udp --dport 80 -j ACCEPT 2) Il traffico viaggia su tcp, non aprire la porta udp. Codice:
iptables -A INPUT -p tcp --dport 22 -j ACCEPT iptables -A INPUT -p udp --dport 22 -j ACCEPT Codice:
iptables -t nat -A POSTROUTING --proto ! 41 -o eth0 -j MASQUERADE
__________________
0: or %edi, %ecx; adc %eax, (%edx); popf; je 0b-22; pop %ebx; fadds 0x56(%ecx); lds 0x56(%ebx), %esp; mov %al, %al andeqs pc, r1, #147456; blpl 0xff8dd280; ldrgtb r4, [r6, #-472]; addgt r5, r8, r3, ror #12 |
![]() |
![]() |
![]() |
#3 |
Senior Member
Iscritto dal: Jul 2000
Città: Amsterdam
Messaggi: 217
|
Fatto le aggiunte thx mille!
![]() Per samba quindi vanno bene le porte udp che ho aperto? Se non le aprivo non riuscivo a loggarmi alle direcotry condivise ![]() |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 05:35.