Linux 如何打开端口

举例:tcp

 开放10000端口的解决步骤以下: spa

 一、修改/etc/sysconfig/iptables文件,增长以下一行:  rest

 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 10000 -j ACCEPTip

重启 iptablesit

service iptables restart
 
 二、重启防火墙,这里有两种方式重启防火墙   a) 重启后生效
  开启: chkconfig iptables on
  关闭: chkconfig iptables off   b) 即时生效,重启后失效
  开启: service iptables start
io

  关闭: service iptables stop   table

  三、或者用menu-system-administration-firewall class

       去添加用户须要的端口。iptables

By the way:service

 a.  netstat -tanp 去显示端口状态。

     /usr/sbin/lsof -i 

 

b. telnet ipaddr port

    to check if ip and port is available before making connection.

相关文章
相关标签/搜索