您的位置 首页 技术

如何找到centos中的iptables文件

如何找到centos中的iptables文件? 1随便写一条iptables命令配置个防火墙规则。如:iptables -P OUTPUT ACCEPT。 [root@iZ23gx…

如何找到centos中的iptables文件?

1随便写一条iptables命令配置个防火墙规则。如:iptables -P OUTPUT ACCEPT。

[root@iZ23gx7o02aZ /]# cd /etc/sysconfig/[root@iZ23gx7o02aZ sysconfig]# iptables -P OUTPUT ACCEPT

2. service iptables save进行保存。

[root@iZ23gx7o02aZ sysconfig]# service iptables saveiptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ][root@iZ23gx7o02aZ sysconfig]# lsatd         firstboot         iptables-config  networking       readonly-root  sshdauditd      grub              irqbalance       network-scripts  rhn            sysstatauthconfig  htcacheclean      kdump            ntpd             rngd           sysstat.ioconfcbq         httpd             kernel           ntpdate          rsyslog        system-config-firewallclock       i18n              keyboard         prelink          sandbox        system-config-firewall.oldconsole     init              modules          quota_nld        saslauthd      udevcpuspeed    ip6tables-config  netconsole       raid-check       selinuxcrond       iptables          network          readahead        smartmontools[root@iZ23gx7o02aZ sysconfig]#

3. service iptables restart命令重启:

[root@iZ23gx7o02aZ sysconfig]# service iptables restartiptables: Setting chains to policy ACCEPT: filter          [  OK  ]iptables: Flushing firewall rules:                         [  OK  ]iptables: Unloading modules:                               [  OK  ]iptables: Applying firewall rules:                         [  OK  ][root@iZ23gx7o02aZ sysconfig]#

相关参考:centOS教程

以上就是如何找到centos中的iptables文件的详细内容,更多请关注24课堂在线网其它相关文章!

本文来自网络,不代表24小时课堂在线立场,转载请注明出处:https://www.24ketang.cn/70047.html

为您推荐

返回顶部