Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centos7防火墙配置 #173

Open
v5tech opened this issue Jan 11, 2018 · 0 comments
Open

Centos7防火墙配置 #173

v5tech opened this issue Jan 11, 2018 · 0 comments

Comments

@v5tech
Copy link
Owner

v5tech commented Jan 11, 2018

firewall

查看状态

systemctl status firewalld

firewall-cmd --state
firewall-cmd --get-active-zones

firewall-cmd --permanent --zone=public --list-all

开放4222、5222端口

firewall-cmd --permanent --zone=public --add-port=4222/tcp

firewall-cmd --permanent --zone=public --add-port=5222/tcp

启用配置

systemctl enable firewalld

iptables

查看iptables

iptables-save

开放4222、5222端口

iptables -A IN_public_allow -p tcp -m tcp --dport 4222 -m conntrack --ctstate NEW -j ACCEPT

iptables -A IN_public_allow -p tcp -m tcp --dport 5222 -m conntrack --ctstate NEW -j ACCEPT

保存iptables配置

iptables-save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant