How to open port in Linux
First, you should disable selinux
, edit file /etc/sysconfig/selinux
so it looks like this:
SELINUX=disabled
SELINUXTYPE=targeted
Save file and restart system.
Then you can add the new rule to iptables
:
iptables -A INPUT -m state --state NEW -p tcp --dport 8080 -j ACCEPT
and restart iptables with /etc/init.d/iptables restart
If it doesn't work you should check other network settings.
Open port on Centos 8
Check port status
netstat -na | grep 61009
Check port status in iptables
iptables-save | grep 61009
Add the port
# vi /etc/services
service-name port/protocol [aliases ...] [# comment]Open port in the firewall
# firewall-cmd --zone=public --add-port=61009/tcp --permanent
success
# firewall-cmd --reload
success
# iptables-save | grep 61009
-A IN_public_allow -p tcp -m tcp --dport 61009 -m conntrack --ctstate NEW -j ACCEPTCheck added port status
lsof -i -P |grep http
netstat -na |grep 61009
How to open port 80 for node server on local machine?
Paste the output from
netstat -ptuln
command.I think the problem is that your web server runs on local address and can not be reachable for other machines in network.
centos 7 open port is open but not working
In some countries port 5060 is blocked by ISP
what i understand you opened the port in your virtual machine.
you need to open the port in VPS host panel security group as well.
Related Topics
Bash Variable Assignment Not Working Expected
How to Format My Grep Output to Show Line Numbers at the End of the Line, and Also the Hit Count
Linux Kernel "Historical" Git Repository with Full History
How to Install Crontab on Centos
Best Distributed Filesystem for Commodity Linux Storage Farm
Why Does the Linux Kernel Repository Have Only One Branch
Changing Name of the Video While Downloading via Youtube-Dl
Tmux: Hangs and Do Not Load, and Do Not Respond to Any Option Command
How to Take Ownership of a Hid Device
How to Use Curl in a Shell Script
I Want to Remove Multiple Line of Text on Linux
How to Check If a Service That I Don't Know the Name of Is Running on Ubuntu
How to Recompile Just a Single Kernel Module
JSON Command Line Formatter Tool for Linux
How to Set Nginx Max Open Files
What Is the Reason and How to Avoid the [Fin, Ack] , [Rst] and [Rst, Ack]