专注各种脚本编程
Baidu
加入收藏夹
本站内容有下面分类知识,欢迎您的到来^_^
shell相关:指令篇 基础篇 脚本欣赏 编程实例 shell问问 shell视频教程 技巧篇 水平测试 E文资料 vi编辑器 高级Bash脚本编程指南
其他:mysql perl c语言 oracle
当前位置:| 主页>shell脚本欣赏>

Linux防火墙:简单的shell脚本实现停止/更新所有Iptables规则

百度收藏 QQ搜藏

原文:http://bash.cyberciti.biz/security/shell-script-to-stop-linux-firewall/

一些Linux桌面版本(如 Debian)没有 /etc/init.d/iptables 脚本,因此可以采用下面shell脚本。

以下是该shell脚本的源代码:

#!/bin/bash
# Linux Firewall: Simple Shell Script To Stop and Flush All Iptables Rules
# Some Linux distros like Debian do not have /etc/init.d/iptables stop script
# This can be also called from cron job if you are testing new firewall on
# remote box to avoid lock out
# -------------------------------------------------------------------------
# Copyright (c) 2004 nixCraft project <http://cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
上一篇:用rsync对远程服务器数据进行镜像备份之shell脚本 下一篇:shell脚本(功能:结合pwgen/chpasswd命令批量更新用户密码)

power by soyo123 2007-2008