Skip to content

Instantly share code, notes, and snippets.

@bashkirtsevich
Last active April 24, 2019 18:26
Show Gist options
  • Save bashkirtsevich/3fcabc7373a4d7d8cc6f83d4a9d6d7f7 to your computer and use it in GitHub Desktop.
Save bashkirtsevich/3fcabc7373a4d7d8cc6f83d4a9d6d7f7 to your computer and use it in GitHub Desktop.
iptables add rule

iptables Как открыть порты в CentOS 6.4 Linux

https://www.first2host.co.uk/f/open-port-iptables/

Для нормальной работы Web сервера на Centos 6.3 на Web сервере необходимо открыть следующие порты:

22 ssh

80 http

443 https

25 smtp сервер

В терминале Centos 6.3 последовательно выполните следующие команды:

su
iptables -I INPUT -p tcp --dport 22 -m state --state NEW -j ACCEPT
iptables -I INPUT -p tcp --dport 80 -m state --state NEW -j ACCEPT
iptables -I INPUT -p tcp --dport 443 -m state --state NEW -j ACCEPT
iptables -I INPUT -p tcp --dport 25 -m state --state NEW -j ACCEPT
service iptables save

Перезагружаем iptables:

systemctl restart iptables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment