CentOS------常用命令
1.使用root登录
su root
2.查看ip地址
ip addr
3.端口使用部分
//查看开放端口
firewall-cmd --zone=public --list-ports
//开放端口(例子:开放6379端口)
firewall-cmd --zone=public --add-port=6379/tcp --permanent
//关闭端口
firewall-cmd --zone=public --remove-port=5672/tcp --permanent
//查看防火墙状态
firewall-cmd --state
systemctl status firewalld
//启动防火墙/允许开机启动
systemctl start firewalld
systemctl enable firewalld
//关闭防火墙/禁止开机启动
systemctl stop firewalld.service
systemctl disable firewalld
//重启防火墙
systemctl restart firewalld
//静止防火墙开机启动
systemctl disable firewalld.servic