Linux 如何開啟埠.
舉例:
開放10000埠的解決步驟如下:
1、修改/etc/sysconfig/iptables檔案,增加如下一行:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 10000 -j ACCEPT
重啟 iptables
service iptables restart
2、重啟防火牆,這裡有兩種方式重啟防火牆 a) 重啟後生效
開啟: chkconfig iptables on
關閉: chkconfig iptables off b) 即時生效,重啟後失效
開啟: service iptables start
關閉: service iptables stop
3、或者用menu-system-administration-firewall
去新增使用者需要的埠。
By the way:
a. netstat -tanp 去顯示埠狀態。
/usr/sbin/lsof -i
b. telnet ipaddr port
to check if ip and port is available before making connection。
Linux 如何開啟埠.
舉例:
開放10000埠的解決步驟如下:
1、修改/etc/sysconfig/iptables檔案,增加如下一行:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 10000 -j ACCEPT
重啟 iptables
service iptables restart
2、重啟防火牆,這裡有兩種方式重啟防火牆 a) 重啟後生效
開啟: chkconfig iptables on
關閉: chkconfig iptables off b) 即時生效,重啟後失效
開啟: service iptables start
關閉: service iptables stop
3、或者用menu-system-administration-firewall
去新增使用者需要的埠。
By the way:
a. netstat -tanp 去顯示埠狀態。
/usr/sbin/lsof -i
b. telnet ipaddr port
to check if ip and port is available before making connection。