Buscar este blog

viernes, 23 de junio de 2017

CentOS - Iptables - Open TCP ports

In order to open TCP ports in a CentOS 6 machine you have to edit the following files:
  • /etc/sysconfig/iptables
  • /etc/sysconfig/ip6tables

For example, to open HTTP and HTTPS ports, you can use the following lines:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

Then, just restart the services:
[root@ servidor ~]# /etc/init.d/iptables restart
[root@ servidor ~]# /etc/init.d/ip6tables restart

No hay comentarios:

Publicar un comentario