小白询问一下,根据网上的答案我试了
网上教程
使用 ufw
- 启用
ufw防火墙:
sudo ufw enable
- 允许特定IP访问特定端口(例如,允许IP地址
192.168.1.100访问端口22):
sudo ufw allow from 192.168.1.100 to any port 22
- 查看防火墙状态:
sudo ufw status verbose
我的输入
下面的终端信息只保留了5984端口相关的内容,无关端口我删掉了,不是显示错误
root@was:~# ufw deny 5984
Rule updated
Rule updated (v6)
root@was:~# sudo ufw allow from 38.148.249.39 to any port 5984
Skipping adding existing rule
root@was:~# ufw status
Status: active
To Action From
-- ------ ----
5984 ALLOW 38.148.249.39
5984 DENY Anywhere
5984 (v6) DENY Anywhere (v6)
但结果我随便用一台设备还是能连接http://154.23.243.149:5984/ 请问怎么回事?