admin管理员组

文章数量:1635678

最近局域网ping局域网的Ubuntu麒麟系统发现了这个错误,猜测是防火墙造成的,经过一番操作(下文详述),最终成功解决问题。

网上看到了不少Linux下如何关闭防火墙,无奈我使用的是基于Ubuntu的麒麟系统,文章中提到的方法基本都无法使用,各种服务不存在,文件不存在错误,直到找到了这篇文章《Destination Host Prohibited》,无奈我这个系统使用了--list命令也不显示行号,如何才能实现删除相关规则呢?

在另外一篇文章中找到了一个备份和恢复的命令,于是看到了希望!

[root@localhost ben.liu]# iptables-save > /etc/sysconfig/iptables.bak

[root@localhost ben.liu]# iptables -F INPUT

[root@localhost ben.liu]# service iptables status

Table: filter

Chain INPUT (policy ACCEPT)

num  target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)

num  target     prot opt source               destination         

1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT)

num  target     prot opt source               destination         

恢复以前保存的记录:

[root@localhost ben.liu]# iptables-restore /etc/sysconfig/iptables.bak 

1.首先使用

iptables-save /home/greatwall/iptables.bak

命令保存防火墙规则。

2.备份导出的文件,修改文件内容,只要有

reject-with icmp-host-prohibited

的行,全部删除!

3.使用

iptables-restore /home/greatwall/iptables.bak

命令恢复防火墙规则。

4.使用iptables -L命令查看当前规则,确认无

reject-with icmp-host-prohibited

5. 测试ping

本文标签: 防火墙UbuntudestinationProhibitedHost