<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; Помогите настроить фаервол шлюза Cake+Squid]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=16889&amp;type=atom" />
	<updated>2011-10-02T12:31:51Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=16889</id>
		<entry>
			<title type="html"><![CDATA[Re: Помогите настроить фаервол шлюза Cake+Squid]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=216624#p216624" />
			<content type="html"><![CDATA[<p>Вот, рабочие правила:<br /></p><div class="codebox"><pre><code>#!/bin/bash
# Очистка всех цепочек iptables

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

iptables -X
iptables -t nat -X
iptables -t mangle -X
# Политика по умолчанию, запретить все что не разрешено
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
# Разрешаем обращение к lo интерфейсу
iptables -A INPUT -i lo -p all -j ACCEPT
iptables -A INPUT -i eth1 -j ACCEPT
iptables -A OUTPUT -o lo -p all -j ACCEPT
iptables -A OUTPUT -o eth1 -j ACCEPT

# Пропускать уже инициированные, а также их дочерние
iptables -A INPUT -p all -m state --state ESTABLISHED,RELATED -j ACCEPT

# Пропускать новые, инициированные, а также их дочерние

iptables -A OUTPUT -p all -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT

# Разрешить форвардинг для новых, инициированных, а также их дочерних
iptables -A FORWARD -p all -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT


# NAT, подсеть 192.168.2.0/255.255.255.0 у нас виртуальная
iptables -t nat -A POSTROUTING -s 192.168.2.0/255.255.255.0 -j SNAT --to-source 192.168.1.10

# Разрешаем пинг
iptables -A INPUT -i eth1 -p ICMP -j ACCEPT
iptables -A OUTPUT -o eth1 -p ICMP -j ACCEPT

# Разрешаем DNS запросы с локальной сети до сервер
iptables -A INPUT -s 10.168.50.0/24 -p udp --dport 53 -j ACCEPT
iptables -A OUTPUT -d 10.168.50.0/24 -p udp --sport 53 -j ACCEPT
iptables -A INPUT -s 10.168.50.0/24 -p tcp --dport 53 -j ACCEPT
iptables -A OUTPUT -d 10.168.50.0/24 -p tcp --sport 53 -j ACCEPT

# Разрешаем VPN подключения из локальной сети к нашему серверу
iptables -A INPUT -s 10.168.50.0/24 -p tcp --dport 1723 -j ACCEPT
iptables -A OUTPUT -d 10.168.50.0/24 -p tcp --sport 1723 -j ACCEPT
iptables -A INPUT -p gre -j ACCEPT</code></pre></div><p>Спасибо, <strong>newzenon</strong>&nbsp; smile</p>]]></content>
			<author>
				<name><![CDATA[AlfaStriker]]></name>
				<uri>https://linuxforum.ru/profile.php?id=15778</uri>
			</author>
			<updated>2011-10-02T12:31:51Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=216624#p216624</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Помогите настроить фаервол шлюза Cake+Squid]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=216249#p216249" />
			<content type="html"><![CDATA[<p><strong>Ka3aH6ac</strong>, <a href="http://www.opennet.ru/docs/RUS/iptables/">http://www.opennet.ru/docs/RUS/iptables/</a><br />в примерах есть <a href="http://www.opennet.ru/docs/RUS/iptables/#RCFIREWALLFILE">http://www.opennet.ru/docs/RUS/iptables/#RCFIREWALLFILE</a> - смотри и разбирай его что надо/не надо.<br />Ну и тут подсмотри <a href="http://linuxforum.ru/viewtopic.php?pid=176106#p176106">http://linuxforum.ru/viewtopic.php?pid=176106#p176106</a></p>]]></content>
			<author>
				<name><![CDATA[zenon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6867</uri>
			</author>
			<updated>2011-09-30T12:27:35Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=216249#p216249</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Помогите настроить фаервол шлюза Cake+Squid]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=216202#p216202" />
			<content type="html"><![CDATA[<p><strong>newzenon</strong>, спасибо большое!</p><p>Мне как раз нужны именно советы как правильно последовательность команд записать...</p>]]></content>
			<author>
				<name><![CDATA[AlfaStriker]]></name>
				<uri>https://linuxforum.ru/profile.php?id=15778</uri>
			</author>
			<updated>2011-09-30T10:23:31Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=216202#p216202</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Помогите настроить фаервол шлюза Cake+Squid]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=216197#p216197" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Ka3aH6ac пишет:</cite><blockquote><p>...<br /># Закрываем важные порты на Интерфейсах<br />iptables -A INPUT -p TCP -i eth0 --dport 3128 -j DROP #Порты proxy<br />...</p></blockquote></div><p>Подход неверный:<br />1. Чистка.<br />2. Закрыть все и вся. (DROP)<br />3. Пропускать все уже инициированные и их дочерние соединения.<br />4. Локальные разрешить.<br />5. Форвардинг.<br />6. Пишем что открыть, пробросить, ......</p>]]></content>
			<author>
				<name><![CDATA[zenon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6867</uri>
			</author>
			<updated>2011-09-30T09:57:30Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=216197#p216197</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Помогите настроить фаервол шлюза Cake+Squid]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=216191#p216191" />
			<content type="html"><![CDATA[<p>Эти правила работают не полностью. Не идут ДНС запросы...<br />Да и я все это делаю ради спортивного интереса!</p>]]></content>
			<author>
				<name><![CDATA[AlfaStriker]]></name>
				<uri>https://linuxforum.ru/profile.php?id=15778</uri>
			</author>
			<updated>2011-09-30T09:34:55Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=216191#p216191</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Помогите настроить фаервол шлюза Cake+Squid]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=216190#p216190" />
			<content type="html"><![CDATA[<p>Нет, у меня есть вот такие правила:<br />#!/bin/bash</p><p>iptables -F<br />iptables -t nat –F</p><p>iptables -t mangle -F<br />iptables -X<br />iptables -t nat -X<br />iptables -t mangle -X</p><p>iptables -t nat -A POSTROUTING -s 192.168.2.0/255.255.255.0 -j SNAT --to-source 10.168.50.42</p><p># Правило для прозрачного прокси, если таковой имеется.<br />iptables -t nat -A PREROUTING -p tcp -s 192.168.2.0/24 --dport 80 -j REDIRECT --to-port 3128</p><p># Закрываем важные порты на Интерфейсах<br />iptables -A INPUT -p TCP -i eth0 --dport 3128 -j DROP #Порты proxy<br />iptables -A INPUT -p TCP -i eth1 --dport 3128 -j DROP<br />iptables -A INPUT -p TCP -i eth0 --dport 3306 -j DROP #mysql<br />iptables -A INPUT -p TCP -i eth1 --dport 3306 -j DROP</p>]]></content>
			<author>
				<name><![CDATA[AlfaStriker]]></name>
				<uri>https://linuxforum.ru/profile.php?id=15778</uri>
			</author>
			<updated>2011-09-30T09:33:39Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=216190#p216190</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Помогите настроить фаервол шлюза Cake+Squid]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=216185#p216185" />
			<content type="html"><![CDATA[<p>Быть может с такой формулировкой вопроса Вам лучше бы в раздел &quot;Работа&quot;?</p>]]></content>
			<author>
				<name><![CDATA[Hrafn]]></name>
			</author>
			<updated>2011-09-30T09:13:30Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=216185#p216185</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Помогите настроить фаервол шлюза Cake+Squid]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=216176#p216176" />
			<content type="html"><![CDATA[<p>Добрый день!</p><p>Имеется:<br />- CentOS 5.6 x32<br />- CakeBilling v1.0<br />- Squid v3<br />- кеширующий DNS</p><p>Требуется настроить:<br />- NAT<br />- прохождение DNS запросов к серверу с локальной сети<br />- редирект с 3128 порта на 80 порт</p><p>Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[AlfaStriker]]></name>
				<uri>https://linuxforum.ru/profile.php?id=15778</uri>
			</author>
			<updated>2011-09-30T08:39:39Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=216176#p216176</id>
		</entry>
</feed>
