<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; Не запускается Iptables.]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=27289&amp;type=atom" />
	<updated>2013-04-21T18:18:49Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=27289</id>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341628#p341628" />
			<content type="html"><![CDATA[<p>Нет, поставил, проблема решена, спасибо.</p>]]></content>
			<author>
				<name><![CDATA[Gentoos]]></name>
				<uri>https://linuxforum.ru/profile.php?id=28923</uri>
			</author>
			<updated>2013-04-21T18:18:49Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341628#p341628</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341627#p341627" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Gentoos пишет:</cite><blockquote><div class="quotebox"><blockquote><p>iptables-restore /etc/sysconfig/iptables</p></blockquote></div><p><span class="postimg"><img src="http://data2.floomby.com/files/share/21_4_2013/NrF6CQe3o0GDFzWtSY5Ug.jpg" alt="http://data2.floomby.com/files/share/21_4_2013/NrF6CQe3o0GDFzWtSY5Ug.jpg" /></span></p></blockquote></div><p>После COMMIT пустую строку вставили?</p>]]></content>
			<author>
				<name><![CDATA[urfin]]></name>
				<uri>https://linuxforum.ru/profile.php?id=28931</uri>
			</author>
			<updated>2013-04-21T18:18:29Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341627#p341627</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341623#p341623" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>iptables-restore /etc/sysconfig/iptables</p></blockquote></div><p><span class="postimg"><img src="http://data2.floomby.com/files/share/21_4_2013/NrF6CQe3o0GDFzWtSY5Ug.jpg" alt="http://data2.floomby.com/files/share/21_4_2013/NrF6CQe3o0GDFzWtSY5Ug.jpg" /></span></p>]]></content>
			<author>
				<name><![CDATA[Gentoos]]></name>
				<uri>https://linuxforum.ru/profile.php?id=28923</uri>
			</author>
			<updated>2013-04-21T18:17:26Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341623#p341623</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341621#p341621" />
			<content type="html"><![CDATA[<p>Вставьте пустую строчку после COMMIT и попробуйте снова выполнить</p><div class="codebox"><pre><code># service iptables start</code></pre></div><br /><p>ps. Если у себя уберу перевод строки после COMMIT, тоже получу вашу ошибку один в один.</p>]]></content>
			<author>
				<name><![CDATA[bormant]]></name>
				<uri>https://linuxforum.ru/profile.php?id=732</uri>
			</author>
			<updated>2013-04-21T18:17:00Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341621#p341621</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341620#p341620" />
			<content type="html"><![CDATA[<p>Поставьте после COMMIT переход на новую строку.</p>]]></content>
			<author>
				<name><![CDATA[urfin]]></name>
				<uri>https://linuxforum.ru/profile.php?id=28931</uri>
			</author>
			<updated>2013-04-21T18:16:56Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341620#p341620</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341619#p341619" />
			<content type="html"><![CDATA[<p>Короче, нужен выхлоп команд</p><div class="codebox"><pre><code>iptables-restore /etc/sysconfig/iptables</code></pre></div><p>и <br /></p><div class="codebox"><pre><code># hexdump -C /etc/sysconfig/iptables</code></pre></div>]]></content>
			<author>
				<name><![CDATA[urfin]]></name>
				<uri>https://linuxforum.ru/profile.php?id=28931</uri>
			</author>
			<updated>2013-04-21T18:14:32Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341619#p341619</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341618#p341618" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Откуда взялось содержимое /etc/sysconfig/iptables?</p></blockquote></div><p>Стандарт.</p>]]></content>
			<author>
				<name><![CDATA[Gentoos]]></name>
				<uri>https://linuxforum.ru/profile.php?id=28923</uri>
			</author>
			<updated>2013-04-21T18:13:27Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341618#p341618</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341617#p341617" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>00000000  23 20 4d 61 6e 75 61 6c  20 63 75 73 74 6f 6d 69  |# Manual customi|
00000010  7a 61 74 69 6f 6e 20 6f  66 20 74 68 69 73 20 66  |zation of this f|
00000020  69 6c 65 20 69 73 20 6e  6f 74 20 72 65 63 6f 6d  |ile is not recom|
00000030  6d 65 6e 64 65 64 2e 0a  2a 66 69 6c 74 65 72 0a  |mended..*filter.|
00000040  3a 49 4e 50 55 54 20 41  43 43 45 50 54 20 5b 30  |:INPUT ACCEPT [0|
00000050  3a 30 5d 0a 3a 46 4f 52  57 41 52 44 20 41 43 43  |:0].:FORWARD ACC|
00000060  45 50 54 20 5b 30 3a 30  5d 0a 3a 4f 55 54 50 55  |EPT [0:0].:OUTPU|
00000070  54 20 41 43 43 45 50 54  20 5b 30 3a 30 5d 0a 2d  |T ACCEPT [0:0].-|
00000080  41 20 49 4e 50 55 54 20  2d 6d 20 73 74 61 74 65  |A INPUT -m state|
00000090  20 2d 2d 73 74 61 74 65  20 45 53 54 41 42 4c 49  | --state ESTABLI|
000000a0  53 48 45 44 2c 52 45 4c  41 54 45 44 20 2d 6a 20  |SHED,RELATED -j |
000000b0  41 43 43 45 50 54 0a 2d  41 20 49 4e 50 55 54 20  |ACCEPT.-A INPUT |
000000c0  2d 70 20 69 63 6d 70 20  2d 6a 20 41 43 43 45 50  |-p icmp -j ACCEP|
000000d0  54 0a 2d 41 20 49 4e 50  55 54 20 2d 69 20 6c 6f  |T.-A INPUT -i lo|
000000e0  20 2d 6a 20 41 43 43 45  50 54 0a 2d 41 20 49 4e  | -j ACCEPT.-A IN|
000000f0  50 55 54 20 2d 6d 20 73  74 61 74 65 20 2d 2d 73  |PUT -m state --s|
00000100  74 61 74 65 20 4e 45 57  20 2d 6d 20 74 63 70 20  |tate NEW -m tcp |
00000110  2d 70 20 74 63 70 20 2d  2d 64 70 6f 72 74 20 32  |-p tcp --dport 2|
00000120  32 20 2d 6a 20 41 43 43  45 50 54 0a 2d 41 20 46  |2 -j ACCEPT.-A F|
00000130  4f 52 57 41 52 44 20 2d  6a 20 52 45 4a 45 43 54  |ORWARD -j REJECT|
00000140  20 2d 2d 72 65 6a 65 63  74 2d 77 69 74 68 20 69  | --reject-with i|
00000150  63 6d 70 2d 68 6f 73 74  2d 70 72 6f 68 69 62 69  |cmp-host-prohibi|
00000160  74 65 64 0a 43 4f 4d 4d  49 54                    |ted.COMMIT|
0000016a</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Gentoos]]></name>
				<uri>https://linuxforum.ru/profile.php?id=28923</uri>
			</author>
			<updated>2013-04-21T18:12:43Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341617#p341617</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341614#p341614" />
			<content type="html"><![CDATA[<p>В конечном итоге выполняется </p><div class="codebox"><pre><code>iptables-restore /etc/sysconfig/iptables</code></pre></div><p>Если выполнить руками приведённую выше команду, получите те же ошибки?<br />Откуда взялось содержимое /etc/sysconfig/iptables?</p><p>Например, если я вставлю пробел в пустой строке перед COMMIT, то получу аналогичную ошибку:</p><div class="codebox"><pre><code># iptables-restore tst
iptables-restore v1.4.14: no command specified
Error occurred at line: 11
Try `iptables-restore -h&#039; or &#039;iptables-restore --help&#039; for more information.</code></pre></div><p>Можем вместе посмотреть внимательнее на ваш файл, если покажете результат выполнения</p><div class="codebox"><pre><code># hexdump -C /etc/sysconfig/iptables</code></pre></div>]]></content>
			<author>
				<name><![CDATA[bormant]]></name>
				<uri>https://linuxforum.ru/profile.php?id=732</uri>
			</author>
			<updated>2013-04-21T18:09:01Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341614#p341614</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341611#p341611" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#!/bin/sh
#
# iptables    Start iptables firewall
#
# chkconfig: 2345 08 92
# description:    Starts, stops and saves iptables firewall
#
# config: /etc/sysconfig/iptables
# config: /etc/sysconfig/iptables-config
#
### BEGIN INIT INFO
# Provides: iptables
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop iptables firewall
# Description: Start, stop and save iptables firewall
### END INIT INFO

# Source function library.
. /etc/init.d/functions

IPTABLES=iptables
IPTABLES_DATA=/etc/sysconfig/$IPTABLES
IPTABLES_FALLBACK_DATA=${IPTABLES_DATA}.fallback
IPTABLES_CONFIG=/etc/sysconfig/${IPTABLES}-config
IPV=${IPTABLES%tables} # ip for ipv4 | ip6 for ipv6
[ &quot;$IPV&quot; = &quot;ip&quot; ] &amp;&amp; _IPV=&quot;ipv4&quot; || _IPV=&quot;ipv6&quot;
PROC_IPTABLES_NAMES=/proc/net/${IPV}_tables_names
VAR_SUBSYS_IPTABLES=/var/lock/subsys/$IPTABLES

# only usable for root
[ $EUID = 0 ] || exit 4

if [ ! -x /sbin/$IPTABLES ]; then
    echo -n $&quot;${IPTABLES}: /sbin/$IPTABLES does not exist.&quot;; warning; echo
    exit 5
fi

# Old or new modutils
/sbin/modprobe --version 2&gt;&amp;1 | grep -q module-init-tools \
    &amp;&amp; NEW_MODUTILS=1 \
    || NEW_MODUTILS=0

# Default firewall configuration:
IPTABLES_MODULES=&quot;&quot;
IPTABLES_MODULES_UNLOAD=&quot;yes&quot;
IPTABLES_SAVE_ON_STOP=&quot;no&quot;
IPTABLES_SAVE_ON_RESTART=&quot;no&quot;
IPTABLES_SAVE_COUNTER=&quot;no&quot;
IPTABLES_STATUS_NUMERIC=&quot;yes&quot;
IPTABLES_STATUS_VERBOSE=&quot;no&quot;
IPTABLES_STATUS_LINENUMBERS=&quot;yes&quot;
IPTABLES_SYSCTL_LOAD_LIST=&quot;&quot;

# Load firewall configuration.
[ -f &quot;$IPTABLES_CONFIG&quot; ] &amp;&amp; . &quot;$IPTABLES_CONFIG&quot;

# Netfilter modules
NF_MODULES=($(lsmod | awk &quot;/^${IPV}table_/ {print \$1}&quot;) ${IPV}_tables)
NF_MODULES_COMMON=(x_tables nf_nat nf_conntrack) # Used by netfilter v4 and v6

# Get active tables
NF_TABLES=$(cat &quot;$PROC_IPTABLES_NAMES&quot; 2&gt;/dev/null)


rmmod_r() {
    # Unload module with all referring modules.
    # At first all referring modules will be unloaded, then the module itself.
    local mod=$1
    local ret=0
    local ref=

    # Get referring modules.
    # New modutils have another output format.
    [ $NEW_MODUTILS = 1 ] \
    &amp;&amp; ref=$(lsmod | awk &quot;/^${mod}/ { print \$4; }&quot; | tr &#039;,&#039; &#039; &#039;) \
    || ref=$(lsmod | grep ^${mod} | cut -d &quot;[&quot; -s -f 2 | cut -d &quot;]&quot; -s -f 1)

    # recursive call for all referring modules
    for i in $ref; do
    rmmod_r $i
    let ret+=$?;
    done

    # Unload module.
    # The extra test is for 2.6: The module might have autocleaned,
    # after all referring modules are unloaded.
    if grep -q &quot;^${mod}&quot; /proc/modules ; then
    modprobe -r $mod &gt; /dev/null 2&gt;&amp;1
    res=$?
    [ $res -eq 0 ] || echo -n &quot; $mod&quot;
    let ret+=$res;
    fi

    return $ret
}

flush_n_delete() {
    # Flush firewall rules and delete chains.
    [ ! -e &quot;$PROC_IPTABLES_NAMES&quot; ] &amp;&amp; return 0

    # Check if firewall is configured (has tables)
    [ -z &quot;$NF_TABLES&quot; ] &amp;&amp; return 1

    echo -n $&quot;${IPTABLES}: Flushing firewall rules: &quot;
    ret=0
    # For all tables
    for i in $NF_TABLES; do
        # Flush firewall rules.
    $IPTABLES -t $i -F;
    let ret+=$?;

        # Delete firewall chains.
    $IPTABLES -t $i -X;
    let ret+=$?;

    # Set counter to zero.
    $IPTABLES -t $i -Z;
    let ret+=$?;
    done

    [ $ret -eq 0 ] &amp;&amp; success || failure
    echo
    return $ret
}

set_policy() {
    # Set policy for configured tables.
    policy=$1

    # Check if iptable module is loaded
    [ ! -e &quot;$PROC_IPTABLES_NAMES&quot; ] &amp;&amp; return 0

    # Check if firewall is configured (has tables)
    tables=$(cat &quot;$PROC_IPTABLES_NAMES&quot; 2&gt;/dev/null)
    [ -z &quot;$tables&quot; ] &amp;&amp; return 1

    echo -n $&quot;${IPTABLES}: Setting chains to policy $policy: &quot;
    ret=0
    for i in $tables; do
    echo -n &quot;$i &quot;
    case &quot;$i&quot; in
        raw)
        $IPTABLES -t raw -P PREROUTING $policy \
            &amp;&amp; $IPTABLES -t raw -P OUTPUT $policy \
            || let ret+=1
        ;;
        filter)
                $IPTABLES -t filter -P INPUT $policy \
            &amp;&amp; $IPTABLES -t filter -P OUTPUT $policy \
            &amp;&amp; $IPTABLES -t filter -P FORWARD $policy \
            || let ret+=1
        ;;
        nat)
        $IPTABLES -t nat -P PREROUTING $policy \
            &amp;&amp; $IPTABLES -t nat -P POSTROUTING $policy \
            &amp;&amp; $IPTABLES -t nat -P OUTPUT $policy \
            || let ret+=1
        ;;
        mangle)
            $IPTABLES -t mangle -P PREROUTING $policy \
            &amp;&amp; $IPTABLES -t mangle -P POSTROUTING $policy \
            &amp;&amp; $IPTABLES -t mangle -P INPUT $policy \
            &amp;&amp; $IPTABLES -t mangle -P OUTPUT $policy \
            &amp;&amp; $IPTABLES -t mangle -P FORWARD $policy \
            || let ret+=1
        ;;
        *)
            let ret+=1
        ;;
        esac
    done

    [ $ret -eq 0 ] &amp;&amp; success || failure
    echo
    return $ret
}

load_sysctl() {
    # load matched sysctl values
    if [ -n &quot;$IPTABLES_SYSCTL_LOAD_LIST&quot; ]; then
        echo -n $&quot;Loading sysctl settings: &quot;
        ret=0
        for item in $IPTABLES_SYSCTL_LOAD_LIST; do
            fgrep $item /etc/sysctl.conf | sysctl -p - &gt;/dev/null
            let ret+=$?;
        done
        [ $ret -eq 0 ] &amp;&amp; success || failure
        echo
    fi
    return $ret
}

start() {
    # Do not start if there is no config file.
    [ ! -f &quot;$IPTABLES_DATA&quot; ] &amp;&amp; return 6

    # check if ipv6 module load is deactivated
    if [ &quot;${_IPV}&quot; = &quot;ipv6&quot; ] \
    &amp;&amp; grep -qIsE &quot;^install[[:space:]]+${_IPV}[[:space:]]+/bin/(true|false)&quot; /etc/modprobe.conf /etc/modprobe.d/* ; then
    echo $&quot;${IPTABLES}: ${_IPV} is disabled.&quot;
    return 150
    fi

    echo -n $&quot;${IPTABLES}: Applying firewall rules: &quot;

    OPT=
    [ &quot;x$IPTABLES_SAVE_COUNTER&quot; = &quot;xyes&quot; ] &amp;&amp; OPT=&quot;-c&quot;

    $IPTABLES-restore $OPT $IPTABLES_DATA
    if [ $? -eq 0 ]; then
    success; echo
    else
    failure; echo;
    if [ -f &quot;$IPTABLES_FALLBACK_DATA&quot; ]; then
        echo -n $&quot;${IPTABLES}: Applying firewall fallback rules: &quot;
        $IPTABLES-restore $OPT $IPTABLES_FALLBACK_DATA
        if [ $? -eq 0 ]; then
        success; echo
        else
        failure; echo; return 1
        fi
    else
        return 1
    fi
    fi
    
    # Load additional modules (helpers)
    if [ -n &quot;$IPTABLES_MODULES&quot; ]; then
    echo -n $&quot;${IPTABLES}: Loading additional modules: &quot;
    ret=0
    for mod in $IPTABLES_MODULES; do
        echo -n &quot;$mod &quot;
        modprobe $mod &gt; /dev/null 2&gt;&amp;1
        let ret+=$?;
    done
    [ $ret -eq 0 ] &amp;&amp; success || failure
    echo
    fi
    
    # Load sysctl settings
    load_sysctl

    touch $VAR_SUBSYS_IPTABLES
    return $ret
}

stop() {
    # Do not stop if iptables module is not loaded.
    [ ! -e &quot;$PROC_IPTABLES_NAMES&quot; ] &amp;&amp; return 0

    flush_n_delete
    set_policy ACCEPT
    
    if [ &quot;x$IPTABLES_MODULES_UNLOAD&quot; = &quot;xyes&quot; ]; then
    echo -n $&quot;${IPTABLES}: Unloading modules: &quot;
    ret=0
    for mod in ${NF_MODULES[*]}; do
        rmmod_r $mod
        let ret+=$?;
    done
    # try to unload remaining netfilter modules used by ipv4 and ipv6 
    # netfilter
    for mod in ${NF_MODULES_COMMON[*]}; do
        rmmod_r $mod &gt;/dev/null
    done
    [ $ret -eq 0 ] &amp;&amp; success || failure
    echo
    fi
    
    rm -f $VAR_SUBSYS_IPTABLES
    return $ret
}

save() {
    # Check if iptable module is loaded
    [ ! -e &quot;$PROC_IPTABLES_NAMES&quot; ] &amp;&amp; return 0

    # Check if firewall is configured (has tables)
    [ -z &quot;$NF_TABLES&quot; ] &amp;&amp; return 6

    echo -n $&quot;${IPTABLES}: Saving firewall rules to $IPTABLES_DATA: &quot;

    OPT=
    [ &quot;x$IPTABLES_SAVE_COUNTER&quot; = &quot;xyes&quot; ] &amp;&amp; OPT=&quot;-c&quot;

    ret=0
    TMP_FILE=$(/bin/mktemp -q $IPTABLES_DATA.XXXXXX) \
    &amp;&amp; chmod 600 &quot;$TMP_FILE&quot; \
    &amp;&amp; $IPTABLES-save $OPT &gt; $TMP_FILE 2&gt;/dev/null \
    &amp;&amp; size=$(stat -c &#039;%s&#039; $TMP_FILE) &amp;&amp; [ $size -gt 0 ] \
    || ret=1
    if [ $ret -eq 0 ]; then
    if [ -e $IPTABLES_DATA ]; then
        cp -f $IPTABLES_DATA $IPTABLES_DATA.save \
        &amp;&amp; chmod 600 $IPTABLES_DATA.save \
        &amp;&amp; restorecon $IPTABLES_DATA.save \
        || ret=1
    fi
    if [ $ret -eq 0 ]; then
        mv -f $TMP_FILE $IPTABLES_DATA \
        &amp;&amp; chmod 600 $IPTABLES_DATA \
        &amp;&amp; restorecon $IPTABLES_DATA \
            || ret=1
    fi
    fi
    rm -f $TMP_FILE
    [ $ret -eq 0 ] &amp;&amp; success || failure
    echo
    return $ret
}

status() {
    if [ ! -f &quot;$VAR_SUBSYS_IPTABLES&quot; -a -z &quot;$NF_TABLES&quot; ]; then
    echo $&quot;${IPTABLES}: Firewall is not running.&quot;
    return 3
    fi

    # Do not print status if lockfile is missing and iptables modules are not 
    # loaded.
    # Check if iptable modules are loaded
    if [ ! -e &quot;$PROC_IPTABLES_NAMES&quot; ]; then
    echo $&quot;${IPTABLES}: Firewall modules are not loaded.&quot;
    return 3
    fi

    # Check if firewall is configured (has tables)
    if [ -z &quot;$NF_TABLES&quot; ]; then
    echo $&quot;${IPTABLES}: Firewall is not configured. &quot;
    return 3
    fi

    NUM=
    [ &quot;x$IPTABLES_STATUS_NUMERIC&quot; = &quot;xyes&quot; ] &amp;&amp; NUM=&quot;-n&quot;
    VERBOSE= 
    [ &quot;x$IPTABLES_STATUS_VERBOSE&quot; = &quot;xyes&quot; ] &amp;&amp; VERBOSE=&quot;--verbose&quot;
    COUNT=
    [ &quot;x$IPTABLES_STATUS_LINENUMBERS&quot; = &quot;xyes&quot; ] &amp;&amp; COUNT=&quot;--line-numbers&quot;

    for table in $NF_TABLES; do
    echo $&quot;Table: $table&quot;
    $IPTABLES -t $table --list $NUM $VERBOSE $COUNT &amp;&amp; echo
    done

    return 0
}

restart() {
    [ &quot;x$IPTABLES_SAVE_ON_RESTART&quot; = &quot;xyes&quot; ] &amp;&amp; save
    stop
    start
}


case &quot;$1&quot; in
    start)
    [ -f &quot;$VAR_SUBSYS_IPTABLES&quot; ] &amp;&amp; exit 0
    start
    RETVAL=$?
    ;;
    stop)
    [ &quot;x$IPTABLES_SAVE_ON_STOP&quot; = &quot;xyes&quot; ] &amp;&amp; save
    stop
    RETVAL=$?
    ;;
    restart|force-reload)
    restart
    RETVAL=$?
    ;;
    reload)
    # unimplemented
    RETVAL=3
    ;;
    condrestart|try-restart)
    [ ! -e &quot;$VAR_SUBSYS_IPTABLES&quot; ] &amp;&amp; exit 0
    restart
    RETVAL=$?
    ;;
    status)
    status
    RETVAL=$?
    ;;
    panic)
    flush_n_delete
    set_policy DROP
    RETVAL=$?
        ;;
    save)
    save
    RETVAL=$?
    ;;
    *)
    echo $&quot;Usage: ${IPTABLES} {start|stop|restart|condrestart|status|panic|save}&quot;
    RETVAL=2
    ;;
esac

exit $RETVAL</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Gentoos]]></name>
				<uri>https://linuxforum.ru/profile.php?id=28923</uri>
			</author>
			<updated>2013-04-21T17:53:51Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341611#p341611</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341608#p341608" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>iptables: Применяются правила межсетевого экрана: iptables-restore v1.4.7: no command specified
Error occurred at line: 11
Try `iptables-restore -h&#039; or &#039;iptables-restore --help&#039; for more information.
                                                           [СБОЙ ]</code></pre></div><p>Встаёт вопрос о том, где имеет место ошибка, в сохранённых правилах или в самом вызове iptables-restore в скрипте /etc/init.d/iptables <br />Давайте посмотрим, что в этом скрипте?</p><br /><p>ps. У меня ваш набор правил из первого сообщения применяется при помощи &quot;cat test | iptables-restore&quot; без каких-либо проблем (Slackware 14.0, x86_64).</p>]]></content>
			<author>
				<name><![CDATA[bormant]]></name>
				<uri>https://linuxforum.ru/profile.php?id=732</uri>
			</author>
			<updated>2013-04-21T17:41:34Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341608#p341608</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341606#p341606" />
			<content type="html"><![CDATA[<div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p>iptables: п÷я─п╦п╪п╣пҐя▐я▌я┌я│я▐ п©я─п╟п╡п╦п╩п╟ п╪п╣пІя│п╣я┌п╣п╡п╬пЁп╬ я█п╨я─п╟пҐп╟: iptables-restore v1.4.7: no command specified<br />Error occurred at line: 11<br />Try `iptables-restore -h&#039; or &#039;iptables-restore --help&#039; for more information.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[п║п▒п·п≥ ]</p></div></div>]]></content>
			<author>
				<name><![CDATA[Gentoos]]></name>
				<uri>https://linuxforum.ru/profile.php?id=28923</uri>
			</author>
			<updated>2013-04-21T17:14:42Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341606#p341606</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341564#p341564" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>bormant пишет:</cite><blockquote><p>но текстовое представление нужно, его по крайней мере можно будет перекодировать безболезненно и понять, в чём дело.</p></blockquote></div><p>Потому и попросил.</p><div class="quotebox"><cite>bormant пишет:</cite><blockquote><p>LANG=en_US не поможет</p></blockquote></div><p>Это видно по картинке, мне просто вломы переключать язык на клавиатуре, вот и скопировал с ближайшего сообщения <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /></p>]]></content>
			<author>
				<name><![CDATA[urfin]]></name>
				<uri>https://linuxforum.ru/profile.php?id=28931</uri>
			</author>
			<updated>2013-04-21T13:52:17Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341564#p341564</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341562#p341562" />
			<content type="html"><![CDATA[<p><strong>urfin</strong>, <br />LANG=en_US не поможет, это вверху на картинке видно, но текстовое представление нужно, его по крайней мере можно будет перекодировать безболезненно и понять, в чём дело.</p>]]></content>
			<author>
				<name><![CDATA[bormant]]></name>
				<uri>https://linuxforum.ru/profile.php?id=732</uri>
			</author>
			<updated>2013-04-21T13:49:32Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341562#p341562</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Не запускается Iptables.]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=341546#p341546" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Gentoos пишет:</cite><blockquote><p>Как решить данную проблему?</p></blockquote></div><p>Сначала дайте последний вывод (LANG=en_US service iptables start) в текстовом виде, а не в виде прикрепленной картинки.</p>]]></content>
			<author>
				<name><![CDATA[urfin]]></name>
				<uri>https://linuxforum.ru/profile.php?id=28931</uri>
			</author>
			<updated>2013-04-21T13:24:28Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=341546#p341546</id>
		</entry>
</feed>
