<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Linux Forum &mdash; NAT CentOS 6.3]]></title>
		<link>https://linuxforum.ru/viewtopic.php?id=24929</link>
		<atom:link href="https://linuxforum.ru/extern.php?action=feed&amp;tid=24929&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «NAT CentOS 6.3».]]></description>
		<lastBuildDate>Thu, 01 Nov 2012 07:43:01 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=307067#p307067</link>
			<description><![CDATA[<div class="quotebox"><cite>kisil пишет:</cite><blockquote><p>Какой айпи компа с апачем.<br />В линуксе покажыте<br />iptables -S из под root</p></blockquote></div><p>[root@denix selinux]# iptables -S<br />-P INPUT ACCEPT<br />-P FORWARD ACCEPT<br />-P OUTPUT ACCEPT<br />-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT<br />-A INPUT -p icmp -j ACCEPT<br />-A INPUT -i lo -j ACCEPT<br />-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT<br />-A INPUT -j REJECT --reject-with icmp-host-prohibited<br />-A FORWARD -j REJECT --reject-with icmp-host-prohibited</p><p>а так 192.168.100.10<br /> ifconfig<br />eth0&nbsp; &nbsp; &nbsp; Link encap:Ethernet&nbsp; HWaddr 00:1F:C6:8E:9C:3E<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet addr:192.168.100.10&nbsp; Bcast:192.168.100.255&nbsp; Mask:255.255.255.0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet6 addr: fe80::21f:c6ff:fe8e:9c3e/64 Scope:Link<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UP BROADCAST RUNNING MULTICAST&nbsp; MTU:1500&nbsp; Metric:1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX packets:2733 errors:0 dropped:0 overruns:0 frame:0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TX packets:997 errors:0 dropped:0 overruns:0 carrier:0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; collisions:0 txqueuelen:1000<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX bytes:268702 (262.4 KiB)&nbsp; TX bytes:341565 (333.5 KiB)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Interrupt:17</p><p>lo&nbsp; &nbsp; &nbsp; &nbsp; Link encap:Local Loopback<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet addr:127.0.0.1&nbsp; Mask:255.0.0.0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet6 addr: ::1/128 Scope:Host<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UP LOOPBACK RUNNING&nbsp; MTU:16436&nbsp; Metric:1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX packets:4 errors:0 dropped:0 overruns:0 frame:0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TX packets:4 errors:0 dropped:0 overruns:0 carrier:0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; collisions:0 txqueuelen:0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX bytes:240 (240.0 b)&nbsp; TX bytes:240 (240.0 b)</p>]]></description>
			<author><![CDATA[null@example.com (xdenix)]]></author>
			<pubDate>Thu, 01 Nov 2012 07:43:01 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=307067#p307067</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=307065#p307065</link>
			<description><![CDATA[<p>отключил selinux вообще, не помогло</p>]]></description>
			<author><![CDATA[null@example.com (xdenix)]]></author>
			<pubDate>Thu, 01 Nov 2012 07:39:45 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=307065#p307065</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=307059#p307059</link>
			<description><![CDATA[<p>Я про файерволл, а не про настройки апача</p>]]></description>
			<author><![CDATA[null@example.com (alexfinn)]]></author>
			<pubDate>Thu, 01 Nov 2012 07:27:32 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=307059#p307059</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=307056#p307056</link>
			<description><![CDATA[<p>в настройках : Listen 80 прописано</p>]]></description>
			<author><![CDATA[null@example.com (xdenix)]]></author>
			<pubDate>Thu, 01 Nov 2012 07:19:49 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=307056#p307056</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=306838#p306838</link>
			<description><![CDATA[<p>минимально необходимые настройки для включения nat-а (masquerade-инга) для обеспечения локальной сети интернетом (не зависит от дистрибутива):</p><p><em>outInt - интерфейс, к которому подключен &quot;uplink&quot;</em><br /></p><div class="codebox"><pre><code>iptables -t nat -F PREROUTING
iptables -t nat -F POSTROUTING
iptables -t nat -F OUTPUT
iptables -F FORWARD
iptables -P FORWARD -j ACCEPT
iptables -t nat -A POSTROUTING -o ${outInt} -j MASQUERADE
echo 1 &gt; /proc/sys/net/ipv4/ip_forward</code></pre></div><br /><p>с учетом дефолтных конфигов CentOS (RH-like):</p><p><em>localNetwork - адрес локальной сети (префиксная форма)<br />outInt - интерфейс, к которому подключен &quot;uplink&quot;</em><br /></p><div class="codebox"><pre><code>service iptables start
iptables -I FORWARD -s ${localNetwork} -j ACCEPT
iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -o ${outInt} -j MASQURADE
service iptables save
sysctl -w net.ipv4.ip_forward=1
cp /etc/sysctl.conf{,.$(date &quot;+%Y%m%d-%H%M&quot;)}
sed -ie &#039;/^\s*net.ipv4.ip_forward/s/0/1/&#039; /etc/sysctl.conf</code></pre></div><p>--<br />ресурсы:<br /><a href="http://gazette.linux.ru.net/rus/articles/iptables-tutorial.html">документация по iptables</a><br /><a href="https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/pdf/Deployment_Guide/Red_Hat_Enterprise_Linux-6-Deployment_Guide-en-US.pdf">RHEL6: Deployment Guide</a><br />man sysctl.conf</p>]]></description>
			<author><![CDATA[null@example.com (afanasev.p)]]></author>
			<pubDate>Wed, 31 Oct 2012 05:13:46 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=306838#p306838</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=306712#p306712</link>
			<description><![CDATA[<p>Однако я два дня потратил на эти две строки&nbsp; Вчера весь интернет перерыл <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /></p>]]></description>
			<author><![CDATA[null@example.com (pavlar)]]></author>
			<pubDate>Tue, 30 Oct 2012 10:56:49 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=306712#p306712</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=306711#p306711</link>
			<description><![CDATA[<p>ну и славненько <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /> собственно, отличие от изначальной конфигурации - в двух строках в FORWARD</p>]]></description>
			<author><![CDATA[null@example.com (alexfinn)]]></author>
			<pubDate>Tue, 30 Oct 2012 10:55:41 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=306711#p306711</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=306710#p306710</link>
			<description><![CDATA[<p>Chain INPUT (policy ACCEPT 0 packets, 0 bytes)<br /> pkts bytes target&nbsp; &nbsp; &nbsp;prot opt in&nbsp; &nbsp; &nbsp;out&nbsp; &nbsp; &nbsp;source&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;destination<br />&nbsp; 128&nbsp; 9668 ACCEPT&nbsp; &nbsp; &nbsp;all&nbsp; --&nbsp; *&nbsp; &nbsp; &nbsp; *&nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0/0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.0.0.0/0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;state RELATED,ESTABLISHED<br />&nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp;0 ACCEPT&nbsp; &nbsp; &nbsp;icmp --&nbsp; *&nbsp; &nbsp; &nbsp; *&nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0/0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.0.0.0/0<br />&nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp;0 ACCEPT&nbsp; &nbsp; &nbsp;all&nbsp; --&nbsp; lo&nbsp; &nbsp; &nbsp;*&nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0/0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.0.0.0/0<br />&nbsp; &nbsp; 2&nbsp; &nbsp;148 ACCEPT&nbsp; &nbsp; &nbsp;tcp&nbsp; --&nbsp; *&nbsp; &nbsp; &nbsp; *&nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0/0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.0.0.0/0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;state NEW tcp dpt:22<br />&nbsp; 424&nbsp; 191K REJECT&nbsp; &nbsp; &nbsp;all&nbsp; --&nbsp; *&nbsp; &nbsp; &nbsp; *&nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0/0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.0.0.0/0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;reject-with icmp-host-prohibited</p><p>Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)<br /> pkts bytes target&nbsp; &nbsp; &nbsp;prot opt in&nbsp; &nbsp; &nbsp;out&nbsp; &nbsp; &nbsp;source&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;destination<br />25175 1538K ACCEPT&nbsp; &nbsp; &nbsp;all&nbsp; --&nbsp; *&nbsp; &nbsp; &nbsp; eth0&nbsp; &nbsp; 192.168.1.0/24&nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0/0<br />50029&nbsp; &nbsp;74M ACCEPT&nbsp; &nbsp; &nbsp;all&nbsp; --&nbsp; eth0&nbsp; &nbsp;*&nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0/0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 192.168.1.0/24&nbsp; &nbsp; &nbsp; state RELATED,ESTABLISHED<br />&nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp;0 REJECT&nbsp; &nbsp; &nbsp;all&nbsp; --&nbsp; *&nbsp; &nbsp; &nbsp; *&nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0/0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.0.0.0/0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;reject-with icmp-host-prohibited</p><p>Chain OUTPUT (policy ACCEPT 75 packets, 18184 bytes)<br /> pkts bytes target&nbsp; &nbsp; &nbsp;prot opt in&nbsp; &nbsp; &nbsp;out&nbsp; &nbsp; &nbsp;source&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;destination</p>]]></description>
			<author><![CDATA[null@example.com (pavlar)]]></author>
			<pubDate>Tue, 30 Oct 2012 10:52:12 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=306710#p306710</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=306708#p306708</link>
			<description><![CDATA[<p>а теперь покажите еще раз конфиг с правилами и вывод<br />iptables -L -n -v</p>]]></description>
			<author><![CDATA[null@example.com (alexfinn)]]></author>
			<pubDate>Tue, 30 Oct 2012 10:26:00 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=306708#p306708</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=306706#p306706</link>
			<description><![CDATA[<p>Исправил Переезапустил Вроде и так тоже работает.</p>]]></description>
			<author><![CDATA[null@example.com (pavlar)]]></author>
			<pubDate>Tue, 30 Oct 2012 10:25:04 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=306706#p306706</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=306705#p306705</link>
			<description><![CDATA[<p>эээ, а вы правила добавляли прямо в консоли что ли?<br />пропишите в конфиг те правила для FORWARD. что я приводил ДО <br /></p><div class="quotebox"><cite>pavlar пишет:</cite><blockquote><p>#-A FORWARD -j REJECT --reject-with icmp-host-prohibited</p></blockquote></div><p>и раскомментируйте ее</p><p>и проверьте</p><p>после корректировки файла перезапустите iptables</p>]]></description>
			<author><![CDATA[null@example.com (alexfinn)]]></author>
			<pubDate>Tue, 30 Oct 2012 10:16:03 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=306705#p306705</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=306704#p306704</link>
			<description><![CDATA[<div class="quotebox"><cite>alexfinn пишет:</cite><blockquote><p>а теперь покажите нынешний конфиг <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /></p></blockquote></div><div class="codebox"><pre><code># Generated by iptables-save v1.4.7 on Mon Oct 29 14:24:09 2012
*nat
:PREROUTING ACCEPT [219:21980]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -s 192.168.1.0/24 -o eth0 -j SNAT --to-source 194.44.31.236
COMMIT
# Completed on Mon Oct 29 14:24:09 2012
# Generated by iptables-save v1.4.7 on Mon Oct 29 14:24:09 2012
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [26:2050]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
#-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Mon Oct 29 14:24:09 2012</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (pavlar)]]></author>
			<pubDate>Tue, 30 Oct 2012 10:13:49 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=306704#p306704</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=306703#p306703</link>
			<description><![CDATA[<p>я ж говорю, покажите нынешний конфиг</p>]]></description>
			<author><![CDATA[null@example.com (alexfinn)]]></author>
			<pubDate>Tue, 30 Oct 2012 10:09:44 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=306703#p306703</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=306702#p306702</link>
			<description><![CDATA[<p>Так что так и оставить? Дыры не будет?</p>]]></description>
			<author><![CDATA[null@example.com (pavlar)]]></author>
			<pubDate>Tue, 30 Oct 2012 10:09:06 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=306702#p306702</guid>
		</item>
		<item>
			<title><![CDATA[Re: NAT CentOS 6.3]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=306701#p306701</link>
			<description><![CDATA[<p>а теперь покажите нынешний конфиг <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /></p>]]></description>
			<author><![CDATA[null@example.com (alexfinn)]]></author>
			<pubDate>Tue, 30 Oct 2012 10:08:55 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=306701#p306701</guid>
		</item>
	</channel>
</rss>
