Start httpd and mysqld daemon service ~]# service httpd ~]# service mysqld startġ3. A INPUT -m state -state NEW -m tcp -p tcp -dport 3306 -j ACCEPTġ2. A INPUT -m state -state NEW -m tcp -p tcp -dport 80 -j ACCEPT Modify the Iptables configuration file as below. View and modify original Iptables configuration file ~]# vi /etc/sysconfig/iptablesġ1. Add below line to enable certain port/programs to pass through firewall such as:ġ0. See also How to Setup MailWatch on CentOS 6.3ĩ. Note : Only ssh port has been opened on this server and listening port is 22. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name Display current opened port ~]# netstat -pluntĪctive Internet connections (only servers) To set iptables start at boot ~]# chkconfig iptables onĨ. To start, stop, and restart iptables, you can run below commands ~]# service iptables ~]# service iptables ~]# service iptables restartħ. A FORWARD -j REJECT -reject-with icmp-host-prohibitedĦ. A INPUT -j REJECT -reject-with icmp-host-prohibited A INPUT -m state -state NEW -m tcp -p tcp -dport 22 -j ACCEPT A INPUT -m state -state ESTABLISHED,RELATED -j ACCEPT # Manual customization of this file is not recommended. # Firewall configuration written by system-config-firewall Display Default Iptables ~]# cat /etc/sysconfig/iptables If Iptables not running, it will return this message ~]# service iptables statusĥ. Check Iptables status whether up or not ~]# service iptables statusġ ACCEPT all - 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHEDĤ ACCEPT tcp - 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22ĥ REJECT all - 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibitedġ REJECT all - 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited If Iptables not installed, simply run this command to install ~]# yum install iptablesĤ. Check Iptables version ~]# iptables -versionģ. Check iptables installed package ~]# rpm -qa | grep iptablesĢ. In this post, i will show on how to install, configure and use Iptables Firewall on CentOS 6.2 server :ġ. Next you need to enter a name for the firewall. The next window shows a preview of the configuration file that will be imported and the type of firewall that Firewall Builder has detected it to be. Iptables interfaces to the Linux netfilter module to perform filtering of network packets. Click the Continue button to move to the next step of the import process. It can be used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel. Iptables is the most popular packet filtering firewall package in linux.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |