恩,惨痛的教训。因为remove iptables会卸载很多系统组建,导致出现很多问题,比如无法上网,比如中文字体变成乱码。但只要还没重启服务器,还是有补救措施的。
在补救前仍要大喊三遍说明:
不要remove iptables
不要remove iptables
不要remove iptables
先放参考链接:https://unix.stackexchange.com/questions/121764/why-did-removing-iptables-break-my-network-access
简单说,就是先找一台干净的服务器,在服务器上使用:
yum install yum-utils
repoquery --whatrequires --installed --recursive iptables
第一个命令是安装yum的一个工具
第二个命令是搜索作为iptables的依赖有哪些组件
[root@ha-node1 ~]# repoquery --whatrequires --installed --recursive iptables
NetworkManager-1:1.4.0-12.el7.x86_64
NetworkManager-team-1:1.4.0-12.el7.x86_64
NetworkManager-tui-1:1.4.0-12.el7.x86_64
NetworkManager-wifi-1:1.4.0-12.el7.x86_64
dhclient-12:4.2.5-47.el7.centos.x86_64
dracut-network-0:033-463.el7.x86_64
firewalld-0:0.4.3.2-8.el7.noarch
initscripts-0:9.49.37-1.el7.x86_64
iproute-0:3.10.0-74.el7.x86_64
iptables-0:1.4.21-17.el7.x86_64
kbd-0:1.15.5-12.el7.x86_64
kexec-tools-0:2.0.7-50.el7.x86_64
plymouth-0:0.8.9-0.26.20140113.el7.centos.x86_64
plymouth-scripts-0:0.8.9-0.26.20140113.el7.centos.x86_64
将上述依赖组件全部安装一遍,我们在来看看网络是否恢复
[root@ha171 /root]#systemctl status network
● network.service – LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
Active: active (exited) since Mon 2018-12-03 22:36:54 CST; 4min 51s ago
Docs: man:systemd-sysv-generator(8)
Process: 23872 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS)
Process: 24001 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=0/SUCCESS)
Dec 03 22:36:53 ha171 systemd[1]: Starting LSB: Bring up/down networking…
Dec 03 22:36:53 ha171 network[24001]: 正在打开环回接口: [ 确定 ]
Dec 03 22:36:53 ha171 network[24001]: 正在打开接口 enp2s0: 连接已成功激活(D-Bus 活动路径:/org/freedesktop/NetworkManager/ActiveConnection/1)
Dec 03 22:36:54 ha171 network[24001]: [ 确定 ]
Dec 03 22:36:54 ha171 systemd[1]: Started LSB: Bring up/down networking.
网络已经恢复正常
好了,大体补救的措施就是这样,希望大家在执行remove前三思而行
from:https://www.cnblogs.com/jerry6415/p/10061607.html