如何找到centos中的iptables文件


本文摘自PHP中文网,作者WJ,侵删。

如何找到centos中的iptables文件

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

1

2

[root@iZ23gx7o02aZ /]# cd /etc/sysconfig/

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

2. service iptables save进行保存。

1

2

3

4

5

6

7

8

9

10

11

12

[root@iZ23gx7o02aZ sysconfig]# service iptables save

iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

[root@iZ23gx7o02aZ sysconfig]# ls

atd         firstboot         iptables-config  networking       readonly-root  sshd

auditd      grub              irqbalance       network-scripts  rhn            sysstat

authconfig  htcacheclean      kdump            ntpd             rngd           sysstat.ioconf

cbq         httpd             kernel           ntpdate          rsyslog        system-config-firewall

clock       i18n              keyboard         prelink          sandbox        system-config-firewall.old

console     init              modules          quota_nld        saslauthd      udev

cpuspeed    ip6tables-config  netconsole       raid-check       selinux

crond       iptables          network          readahead        smartmontools

[root@iZ23gx7o02aZ sysconfig]#

3. service iptables restart命令重启:

1

2

3

4

5

6

[root@iZ23gx7o02aZ sysconfig]# service 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@iZ23gx7o02aZ sysconfig]#

相关参考:centOS教程

以上就是如何找到centos中的iptables文件的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

CentOS系统dns不生效

CentOS下tomcat不能远程访问

CentOS系统下文件夹名称乱码

CentOS系统如何备份

怎么看CentOS的版本

CentOS安装时找不到硬盘

CentOS如何启动apache服务

CentOS怎么运行sh?

CentOS系统如何安装gcc编译器

CentOS下vim显示中文乱码怎么办

更多相关阅读请进入《CentOS》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    正在狠努力加载,请稍候...