<?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>Simon Žekar - unix, communications, stupidities &#187; pf</title>
	<atom:link href="http://simon.zekar.com/tag/pf/feed/" rel="self" type="application/rss+xml" />
	<link>http://simon.zekar.com</link>
	<description>"Unix is simple, but it takes a genious to understand the simplicity" --Dennis Ritchie</description>
	<lastBuildDate>Fri, 23 Apr 2010 22:11:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>FreeBSD massive port forwarding</title>
		<link>http://simon.zekar.com/2009/02/07/freebsd-massive-port-forwarding/</link>
		<comments>http://simon.zekar.com/2009/02/07/freebsd-massive-port-forwarding/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 20:15:08 +0000</pubDate>
		<dc:creator>sIMON</dc:creator>
				<category><![CDATA[general bluez]]></category>
		<category><![CDATA[forwarding]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[pf]]></category>
		<category><![CDATA[port]]></category>

		<guid isPermaLink="false">http://simon.zekar.com/?p=68</guid>
		<description><![CDATA[Portfwd was the choice of software when I ever needed to forward a port from the server to another server &#8211; multiple hops away (not NAT port mapping).
It uses configuration like this (193.2.1.66 is the local ip, 193.2.1.80 is destination server IP):
bind-address 193.2.1.66
tcp { 55443 { =&#62; 193.2.1.80:443 } }
tcp { 55022 { =&#62; 193.2.1.80:22 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://portfwd.sourceforge.net/" target="_blank">Portfwd</a> was the choice of software when I ever needed to forward a port from the server to another server &#8211; multiple hops away (not NAT port mapping).</p>
<p>It uses configuration like this (193.2.1.66 is the local ip, 193.2.1.80 is destination server IP):</p>
<p><code>bind-address 193.2.1.66<br />
tcp { 55443 { =&gt; 193.2.1.80:443 } }<br />
tcp { 55022 { =&gt; 193.2.1.80:22 } }</code></p>
<p>But it fails doing its job right when you use this on a really busy port/service (500 or more simultaneous established TCP connections).</p>
<p><a href="http://www.openbsd.org/faq/pf/" target="_blank">pf</a> does the forwarding well even over 1000 TCP connections. Example:</p>
<p><code>rdr on em0 proto tcp from any to 193.2.1.66 port 55443 -&gt; 193.2.1.80 port 443<br />
rdr on em0 proto tcp from any to 193.2.1.66 port 55022 -&gt; 193.2.1.80 port 22<br />
nat on em0 from any to 193.2.1.80 -&gt; 193.2.1.66</code></p>
<p>- the em0 is the name of the outside interface. Without the nat rule, destination server would see a packet with source ip of the client so it would send a packet back directly to the client which causes asymmetric routing and very possible problems. The nat rule changes the source IP to the port forwarders one.</p>
<p>Happy forwarding,<br />
S.</p>
]]></content:encoded>
			<wfw:commentRss>http://simon.zekar.com/2009/02/07/freebsd-massive-port-forwarding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
