Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables regole
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
Manuelixm
l33t
l33t


Joined: 03 Apr 2004
Posts: 832
Location: Brescia

PostPosted: Wed Oct 27, 2004 9:03 am    Post subject: Reply with quote

man iptables
Back to top
View user's profile Send private message
rota
l33t
l33t


Joined: 13 Aug 2003
Posts: 960

PostPosted: Wed Oct 27, 2004 9:22 am    Post subject: Reply with quote

allora io o impostato cosi ...iptables

!/bin/sh
# masquerade
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.0.0/255.255.255.0 -j MASQUERADE
iptables -A FORWARD -i ppp0 -m state --state NEW,INVALID -j REJECT
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# chiude tutte le porte tranne la porta 80
# iptables -A INPUT -i eth1 -p tcp --syn --destination-port ! 80 -j DROP
# iptables -A INPUT -i ppp0 -p tcp --syn --destination-port ! 80 -j DROP
# apri la porta 21/FTP
iptables -A INPUT -p tcp -i eth1 --dport 21 -j ACCEPT
#apri la porta 22/SH
iptables -A INPUT -p tcp -i eth1 --dport 22 -j ACCEPT
#apri la porta 23/TELENT
iptables -A INPUT -p tcp -i eth1 --dport 23 -j ACCEPT
#apri la porta 25/SMTP
iptables -A INPUT -p tcp -i eth1 --dport 25 -j ACCEPT
iptables -A INPUT -p tcp -i eth1 --sport 21 -j ACCEPT
#apri la porta 80/HTTP
iptables -A INPUT -p tcp -i eth1 --dport 80 -j ACCEPT
#apri la porta 110/POP3
iptables -A INPUT -p tcp -i eth1 --dport 110 -j ACCEPT
iptables -A INPUT -j DROP
~

lo scrip mi chide tuttw le porte -- pero o il prb cche mi chiude anche cuelle che mi servono tipo andare su internet

:cry: :cry: :?: :?:
Back to top
View user's profile Send private message
comio
Advocate
Advocate


Joined: 03 Jul 2003
Posts: 2191
Location: Taranto

PostPosted: Wed Oct 27, 2004 10:12 am    Post subject: Reply with quote

HINT1: --sport --dport... source port, destination port... non voglio essere petulante, ma dovresti studiare un po' di IP/TCP e di filtering in generale, altrimeni tutto sarà oscuro...

HINT2: se devi andare su internet... magari ti serve una regola del tipo:
Code:

iptables -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

perché?

HINT3: studia prima a tavolino le regole per ogni chain di default (INPUT, OUTPUT, FORWARD, PREROUTING, POSTROUTING)

ciao
_________________
RTFM!!!!

e

http://www.comio.it
:)
Back to top
View user's profile Send private message
rota
l33t
l33t


Joined: 13 Aug 2003
Posts: 960

PostPosted: Wed Oct 27, 2004 10:28 am    Post subject: Reply with quote

iptables -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT


sta regola mica mi e tanto chiara ... io devvo scrivere cosi come me lai detta???
Back to top
View user's profile Send private message
rota
l33t
l33t


Joined: 13 Aug 2003
Posts: 960

PostPosted: Wed Oct 27, 2004 10:43 am    Post subject: Reply with quote

non ce sto a capi piu niente :cry: :cry: :oops: :oops:

o letto pure le guide che mi avete consigliato ..ma mi sono fatto una capa tanta che non ne vengo piu :?

adesso tirate fuori anxhe sta regola


iptables -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

mo non so piu che fare .. vabbe vaddo un momentino a spaccare la testa contro il muro poi torno ... :cry: :cry:
Back to top
View user's profile Send private message
comio
Advocate
Advocate


Joined: 03 Jul 2003
Posts: 2191
Location: Taranto

PostPosted: Wed Oct 27, 2004 8:39 pm    Post subject: Reply with quote

nessun panico... quella regola volontariamente te l'ho messa così...

il problema è che non hai ben chiaro come ragiona iptables... ti consiglio di iniziare a leggere questo:

http://www.netfilter.org/documentation/HOWTO/it/networking-concepts-HOWTO.html

e poi

http://www.netfilter.org/documentation/HOWTO/it/packet-filtering-HOWTO.html

e poi tutto il resto...

inizia con le cose semplici e leggi con attenzione il materiale che ti viene indicato anche dagli altri.

