Marlen Niemczeski Posted November 14, 2014 Share Posted November 14, 2014 Bom estou com dificuldades em fazer a liberação de portas no iptables. Seguinte, so quero liberar uma unica porta que sera a do mysql 3306. Uso CentOS na minha VPS de teste. Seria exatamente mudar o arquivo /etc/sysconfig/iptables que originalmente estaria assim: # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT Para liberar GERAL ficaria assim: # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT Mas oque realmente quero é somente liberar o ip da minha hospedagem para ter essa porta liberada. Porque? Porque estão invadindo meu mysql por essa porta. Mas preciso dela aberta para o acesso remoto do site. Alguem pode me ajudar a fazer isso? Pro exemplo, quero somente o ip 123.1.1.1 tenha acesso a essa porta. Os demais não. Desde já obrigado! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.