CentOs Open Port in Firewall

علی ذوالفقار
1401/01/21 09:48:36 (499)
get server detail :
uname -a
cat /etc/redhat-release

Check Port Status :
netstat -na | grep 8080
lsof -i -P |grep http

Check Port Status in iptables :
iptables-save | grep 8080

Add the port :
Add the port Add the test port in /etc/services file and allow the port to accept packets. Test port can be added by editing /etc/services file in below format:
vi /etc/services
service-name port/protocol [aliases ...] [# comment]
testport 8080/tcp # Application Name

Open firewall ports :
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload
iptables-save | grep 8080 firewall-cmd --permanent --add-port=8080/tcp firewall-cmd --permanent --add-port=8080/udp firewall-cmd --reload
Back