<?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; iptables</title>
	<atom:link href="http://www.supportsages.com/blog/tag/iptables/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>lxadmin aka Kloxo not listening in a centos after a default installation. Please help!</title>
		<link>http://www.supportsages.com/blog/2009/05/lxadmin-aka-kloxo-not-listening-in-a-centos-after-a-default-installation-please-help/</link>
		<comments>http://www.supportsages.com/blog/2009/05/lxadmin-aka-kloxo-not-listening-in-a-centos-after-a-default-installation-please-help/#comments</comments>
		<pubDate>Mon, 18 May 2009 13:06:25 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[kloxo]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[lxadmin]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=361</guid>
		<description><![CDATA[Klaxo was installed without any errors. But still inside the server Klaxo and the stuffs were working, but from a browser in the WWW, it isn't and hows cannot be found or page cannot be displayed errors

telnet ip.ip.ip.ip 7777 was working from inside the server, but not from outside network. It was showing,
<code>
telnet  ip.ip.ip.ip 7777
Trying  ip.ip.ip.ip...
telnet: Unable to connect to remote host: No route to host</code>

It was returning the same for every port, except 22. In a normal situation, if the port 22 also was not working, the issue could have been network related, but in this case ...]]></description>
			<content:encoded><![CDATA[<p>Klaxo was installed without any errors. But still inside the server Klaxo and the stuffs were working, but from a browser in the WWW, it isn&#8217;t and hows cannot be found or page cannot be displayed errors</p>
<p>telnet ip.ip.ip.ip 7777 was working from inside the server, but not from outside network. It was showing,<br />
<code><br />
telnet  ip.ip.ip.ip 7777<br />
Trying  ip.ip.ip.ip...<br />
telnet: Unable to connect to remote host: No route to host</code></p>
<p>It was returning the same for every port, except 22. In a normal situation, if the port 22 also was not working, the issue could have been network related, but in this case port 22 was working fine. So the issue was not related to networking, but &#8230;&#8230; ? Guess what ?</p>
<p>Yes. Any seasoned administrator should have guessed the answer to be the firewall and yes that was right. The iptables ruleset had a line which says,</p>
<p><code>REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited</code></p>
<p>Deleted that line and things went smooth after that.</p>
<p>Don&#8217;t forget to run save the iptables rules, by executing the commands below,<br />
<code><br />
[root@server ~]# iptables -D RH-Firewall-1-INPUT  10<br />
[root@server ~]# /etc/init.d/iptables save<br />
Saving firewall rules to /etc/sysconfig/iptables:          [  OK  ]<br />
[root@server ~]# iptables-save</code></p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=lxadmin+aka+Kloxo+not+listening+in+a+centos+after+a+default+installation.+Please+help%21+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F361" 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=lxadmin+aka+Kloxo+not+listening+in+a+centos+after+a+default+installation.+Please+help%21+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F361" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/05/lxadmin-aka-kloxo-not-listening-in-a-centos-after-a-default-installation-please-help/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>

