Iptables configuration

Ben Russo ben at muppethouse.com
Tue Apr 12 18:08:03 UTC 2005


Padiyath Sreekumaran wrote:
>   
>    Hello,
>    I saw that a number of ssh login attepts has been done on my linux
>    machine without success. I want to configure the firewall on the machine.
>    I have taken over this machine from another person. OS version is
> 2.6.4-52-smp.



In /etc/sysconfig/iptables   file
Put the following:

# Firewall configuration written by redhat-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -s 129.129.0.0/16 -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT


Then run "chkconfig iptables on"
and "service iptables restart"

-Ben.




More information about the redhat-list mailing list