<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wiki.blaxeen.com/index.php?action=history&amp;feed=atom&amp;title=Script_d%27init_iptables</id>
	<title>Script d&#039;init iptables - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blaxeen.com/index.php?action=history&amp;feed=atom&amp;title=Script_d%27init_iptables"/>
	<link rel="alternate" type="text/html" href="https://wiki.blaxeen.com/index.php?title=Script_d%27init_iptables&amp;action=history"/>
	<updated>2026-04-18T12:19:38Z</updated>
	<subtitle>Historique des révisions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki.blaxeen.com/index.php?title=Script_d%27init_iptables&amp;diff=3256&amp;oldid=prev</id>
		<title>Admin : Page créée avec « &lt;pre&gt; #! /bin/sh  ### BEGIN INIT INFO # Provides:             iptables # Required-Start:       $network $syslog # Required-Stop:        $network $syslog # Default-Start:  ... »</title>
		<link rel="alternate" type="text/html" href="https://wiki.blaxeen.com/index.php?title=Script_d%27init_iptables&amp;diff=3256&amp;oldid=prev"/>
		<updated>2013-08-22T12:12:01Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « &amp;lt;pre&amp;gt; #! /bin/sh  ### BEGIN INIT INFO # Provides:             iptables # Required-Start:       $network $syslog # Required-Stop:        $network $syslog # Default-Start:  ... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#! /bin/sh&lt;br /&gt;
&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:             iptables&lt;br /&gt;
# Required-Start:       $network $syslog&lt;br /&gt;
# Required-Stop:        $network $syslog&lt;br /&gt;
# Default-Start:        2 3 4 5&lt;br /&gt;
# Default-Stop:         0 1 6&lt;br /&gt;
# Short-Description:    IPTables firewall&lt;br /&gt;
# Description:          Standard rules for IPTables firewall&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&lt;br /&gt;
# Initialisation des variables&lt;br /&gt;
SHELL=&amp;quot;/bin/sh&amp;quot;;&lt;br /&gt;
PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin&amp;quot;;&lt;br /&gt;
IPTABLES_RULES=&amp;quot;/etc/network/iptables-rules&amp;quot;;&lt;br /&gt;
IPTABLES_START=&amp;quot;/etc/network/iptables-start.sh&amp;quot;;&lt;br /&gt;
IPTABLES_STOP=&amp;quot;/etc/network/iptables-stop.sh&amp;quot;;&lt;br /&gt;
INTERNET_NIC=&amp;quot;eth0&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
iptables_start() {&lt;br /&gt;
        echo &amp;quot;Starting iptables firewall...&amp;quot;;&lt;br /&gt;
        if [ -f $IPTABLES_RULES ]&lt;br /&gt;
        then&lt;br /&gt;
                iptables-restore &amp;lt; $IPTABLES_RULES;&lt;br /&gt;
                echo &amp;quot;1&amp;quot; &amp;gt; &amp;quot;/proc/sys/net/ipv4/ip_forward&amp;quot;;&lt;br /&gt;
        else&lt;br /&gt;
                echo &amp;quot;File $IPTABLES_RULES doesn&amp;#039;t exist.&amp;quot;;&lt;br /&gt;
                exit 1;&lt;br /&gt;
        fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
iptables_stop() {&lt;br /&gt;
        echo &amp;quot;Stopping iptables firewall...&amp;quot;;&lt;br /&gt;
        if [ -x $IPTABLES_STOP ]&lt;br /&gt;
        then&lt;br /&gt;
                sh $IPTABLES_STOP;&lt;br /&gt;
                echo &amp;quot;0&amp;quot; &amp;gt; &amp;quot;/proc/sys/net/ipv4/ip_forward&amp;quot;;&lt;br /&gt;
        else&lt;br /&gt;
                echo &amp;quot;File $IPTABLES_STOP doesn&amp;#039;t exist or is not an executable.&amp;quot;;&lt;br /&gt;
                exit 1;&lt;br /&gt;
        fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
iptables_save() {&lt;br /&gt;
        echo &amp;quot;Saving iptables configuration...&amp;quot;;&lt;br /&gt;
        if [ -x $IPTABLES_START ]&lt;br /&gt;
        then&lt;br /&gt;
                sh $IPTABLES_START;&lt;br /&gt;
                iptables-save &amp;gt; $IPTABLES_RULES;&lt;br /&gt;
        else&lt;br /&gt;
                echo &amp;quot;File $IPTABLES_START doesn&amp;#039;t exist or is not an executable.&amp;quot;;&lt;br /&gt;
                exit 1;&lt;br /&gt;
        fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
iptables_status() {&lt;br /&gt;
        iptables -L -n -v;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
iptables_panic() {&lt;br /&gt;
        echo &amp;quot;Entering panic mode, closing ALL connections...&amp;quot;;&lt;br /&gt;
        iptables --table filter --flush;&lt;br /&gt;
        iptables --table filter --delete-chain;&lt;br /&gt;
        iptables --table filter INPUT --jump DROP;&lt;br /&gt;
        iptables --table filter FORWARD --jump DROP;&lt;br /&gt;
        iptables --table filter OUTPUT --jump DROP;&lt;br /&gt;
        iptables --table filter --append INPUT --in-interface lo --protocol all --jump ACCEPT;&lt;br /&gt;
        iptables --table filter --append OUTPUT --out-interface lo --protocol all --jump ACCEPT;&lt;br /&gt;
        iptables --table filter --append FORWARD --in-interface lo --protocol all --jump ACCEPT;&lt;br /&gt;
        iptables --table filter --append FORWARD --out-interface lo --protocol all --jump ACCEPT;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
case $1 in&lt;br /&gt;
        start)&lt;br /&gt;
                iptables_start &amp;amp;&amp;amp; exit 0;&lt;br /&gt;
        ;;&lt;br /&gt;
&lt;br /&gt;
        stop)&lt;br /&gt;
                iptables_stop &amp;amp;&amp;amp; exit 0;&lt;br /&gt;
        ;;&lt;br /&gt;
&lt;br /&gt;
        restart | reload)&lt;br /&gt;
                iptables_stop &amp;amp;&amp;amp; iptables_start &amp;amp;&amp;amp; exit 0;&lt;br /&gt;
        ;;&lt;br /&gt;
&lt;br /&gt;
        save)&lt;br /&gt;
                iptables_save &amp;amp;&amp;amp; exit 0;&lt;br /&gt;
        ;;&lt;br /&gt;
        status)&lt;br /&gt;
                iptables_status &amp;amp;&amp;amp; exit 0;&lt;br /&gt;
        ;;&lt;br /&gt;
        panic)&lt;br /&gt;
                iptables_panic &amp;amp;&amp;amp; exit 0;&lt;br /&gt;
        ;;&lt;br /&gt;
        *)&lt;br /&gt;
                echo &amp;quot;Usage: /etc/init.d/iptables start|stop|restart|reload|save|status|panic&amp;quot;;&lt;br /&gt;
        ;;&lt;br /&gt;
esac;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Catégorie:Script]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>