码迷,mamicode.com
首页 > 其他好文 > 详细

centos6.5虚拟机安装后,没有iptables配置文件

时间:2016-08-31 14:08:36      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:

 

openstack环境里安装centos6.5系统的虚拟机,安装好后,发现没有/etc/syscofig/iptables防火墙配置文件。

解决办法如下:

[root@kvm-server005 ~]# iptables -P OUTPUT ACCEPT
[root@kvm-server005 ~]# /etc/init.d/iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]

这样,/etc/sysconfig/iptables配置文件就有了
[root@kvm-server005 ~]# cat /etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Wed Aug 31 01:14:57 2016
*filter
:INPUT ACCEPT [43:3196]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [23:2380]
COMMIT
# Completed on Wed Aug 31 01:14:57 2016


再补充点其他内容配置:
[root@kvm-server005 ~]# cat /etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Wed Aug 31 01:14:57 2016
*filter
:INPUT ACCEPT [43:3196]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [23:2380]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Wed Aug 31 01:14:57 2016
[root@kvm-server005 ~]# /etc/init.d/iptables restart
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]
[root@kvm-server005 ~]#

centos6.5虚拟机安装后,没有iptables配置文件

标签:

原文地址:http://www.cnblogs.com/kevingrace/p/5825530.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!