2002-07-08 04:28:42 +08:00
|
|
|
<sect3 id="postlfs-security-fw-stop" xreflabel="/etc/rc.d/init.d/firewall.stop">
|
|
|
|
<title>firewall.stop</title>
|
|
|
|
|
|
|
|
<para>If you need to turn firewalling off, this script will do it:</para>
|
|
|
|
|
2003-09-12 03:44:39 +08:00
|
|
|
<screen><userinput><command>cat > /etc/rc.d/init.d/firewall.stop << "EOF"</command>
|
2002-07-08 04:28:42 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Being $rc_base/init.d/firewall.stop
|
|
|
|
|
|
|
|
# deactivate IP-Forwarding
|
|
|
|
echo 0 > /proc/sys/net/ipv4/ip_forward
|
|
|
|
|
|
|
|
iptables -Z
|
|
|
|
iptables -F
|
|
|
|
iptables -t nat -F PREROUTING
|
|
|
|
iptables -t nat -F OUTPUT
|
|
|
|
iptables -t nat -F POSTROUTING
|
|
|
|
iptables -t mangle -F PREROUTING
|
|
|
|
iptables -t mangle -F OUTPUT
|
|
|
|
iptables -X
|
|
|
|
iptables -P INPUT ACCEPT
|
|
|
|
iptables -P FORWARD ACCEPT
|
|
|
|
iptables -P OUTPUT ACCEPT
|
2003-09-12 03:44:39 +08:00
|
|
|
<command>EOF</command></userinput></screen>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
|
|
|
</sect3>
|