<?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=31134&amp;type=atom" />
	<updated>2013-10-19T17:59:14Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=31134</id>
		<entry>
			<title type="html"><![CDATA[Re: iptables не работают правила]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=370839#p370839" />
			<content type="html"><![CDATA[<p>А если вот так<br /></p><div class="codebox"><pre><code>#!/bin/sh

/sbin/depmod -a
/sbin/modprobe ip_tables
/sbin/modprobe ip_conntrack
/sbin/modprobe iptable_filter
/sbin/modprobe iptable_nat

echo &quot;1&quot; &gt; /proc/sys/net/ipv4/ip_forward

iptables -F
iptables -t nat -F
iptables -t mangle -F

iptables -X
iptables -t nat -X
iptables -t mangle -X

iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t mangle -P PREROUTING ACCEPT
iptables -t mangle -P OUTPUT ACCEPT

iptables -t nat -A POSTROUTING -s 10.10.10.10 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.3 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.4 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.5 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.6 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.7 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.8 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.9 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.11 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.12 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.13 -o ppp0 -j MASQUERADE</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kisil]]></name>
				<uri>https://linuxforum.ru/profile.php?id=767</uri>
			</author>
			<updated>2013-10-19T17:59:14Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=370839#p370839</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[iptables не работают правила]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=370811#p370811" />
			<content type="html"><![CDATA[<p>вот мои правила ниже. Почему-то не открываються сайты... Пинг идет, бинд настроен айпи резольвит...Сеть состоит из 10 компьютеров... на всех должен быть интернет... Настроен через рррое. может где-то ошибка ? </p><div class="codebox"><pre><code>#!/bin/sh

/sbin/depmod -a
/sbin/modprobe ip_tables
/sbin/modprobe ip_conntrack
/sbin/modprobe iptable_filter
/sbin/modprobe iptable_nat

echo &quot;1&quot; &gt; /proc/sys/net/ipv4/ip_forward

iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t mangle -P PREROUTING ACCEPT
iptables -t mangle -P OUTPUT ACCEPT


iptables -F
iptables -t nat -F
iptables -t mangle -F

iptables -X
iptables -t nat -X
iptables -t mangle -X

iptables -A INPUT -i eth0 -j ACCEPT
iptables -A FORWARD -i ppp0 -j ACCEPT
#iptables -A FORWARD -i ppp1 -j ACCEPT
#iptables -t nat -A POSTROUTING -s 10.10.10.2 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.10 -o ppp0 -j MASQUERADE
#iptables -t mangle -A FORWARD -s 10.10.10.7 -j MARK --set-mark 103
iptables -t nat -A POSTROUTING -s 10.10.10.3 -o ppp0 -j MASQUERADE
#iptables -t mangle -A FORWARD -s 10.10.10.3 -j MARK --set-mark 106
iptables -t nat -A POSTROUTING -s 10.10.10.4 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.5 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.6 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.7 -o ppp0 -j MASQUERADE
#iptables -t mangle -A FORWARD -s 10.10.10.9 -j MARK --set-mark 105
#iptables -t mangle -A FORWARD -s 10.10.10.6 -j MARK --set-mark 101
iptables -t nat -A POSTROUTING -s 10.10.10.8 -o ppp0 -j MASQUERADE
#iptables -t mangle -A FORWARD -s 10.10.10.8 -j MARK --set-mark 102
iptables -t nat -A POSTROUTING -s 10.10.10.9 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.11 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.12 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.10.13 -o ppp0 -j MASQUERADE</code></pre></div>]]></content>
			<author>
				<name><![CDATA[uaradio]]></name>
				<uri>https://linuxforum.ru/profile.php?id=10089</uri>
			</author>
			<updated>2013-10-19T14:48:39Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=370811#p370811</id>
		</entry>
</feed>
