Linux 常见问题

目录

 

开启 / 关闭防火墙时显示“Failed to stop iptables.service”

ipconfig not found

ifcfg-eth0 File Not Found

 


开启 / 关闭防火墙时显示“Failed to stop iptables.service”

问题描述

运行“service iptables stop”来关闭防火墙时,系统提示:Failed to stop iptables.service: Unit iptables.service not loaded.

Linux 常见问题

原因分析

这是因为在CentOS 7中,防火墙由Firewalld 管理。

解决方案

可以还原为传统的管理方式,命令如下:

systemctl stop firewalld
systemctl mask firewalld

Linux 常见问题

随后就可以使用传统命令控制防火墙了。

Linux 常见问题

 

ipconfig not found

问题描述

在运行ipconfig的时候,报错“bash: ipconfig: 未找到命令”。

Linux 常见问题

原因分析

因为CentOS 7 中不用ipconfg了,直接是ip

解决方案

使用 ip addr

 

ifcfg-eth0 File Not Found

问题描述

在修改静态IP时,network-scripts文件目录下没有 ifcfg-eth0文件,只有 ifcfg-ens33 文件。

解决方案

将ifcfg-ens33重命名为ifcfg-eth0即可。