安装:
#安装Setup命令工具 yum -y install setuptool #安装Setup工具配套的系统服务组件 yum -y install ntsysv #安装Setup工具配套的防火墙配置组件 yum -y install system-config-securitylevel-tui #安装Setup工具配套的网络配置组件 yum -y install system-config-network-tui #安装Setup工具配套的验证配置组件 yum -y install authconfig-gtk #安装Setup工具配套的键盘配置组件 yum -y install system-config-keyboard
使用:
setup
开始配置防火墙, 报错:
ERROR: FirewallD is active, please use firewall-cmd.提示使用firewall-cmd:
方法:
Open a Port on CentOS/RHEL 7
Starting with CentOS and RHEL 7, firewall rule settings are managed by firewalld service daemon. A command-line client called firewall-cmd can talk to this daemon to update firewall rules permanently.
To open up a new port (e.g., TCP/80) permanently, use these commands.
//执行命令
$ sudo firewall-cmd --zone=public --add-port=80/tcp --permanent(永久)
$ sudo firewall-cmd --reload
Without "--permanent" flag, the firewall rule would not persist across reboots.
[root@localhost ~]# firewall-cmd --query-port=21/tcp (查看端口状态)
no
[root@localhost ~]# firewall-cmd --zone=public --add-port=21/tcp(临时添加端口)
success
[root@localhost ~]# firewall-cmd --reload(重启后关闭)
success
[root@localhost ~]# firewall-cmd --query-port=21/tcp
no
推荐阅读:http://ask.xmodulo.com/open-port-firewall-centos-rhel.html
https://www.5yun.org/10074.html