linux 防火墙

伟洪winni 2017-12-27 05:25:21
添加3306端口, 重启时, 3306端口怎么就没了?

[root@localhost ~]# firewall-cmd --add-port=3306/tcp
[root@localhost ~]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: enp0s3
sources:
services: ssh dhcpv6-client
ports: 80/tcp 3306/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:

重启后3306 端口被移除了

[root@localhost ~]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: enp0s3
sources:
services: ssh dhcpv6-client
ports: 80/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
...全文
575 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
伟洪winni 2018-02-01
  • 打赏
  • 举报
回复
zxin1997 2018-01-05
  • 打赏
  • 举报
回复
你这不是没有保存规则吗
weixin_41585009 2018-01-04
  • 打赏
  • 举报
回复
直接写配置文件就好啦
伟洪winni 2018-01-04
  • 打赏
  • 举报
回复
--permanent 加上后可以了
weiweihu712 2017-12-27
  • 打赏
  • 举报
回复
加上--permanent参数 # firewall-cmd --add-port=3306/tcp --permanent

18,773

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 专题技术讨论区
社区管理员
  • 专题技术讨论区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