ok?

fammi sapere esattamente quali sono i tuoi problemi...
ciao
_________________
RTFM!!!!

e

http://www.comio.it
:)
Back to top
View user's profile Send private message
oRDeX
Veteran
Veteran


Joined: 19 Oct 2003
Posts: 1325
Location: Italy

PostPosted: Wed Oct 27, 2004 9:15 pm    Post subject: Reply with quote

in certe situazioni anche io dico: RTFM - man iptables
Back to top
View user's profile Send private message
rota
l33t
l33t


Joined: 13 Aug 2003
Posts: 960

PostPosted: Thu Oct 28, 2004 7:08 am    Post subject: Reply with quote

vi ringrayyio per la vostra paziienza ..... :wink:
Back to top
View user's profile Send private message
rota
l33t
l33t


Joined: 13 Aug 2003
Posts: 960

PostPosted: Thu Nov 04, 2004 11:36 am    Post subject: Reply with quote

:cry: :cry: :cry: nioente da fare o ancora probblemi.. io riesco a ricevere la posta ma non posso inviarla ....


allora io o impostato cosi lo script che mi gestisce le regole ....

iptables -t nat -A POSTROUTING -o eth1 -s 192.168.0.1/255.255.255.0 -j MASQUERADE


io cosi dovrei fare un masquerade delle 2 schedde di rete e dovrei avere i stessi servizzi sia che su eth1 che su eth0... man on e cosi ...

se faccio

nmap -sT localhost

Starting nmap 3.55 ( http://www.insecure.org/nmap/ ) at 2004-11-04 13:32 CET
Interesting ports on sofemared (127.0.0.1):
(The 1655 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
68/tcp open dhcpclient
111/tcp open rpcbind
139/tcp open netbios-ssn
445/tcp open microsoft-ds
631/tcp open ipp



mi fa vedre solo cueste porte ..la 25 la 110 non le veddo.... ma come faccio ad aprire ste benedette porte ???? o guiardato il file /etc/services

ma non o capito se e cuesto il file che mi permette di aprire le porte eccc...

o fatto anche cuello che mi avete suggerito ...o usato :
iptables -A INPUT -p tcp --dport 25 -j ACCEP
iptables -D INPUT -p tcp --dport 110-j ACCEP

ma non me le apre .....

:roll: :roll: :cry:
Back to top
View user's profile Send private message
Manuelixm
l33t
l33t


Joined: 03 Apr 2004
Posts: 832
Location: Brescia

PostPosted: Thu Nov 04, 2004 12:04 pm    Post subject: Reply with quote

Dubito che ti abbiano suggerito così
Code:

iptables -A INPUT -p tcp --dport 25 -j ACCEP
iptables -D INPUT -p tcp --dport 110-j ACCEP


per 2 motivi:
- ACCEP è un errore di scrittura -> ACCEPT
- con il primo comando aggiungi un regola alla tabella INPUT, con la seconda la cancelli.

Se non ho scritto c...ate dovrei aver capito un po' come funziona il tutto.
_________________
Linux user#370732
Back to top
View user's profile Send private message
rota
l33t
l33t


Joined: 13 Aug 2003
Posts: 960

PostPosted: Thu Nov 04, 2004 12:16 pm    Post subject: Reply with quote

o solo scritto male...am il comando da terminale l,o scritto bene ... a me non compare nessun errore ..... :wink: e solo che non mi apre le porte ...
Back to top
View user's profile Send private message
grentis
Guru
Guru


Joined: 20 Jul 2004
Posts: 321

PostPosted: Thu Nov 04, 2004 1:04 pm    Post subject: Reply with quote

Perchè la seconda regola non deve essere

Code:
iptables -D INPUT -p tcp --dport 110 -j ACCEPT


ma

Code:
iptables -A INPUT -p tcp --dport 110 -j ACCEPT



O almeno mi sembra.... :D
Back to top
View user's profile Send private message
Manuelixm
l33t
l33t


Joined: 03 Apr 2004
Posts: 832
Location: Brescia

PostPosted: Thu Nov 04, 2004 1:14 pm    Post subject: Reply with quote

Esatto, che svista, non ho fatto caso alle porte che erano diverse, cmq come ti è già stato suggerito, è meglio che ti leggi la documentazione o che usi il man iptables per vedere cosa significano i vari parametri.
_________________
Linux user#370732
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum