Linux---- 防火墙

查看防火墙状态

systemctl status firewalld

关闭防火墙

systemctl stop firewalld

永久关闭防火墙

systemctl stop firewalld
systemctl disable firewalld

打开防火墙

systemctl start firewalld

查看所有已开放的临时端口

firewall-cmd --list-ports

查看所有永久开放的端口

firewall-cmd --list-ports --permanent

添加临时开放端口

(例如:比如我修改ssh远程连接端口是223,则需要开放这个端口)

firewall-cmd --add-port=223/tcp

添加永久开放的端口

(例如:223端口)

firewall-cmd --add-port=223/tcp --permanent

关闭临时端口

firewall-cmd --remove-port=80/tcp

关闭永久端口

firewll-cmd --remove-port=80/tcp --permanent

重启以生效

firewall-cmd --reload

systemctl restart firewalld
相关推荐
深度Linux2 小时前
Linux网络编程中的零拷贝:提升性能的秘密武器
linux·linux内核·零拷贝技术
m0_465215793 小时前
TCP & UDP Service Model
服务器·网络·tcp/ip
chian-ocean6 小时前
从理论到实践:Linux 进程替换与 exec 系列函数
linux·运维·服务器
拎得清n6 小时前
UDP编程
linux
敖行客 Allthinker6 小时前
从 UTC 日期时间字符串获取 Unix 时间戳:C 和 C++ 中的挑战与解决方案
linux·运维·服务器·c++
夏尔Gaesar7 小时前
Vim安装与配置教程(解决软件包Vim没有安装可候选)
linux·编辑器·vim
hunter2062068 小时前
如何监控ubuntu系统某个程序的运行状态,如果程序出现异常,对其自动重启。
linux·chrome·ubuntu
norsd8 小时前
MongoDb user自定义 role 添加 action(collStats, EstimateDocumentCount)
服务器·数据库·mongodb
慕雪华年9 小时前
【Linux】opencv在arm64上提示找不到libjasper-dev
linux·运维·opencv
_Eden_9 小时前
Keepalived高可用集群企业应用实例一
运维·服务器