<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DSH DSH &#187; iptables</title>
	<atom:link href="http://dshdsh.ru/tag/iptables/feed" rel="self" type="application/rss+xml" />
	<link>http://dshdsh.ru</link>
	<description>&#1069;&#1090;&#1086; &#1085;&#1072;&#1076;&#1086; &#1074;&#1080;&#1076;&#1077;&#1090;&#1100;!</description>
	<lastBuildDate>Mon, 12 Oct 2009 05:49:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>NAT для OpenVPN или “Как выйти во внутреннюю сеть?</title>
		<link>http://dshdsh.ru/19-01-nat-openvpn</link>
		<comments>http://dshdsh.ru/19-01-nat-openvpn#comments</comments>
		<pubDate>Mon, 19 Jan 2009 00:29:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/k/karolina/dshdsh.ru/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>364</b><br />
		<category><![CDATA[linux]]></category>
		<category><![CDATA[iptables]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://itbg.wordpress.com/wordpress/?p=26</guid>
		<description><![CDATA[Всем привет.
Сегодня маленькая заметка про OpenVPN.
Как-то пришлось мне ставитьOpenVPN. Сама установка не сложная, если делать всё по инструкции.
Проблемы начались позже. Как выяснилось, те NAT правила которые прописаны в официальном мануале:]]></description>
			<content:encoded><![CDATA[<sape_index><p>Всем привет.<br />
Сегодня маленькая заметка про OpenVPN.<br />
Как-то пришлось мне ставитьOpenVPN. Сама установка не сложная, если делать всё по инструкции.<br />
Проблемы начались позже. Как выяснилось, те NAT правила которые прописаны в официальном мануале:</p>
<p>FIREWALLS<br />
OpenVPN&#8217;s usage of a single UDP port makes it fairly firewall-friendly. You should add an entry to your firewall rules to allow incoming OpenVPN packets. On Linux 2.4+:<br />
iptables -A INPUT -p udp -s 1.2.3.4 &#8211;dport 1194 -j ACCEPT<br />
This will allow incoming packets on UDP port 1194 (OpenVPN&#8217;s default UDP port) from an OpenVPN peer at 1.2.3.4.<br />
If you are using HMAC-based packet authentication (the default in any of OpenVPN&#8217;s secure modes), having the firewall filter on source address can be considered optional, since HMAC packet authentication is a much more secure method of verifying the authenticity of a packet source. In that case:<br />
iptables -A INPUT -p udp &#8211;dport 1194 -j ACCEPT<br />
would be adequate and would not render the host inflexible with respect to its peer having a dynamic IP address.<br />
OpenVPN also works well on stateful firewalls. In some cases, you may not need to add any static rules to the firewall list if you are using a stateful firewall that knows how to track UDP connections. If you specify &#8211;ping n, OpenVPN will be guaranteed to send a packet to its peer at least once every n seconds. If n is less than the stateful firewall connection timeout, you can maintain an OpenVPN connection indefinitely without explicit firewall rules.<br />
You should also add firewall rules to allow incoming IP traffic on TUN or TAP devices such as:<br />
iptables -A INPUT -i tun+ -j ACCEPT<br />
to allow input packets from tun devices,<br />
iptables -A FORWARD -i tun+ -j ACCEPT<br />
to allow input packets from tun devices to be forwarded to other hosts on the local network,<br />
iptables -A INPUT -i tap+ -j ACCEPT<br />
to allow input packets from tap devices, and<br />
iptables -A FORWARD -i tap+ -j ACCEPT<br />
to allow input packets from tap devices to be forwarded to other hosts on the local network.<br />
These rules are secure if you use packet authentication, since no incoming packets will arrive on a TUN or TAP virtual device unless they first pass an HMAC authentication test.<br />
Позволят Вам попасть в свою сеть, но только не дальше сервера.<br />
Что-бы пакеты перебрасывались во внутреннюю сеть нужно ещё одно NAT правило<br />
На нашем сервере стоит 2 сетевых карты.<br />
eth0 &#8211; смотрит в интернет<br />
eth1 &#8211; смотрит в LAN. IP &#8211; 192.168.1.2<br />
Сам OpenVPN использует адреса из диапазона 10.0.0.0/24<br />
Напишем требуемое правило для того что-бы пользователи OpenVPN могли ходить в LAN<br />
iptables -v -t nat -A POSTROUTING -o eth1 -s 10.0.0.0/24 -j SNAT &#8211;to-source 192.168.1.2<br />
Всё, пробуем.</p>
</sape_index><!--c249110617320--><div></div>]]></content:encoded>
			<wfw:commentRss>http://dshdsh.ru/19-01-nat-openvpn/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

