<?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; Как соединить клиента с Server2 через Server1]]></title>
		<link>https://linuxforum.ru/viewtopic.php?id=13419</link>
		<atom:link href="https://linuxforum.ru/extern.php?action=feed&amp;tid=13419&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Как соединить клиента с Server2 через Server1».]]></description>
		<lastBuildDate>Sat, 07 May 2011 09:31:21 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Как соединить клиента с Server2 через Server1]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=176668#p176668</link>
			<description><![CDATA[<p>на 1.1.1.1<br />Выполните вот такой скрипт где local ваша локальная подсеть за 1.1.1.1<br /></p><div class="codebox"><pre><code>local=&quot;192.168.0.0/24&quot;
iptables -t nat -A PREROUTING -p udp --dport 1010 -j DNAT --to-destination 2.2.2.2:1010
iptables -i FORWARD -i $local -d 2.2.2.2 -p udp 1010 -j ACCEPT
iptables -i FORWARD -s  2.2.2.2 -o $local -p udp 1010 -j ACCEPT</code></pre></div><p>на 2.2.2.2<br />Где ip это реальный ип адрес смотрящий в инет в 1.1.1.1<br /></p><div class="codebox"><pre><code>ip=&quot;1.1.1.1&quot;&quot;
iptables -A INPUT -i $ip -p udp --sport 1010 -j ACCEPT
iptables -A OUTPUT -o $ip -p udp --dport 1010 -j ACCEPT</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Kettler)]]></author>
			<pubDate>Sat, 07 May 2011 09:31:21 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=176668#p176668</guid>
		</item>
		<item>
			<title><![CDATA[Как соединить клиента с Server2 через Server1]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=176666#p176666</link>
			<description><![CDATA[<p>Добрый день, Гуру!</p><p>Задача слеюущая: есть сервер S1(1.1.1.1) и сервер S2(2.2.2.2). На S2 поднята служба, работающая по UDP.<br />Мне нужно сделать так, чтобы клиент C1, обращаясь на S1 по порту, скажем, 1010 попадал на S2:2020, но при этом он не должен знать о существовании S2.<br />Оба сервера находятся в интернете. На обоих стоит CentOS 5.5. S2:2020 работает.</p><p>На данный момент я попытался вот что сделать на S1:</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">iptables -t nat -A PREROUTING -p udp --dport 1010 --dst 1.1.1.1 -j DNAT --to-destination 2.2.2.2<br />iptables -t nat -A PREROUTING -p udp --dport 1010 -j REDIRECT --to-ports 2020<br />iptables -t nat -A POSTROUTING -p udp --dport 2020 --dst 2.2.2.2 -j SNAT --to-source 1.1.1.1</p><p>iptables -I RH-Firewall-1-INPUT 1 -p udp --dport 1010 -j ACCEPT<br />iptables -I RH-Firewall-1-INPUT 2 -p udp --src 2.2.2.2 -j ACCEPT</div></p><br /><p>Цепочка RH-Firewall-1-INPUT используется в таблицах INPUT и FORWARD.<br />&quot;Обратные&quot; правила я не прописывал, т.к. в этой цепочке есть вот такое:<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">ACCEPT&nbsp; &nbsp; &nbsp;all&nbsp; --&nbsp; anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; state RELATED,ESTABLISHED</div><br />хотя... может, в этом и проблема?</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">Chain RH-Firewall-1-INPUT (2 references)<br />target&nbsp; &nbsp; &nbsp;prot opt source&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;destination<br />ACCEPT&nbsp; &nbsp; &nbsp;all&nbsp; --&nbsp; anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;anywhere<br />ACCEPT&nbsp; &nbsp; &nbsp;icmp --&nbsp; anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; icmp any<br />ACCEPT&nbsp; &nbsp; &nbsp;esp&nbsp; --&nbsp; anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;anywhere<br />ACCEPT&nbsp; &nbsp; &nbsp;ah&nbsp; &nbsp;--&nbsp; anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;anywhere<br />ACCEPT&nbsp; &nbsp; &nbsp;udp&nbsp; --&nbsp; anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;224.0.0.251&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;udp dpt:mdns<br />ACCEPT&nbsp; &nbsp; &nbsp;udp&nbsp; --&nbsp; anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; udp dpt:ipp<br />ACCEPT&nbsp; &nbsp; &nbsp;tcp&nbsp; --&nbsp; anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tcp dpt:ipp<br />ACCEPT&nbsp; &nbsp; &nbsp;all&nbsp; --&nbsp; anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; state RELATED,ESTABLISHED<br />ACCEPT&nbsp; &nbsp; &nbsp;tcp&nbsp; --&nbsp; anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; state NEW tcp dpt:ssh<br />REJECT&nbsp; &nbsp; &nbsp;all&nbsp; --&nbsp; anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;anywhere&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reject-with icmp-host-prohibited<br /></div></p><p>Казалось бы, обсосанная тема... но я пока не сомг добиться ее решеиня... Надеюсь, что вы мне подскажете, как быть?<br />Правильно ли вообще для этого использовать iptables? Или лучше смотреть в сторону SSH или NetCat?</p><p>Спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (Shul)]]></author>
			<pubDate>Sat, 07 May 2011 09:16:43 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=176666#p176666</guid>
		</item>
	</channel>
</rss>
