Re: Help needed for IPTABLES

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Grinberg!
 
You can use it:
 
iptables -F INPUT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p tcp -i eth0 -d $IP --dport 22 -j ACCEPT
iptables -A INPUT -j DROP
 
Try this!
 
Best regards
 
Paulo Henrique Rodrigues
e-mail: pauloh@xxxxxxxxxxxxxxxx
Corporate IT Support
Infortron - Assistência Técnica e Comércio Ltda
visit us at: http://www.infortron.com.br/linux
+55 (15) 3237.9200 - Sorocaba/SP/Brasil
----- Original Message -----
Sent: Thursday, February 05, 2004 3:40 PM
Subject: Help needed for IPTABLES

All experts Hi,
 
I try to secure a RedHat ES 3.0
I have two NIC's etho and eth1.
 
I want to at the begging to drop everything on eth0 and accept only what i need like SSH.
 
I use this rules
 
iptables -A INPUT -i lo -p all -j ACCEPT
iptables -A OUTPUT -o lo -p all -j ACCEPT
iptables -A INPUT -i eth0 -m state --state ESTABLISH, RELATED -j ACCEPT
 
for dropping all connection i use this rule
 
iptables -A INPUT -i eth0 -p tcp --tcp-option ! 2 REJECT --reject-with tcp-reset
 
for accepting i use this rule
 
iptables -A INPUT -p tcp -i eth0 --dport 22 -j ACCEPT
 
basically i stop all connection but it effect booth eth0 and eth1
and for port 22 i can't connect , surprise when i run   iptables -L -v  i get  as SSH connection was accepted.
 
at the same time i found that the output connection like internet do not work.
 
i need help on this issue.
 
Thanks
Hari
 
***********************************************************************************
Information contained in this email message is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@xxxxxxxxxxxxx and destroy the original message.
***********************************************************************************

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux