<?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>SupportSages &#187; redirection</title>
	<atom:link href="http://www.supportsages.com/blog/tag/redirection/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.supportsages.com/blog</link>
	<description>Technical Support and Server Management : Musings in the fox hole.</description>
	<lastBuildDate>Thu, 05 Jan 2012 03:05:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>How do I redirect a given port on a given IP address to a different port on a different host or network</title>
		<link>http://www.supportsages.com/blog/2009/04/how-do-i-redirect-a-port-to-another-port-on-another-ip-address-on-a-different-ip-address/</link>
		<comments>http://www.supportsages.com/blog/2009/04/how-do-i-redirect-a-port-to-another-port-on-another-ip-address-on-a-different-ip-address/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 06:57:38 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[nat]]></category>
		<category><![CDATA[redirection]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=118</guid>
		<description><![CDATA[To redirect to external IP and port, issue these three iptables rules. I am giving an example where we had to redirect port 80 of one server's IP to port 9001 (dotnetpanel port) of another machine.  64.192.34.215 is the IP from which are redirecting the port 80 to the destination IP, 208.24.210.233 and it's port 9001.

<blockquote>iptables -t nat -A PREROUTING --dst 64.192.34.215 -p tcp --dport 80  -j DNAT --to-destination 208.24.210.233:9001
iptables -t nat -A POSTROUTING -p tcp --dst 208.24.210.233 --dport 9001 -j SNAT  --to-source 64.192.34.215
iptables -t nat -A OUTPUT --dst 64.192.34.215 -p tcp --dport 80 -j DNAT --to-destination 208.24.210.233:9001</blockquote>

Isn't this ...]]></description>
			<content:encoded><![CDATA[<p>To redirect to external IP and port, issue these three iptables rules. I am giving an example where we had to redirect port 80 of one server&#8217;s IP to port 9001 (dotnetpanel port) of another machine.  64.192.34.215 is the IP from which are redirecting the port 80 to the destination IP, 208.24.210.233 and it&#8217;s port 9001.</p>
<blockquote><p>iptables -t nat -A PREROUTING &#8211;dst 64.192.34.215 -p tcp &#8211;dport 80  -j DNAT &#8211;to-destination 208.24.210.233:9001<br />
iptables -t nat -A POSTROUTING -p tcp &#8211;dst 208.24.210.233 &#8211;dport 9001 -j SNAT  &#8211;to-source 64.192.34.215<br />
iptables -t nat -A OUTPUT &#8211;dst 64.192.34.215 -p tcp &#8211;dport 80 -j DNAT &#8211;to-destination 208.24.210.233:9001</p></blockquote>
<p>Isn&#8217;t this similar to a tcp based proxy ?</p>
<p>But a simpler solution, but not flexible one, is to use rinetd. Internet redirection server. Refer  <a  href="http://www.boutell.com/rinetd/">http://www.boutell.com/rinetd/</a></p>
<p>Rinetd is very simple and I could achieve what I wanted in less than 3 mins, than making the nat rule work. But it had a limitation which I forgot <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+do+I+redirect+a+given+port+on+a+given+IP+address+to+a+different+port+on+a+different+host+or+network+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F118" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=How+do+I+redirect+a+given+port+on+a+given+IP+address+to+a+different+port+on+a+different+host+or+network+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F118" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/04/how-do-i-redirect-a-port-to-another-port-on-another-ip-address-on-a-different-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

