CentOS7 服务启动命令

来源:互联网 发布:建阿里云网站视频教程 编辑:程序博客网 时间:2024/05/17 02:21

【CentOS7】服务启动命令与【CentOS5/6】不一样

常用的命令有:

systemctl disable networkmanager.service            //disable禁止开机启动 enable开机启动    

systemctl stop networkmanager.service                 //stop关闭网络还原服务 start/restart

systemctl disable firewalld.service                                        //禁止firewalld防火墙开机启动

systemctl stop firewalld.service                                             //关闭firewalld防火墙

systemctl disable iptables.service                                       //禁止iptables防火墙开机启动

systemctl stop iptables.service                                           //关闭iptables防火墙

systemctl restart network                                        //重启网卡服务

systemctl list-unit-files                                            //列出服务

ip addr                                                                       //查看IP


PS:

centos5/6:service 服务名 start|stop|restart             ifconfig  //查看IP

centos7:   systemctl start|stop|restart 服务名        ip addr  //查看IP


启用iptables防火墙:yum install iptables-services

                                      systemctl enable iptables.service

                            systemctl restart iptables.service


1 0