<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; блокировка ВКонтакте]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=13912&amp;type=atom" />
	<updated>2013-09-28T20:34:14Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=13912</id>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=365829#p365829" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>zenon пишет:</cite><blockquote><div class="quotebox"><cite>lone_wolf пишет:</cite><blockquote><p>эм вот мне 1 не понятно почему применяется критерий -d и DNAT с таблицей NAT, вместо таблицы FILTER ?</p></blockquote></div><p>Честно говоря&nbsp; уже не помню что тут происходило, и в каком контексте это было...</p></blockquote></div><p>да я тут решил немного освежить знания и полез в русcкий туториал на opennet и понял что я протупил не слабо оказывается можно так&nbsp; <img src="https://linuxforum.ru/img/smilies/ah.gif" alt="ah" /></p>]]></content>
			<author>
				<name><![CDATA[lone_wolf]]></name>
				<uri>https://linuxforum.ru/profile.php?id=12648</uri>
			</author>
			<updated>2013-09-28T20:34:14Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=365829#p365829</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=365826#p365826" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>lone_wolf пишет:</cite><blockquote><p>эм вот мне 1 не понятно почему применяется критерий -d и DNAT с таблицей NAT, вместо таблицы FILTER ?</p></blockquote></div><p>Честно говоря&nbsp; уже не помню что тут происходило, и в каком контексте это было...</p>]]></content>
			<author>
				<name><![CDATA[zenon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6867</uri>
			</author>
			<updated>2013-09-28T20:19:46Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=365826#p365826</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=365819#p365819" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>zenon пишет:</cite><blockquote><p>Вот такие правила создаются с присутствием только одной строчки:<br /></p><div class="codebox"><pre><code>iptables -t nat -A PREROUTING -d vkontakte.ru -j DNAT --to-destination 127.0.0.1</code></pre></div><p><div class="termtitle" style="font-family: sans-serif; position:relative; height:auto; width:auto; background:#3A4061; color:#FFFFFF; padding: 1px;"><b> Консоль:</b></div>
<div class="termcont" style="font-family: Terminus; position:relative; height:auto; width:auto; overflow-x:scroll; white-space: nowrap ; overflow-y:auto;background:#000000; color:#4EF44E; line-height:1.2; padding: 3px; font-size: 1rem; max-height: 60vh">-A PREROUTING -d 87.240.188.254/32 -j DNAT --to-destination 127.0.0.1 <br />-A PREROUTING -d 93.186.224.240/32 -j DNAT --to-destination 127.0.0.1 <br />-A PREROUTING -d 93.186.224.241/32 -j DNAT --to-destination 127.0.0.1 <br />-A PREROUTING -d 93.186.224.242/32 -j DNAT --to-destination 127.0.0.1 <br />-A PREROUTING -d 93.186.224.243/32 -j DNAT --to-destination 127.0.0.1 <br />-A PREROUTING -d 87.240.188.249/32 -j DNAT --to-destination 127.0.0.1 <br />-A PREROUTING -d 87.240.188.250/32 -j DNAT --to-destination 127.0.0.1 <br />-A PREROUTING -d 87.240.188.252/32 -j DNAT --to-destination 127.0.0.1 </div></p></blockquote></div><p>эм вот мне 1 не понятно почему применяется критерий -d и DNAT с таблицей NAT, вместо таблицы FILTER ?&nbsp; <img src="https://linuxforum.ru/img/smilies/bw.gif" alt="bw" /> <br />не я конечно наверно полный идиот но реально мне не понятно&nbsp; <img src="https://linuxforum.ru/img/smilies/bm.gif" alt="bm" /></p>]]></content>
			<author>
				<name><![CDATA[lone_wolf]]></name>
				<uri>https://linuxforum.ru/profile.php?id=12648</uri>
			</author>
			<updated>2013-09-28T19:20:26Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=365819#p365819</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=331138#p331138" />
			<content type="html"><![CDATA[<p>Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[neogotlic]]></name>
				<uri>https://linuxforum.ru/profile.php?id=21136</uri>
			</author>
			<updated>2013-03-03T13:10:31Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=331138#p331138</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=331083#p331083" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Kettler пишет:</cite><blockquote><div class="quotebox"><cite>neogotlic пишет:</cite><blockquote><p>Извините за офф - касперский у меня до сих-пор блокирует вконтакте, однокласники - почему. Касперский хоть не на никсах сделанный? Сорь за офф.</p></blockquote></div><p>каспер тут не каким боком\</p></blockquote></div><br /><p>Ессно. В системе малварь, атакующая соцсети. Гигиена не на высоте!</p>]]></content>
			<author>
				<name><![CDATA[karl_muenhgausen]]></name>
				<uri>https://linuxforum.ru/profile.php?id=25156</uri>
			</author>
			<updated>2013-03-03T08:37:21Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=331083#p331083</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=331079#p331079" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>neogotlic пишет:</cite><blockquote><p>Извините за офф - касперский у меня до сих-пор блокирует вконтакте, однокласники - почему. Касперский хоть не на никсах сделанный? Сорь за офф.</p></blockquote></div><p>каспер тут не каким боком\</p>]]></content>
			<author>
				<name><![CDATA[Kettler]]></name>
				<uri>https://linuxforum.ru/profile.php?id=11719</uri>
			</author>
			<updated>2013-03-03T08:33:23Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=331079#p331079</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=330830#p330830" />
			<content type="html"><![CDATA[<p>Извините за офф - касперский у меня до сих-пор блокирует вконтакте, однокласники - почему. Касперский хоть не на никсах сделанный? Сорь за офф.</p>]]></content>
			<author>
				<name><![CDATA[neogotlic]]></name>
				<uri>https://linuxforum.ru/profile.php?id=21136</uri>
			</author>
			<updated>2013-03-02T03:30:10Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=330830#p330830</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=185936#p185936" />
			<content type="html"><![CDATA[<p>Все... разобрался.&nbsp; <img src="https://linuxforum.ru/img/smilies/ag.gif" alt="ag" /> Очень даже удобно для блокировки соц сетей и всяких трекеров.</p>]]></content>
			<author>
				<name><![CDATA[XliN]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6412</uri>
			</author>
			<updated>2011-06-07T15:58:17Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=185936#p185936</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=185933#p185933" />
			<content type="html"><![CDATA[<p>Проще как-то так:</p><div class="codebox"><pre><code>if [ -z &quot;`iptables -n -L | grep -i &quot;chain check_ip&quot;`&quot; ]; then iptables -N check_ip; fi
if [ -f $BLACKLIST ]; 
   then
     iptables -F check_ip;
     iptables -I FORWARD 1 -s $lan -o $inet -j check_ip
     iptables -A check_ip -s 192.168.3.254 -o ppp0 -j ACCEPT
     cat $BLACKLIST | while read line
     do
        echo -e &quot;${line}&quot;
        iptables -A check_ip -d &quot;${line}&quot; -j DROP
     done
     iptables -A check_ip -j RETURN
fi</code></pre></div><p>По <strong>if</strong> <a href="http://eddnet.org/?p=1311">http://eddnet.org/?p=1311</a></p>]]></content>
			<author>
				<name><![CDATA[zenon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6867</uri>
			</author>
			<updated>2011-06-07T15:36:26Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=185933#p185933</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=185926#p185926" />
			<content type="html"><![CDATA[<p>Сорри что лезу со своими скриптами, но все же.<br />Т.к. iptables cам умеет по доменному имени узнавать IP, то скрипт станет еще проще.</p><p>Создается файл с урлами тех кого дропаем.<br /><div class="termtitle" style="font-family: sans-serif; position:relative; height:auto; width:auto; background:#3A4061; color:#FFFFFF; padding: 1px;"><b> Консоль:</b></div>
<div class="termcont" style="font-family: Terminus; position:relative; height:auto; width:auto; overflow-x:scroll; white-space: nowrap ; overflow-y:auto;background:#000000; color:#4EF44E; line-height:1.2; padding: 3px; font-size: 1rem; max-height: 60vh"><br />[root@ldap]# cat /var/blacklist.url<br />vk.com<br />facebook.com<br />vkontakte.ru<br />odnoklassniki.ru<br />xhamster.com</div></p><p>И собственно сам скрипт</p><div class="codebox"><pre><code>#!/bin/bash
lan=&quot;192.168.3.0/24&quot;
inet=&quot;ppp0&quot;
BLACKLIST=&quot;/var/blacklist.url&quot;

if [ ! -z &quot;`iptables -n -L | grep -i &quot;chain check_ip&quot;`&quot; ]; then
  if [ -f $BLACKLIST ]; then
      iptables -F check_ip;
      iptables -I FORWARD 1 -s $lan -o $inet -j check_ip
      iptables -A check_ip -s 192.168.3.254 -o ppp0 -j ACCEPT
      cat $BLACKLIST | while read line
      do
        echo -e &quot;${line}&quot;
        iptables -A check_ip -d &quot;${line}&quot; -j DROP
      done
  iptables -A check_ip -j RETURN
  else
     echo &quot;Файла $BLACKLIST не существует!!&quot;
  fi
else
    echo &quot;Цепочка check_ip не создана&quot;
    iptables -N check_ip
fi</code></pre></div><p>И попутно вопрос, т.к. с башем только начал осваиваться.<br />Как в блоке<br /></p><div class="codebox"><pre><code>else
    echo &quot;Цепочка check_ip не создана&quot;
    iptables -N check_ip</code></pre></div><p>сделать так, что было так: после проверки на наличие цепочки и выявления что ее нет, скрипт ее создает но в и выходит потом сразу. Как его заставить еще раз отработать? Типа гото нужно ))</p>]]></content>
			<author>
				<name><![CDATA[XliN]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6412</uri>
			</author>
			<updated>2011-06-07T15:08:08Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=185926#p185926</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=185718#p185718" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>--=XliN=-- пишет:</cite><blockquote><p>Он в nslookup.tmp запихивает все по нескольку раз.</p></blockquote></div><p>перед while допишите<br /></p><div class="codebox"><pre><code>: &gt; $BLACKLIST</code></pre></div>]]></content>
			<author>
				<name><![CDATA[emulek]]></name>
				<uri>https://linuxforum.ru/profile.php?id=17759</uri>
			</author>
			<updated>2011-06-07T06:25:21Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=185718#p185718</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=185603#p185603" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Kettler пишет:</cite><blockquote><p>iptables -F check_ip не вижу</p></blockquote></div><p>Он есть. Методом тыка выявил место ошибки. Проблема в блоке </p><p><div class="termtitle" style="font-family: sans-serif; position:relative; height:auto; width:auto; background:#3A4061; color:#FFFFFF; padding: 1px;"><b> Консоль:</b></div>
<div class="termcont" style="font-family: Terminus; position:relative; height:auto; width:auto; overflow-x:scroll; white-space: nowrap ; overflow-y:auto;background:#000000; color:#4EF44E; line-height:1.2; padding: 3px; font-size: 1rem; max-height: 60vh">if [ -f $BLACKLIST ]; then<br />while read line<br />do<br />&nbsp; nslookup ${line} &gt;&gt; /tmp/nslookup.tmp;<br />&nbsp; done &lt; $BLACKLIST<br />fi<br />&nbsp; awk &#039;/Address:/ {if($2==&quot;192.168.1.77#53&quot;){} else{print $2 &gt; &quot;/var/blacklist.ip&quot; }}&#039; /tmp/nslookup.tmp</div><br />Он в nslookup.tmp запихивает все по нескольку раз.</p>]]></content>
			<author>
				<name><![CDATA[XliN]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6412</uri>
			</author>
			<updated>2011-06-06T16:00:03Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=185603#p185603</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=185596#p185596" />
			<content type="html"><![CDATA[<p>iptables -F check_ip не вижу</p>]]></content>
			<author>
				<name><![CDATA[Kettler]]></name>
				<uri>https://linuxforum.ru/profile.php?id=11719</uri>
			</author>
			<updated>2011-06-06T15:37:10Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=185596#p185596</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=185590#p185590" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>newzenon пишет:</cite><blockquote><p>я выше уже сказал - не нужно это всё iptables сам преобразовывает имена в ip - так что все наши махинации с nslookup не нужны.</p></blockquote></div><p>Я это понял. Тоже проверял. Просто мне так удобнее и если по чесноку интереснее.&nbsp; <img src="https://linuxforum.ru/img/smilies/ag.gif" alt="ag" /></p>]]></content>
			<author>
				<name><![CDATA[XliN]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6412</uri>
			</author>
			<updated>2011-06-06T15:20:07Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=185590#p185590</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: блокировка ВКонтакте]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=185581#p185581" />
			<content type="html"><![CDATA[<p><strong>--=XliN=--</strong>, я выше уже сказал - не нужно это всё iptables сам преобразовывает имена в ip - так что все наши махинации с nslookup не нужны.</p>]]></content>
			<author>
				<name><![CDATA[zenon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6867</uri>
			</author>
			<updated>2011-06-06T14:49:51Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=185581#p185581</id>
		</entry>
</feed>
