Linuxがポートを開くことの詳細な説明

Linuxがポートを開くことの詳細な説明

1.まず、このフォルダが存在するかどうかを確認します

/etc/sysconfig/iptables

存在しない場合は、次のようにインストールする必要があります。

可以通过以下命令安装iptables防火墙
systemctl  stop firewalld
systemctl mask firewalld
yum install iptables-services
service iptables status
//设置开机启动
systemctl enable iptables

2. / etc / sysconfig / iptablesを編集します

在已经开放的22端口下面一行添加:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

3.変更、保存、終了後、ネットワークカードサービスを再起動します

service iptables restart

4.ステータスを確認します

service iptables status

5.開いているポートを表示する

iptables -L -n

》》》ブロガーは長い間学習体験を更新し、いいねを推薦してフォローします!
》》》コメント欄にメッセージを残してください、ありがとうございます!

おすすめ

転載: blog.csdn.net/qq_41622739/article/details/106310418