<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: iptables evilness</title>
	<atom:link href="http://inodes.org/blog/2006/11/13/iptables-evilness/feed/" rel="self" type="application/rss+xml" />
	<link>http://inodes.org/blog/2006/11/13/iptables-evilness/</link>
	<description>Moo - Development, Trouble-shooting and Random thoughts...</description>
	<pubDate>Thu, 20 Nov 2008 21:11:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Artem</title>
		<link>http://inodes.org/blog/2006/11/13/iptables-evilness/#comment-1913</link>
		<dc:creator>Artem</dc:creator>
		<pubDate>Mon, 29 Oct 2007 01:10:56 +0000</pubDate>
		<guid isPermaLink="false">http://inodes.org/blog/2006/11/13/iptables-evilness/#comment-1913</guid>
		<description>John,
You sound like somebody who understands about iptables,
so I thought you could advice on the following.
I am running iptables firewall for my home network and I know how to do all the normal things: forwarding external http requests to my internal webserver, etc. Yet I can't manage to do the following non-standard trick, which I planned as a joke. Here is what I need to happen: when my friend tries to use my internal host to reach his favorite website, I forward the IP to my own internal webserver and serve him my fake version of the page. Sounds like an easy thing for iptables - use PREROUTING chain to forward the IP of the targeted website to the IP of my dedicated webserver on the inside. So far this did not work for me: internal hosts do loose connection with the target website, but my internal webserver is not getting any requests and browser request times out. Here is what I have added to my rc.firewall script:

$IPTABLES -t nat -A PREROUTING -i eth1 -p tcp -d 18.4.15.73 --dport 80 -j DNAT --to-destination 192.168.8.3:80
$IPTABLES -A FORWARD -i eth1 -p tcp -d 192.168.8.3 --dport 80 -j ACCEPT

where eth1 connects to my internal LAN 192.168.8.0/24 and 18.4.15.73 is the web address that I need forwarded to my fake server.  What am I missing?
Thanks.</description>
		<content:encoded><![CDATA[<p>John,<br />
You sound like somebody who understands about iptables,<br />
so I thought you could advice on the following.<br />
I am running iptables firewall for my home network and I know how to do all the normal things: forwarding external http requests to my internal webserver, etc. Yet I can&#8217;t manage to do the following non-standard trick, which I planned as a joke. Here is what I need to happen: when my friend tries to use my internal host to reach his favorite website, I forward the IP to my own internal webserver and serve him my fake version of the page. Sounds like an easy thing for iptables - use PREROUTING chain to forward the IP of the targeted website to the IP of my dedicated webserver on the inside. So far this did not work for me: internal hosts do loose connection with the target website, but my internal webserver is not getting any requests and browser request times out. Here is what I have added to my rc.firewall script:</p>
<p>$IPTABLES -t nat -A PREROUTING -i eth1 -p tcp -d 18.4.15.73 &#8211;dport 80 -j DNAT &#8211;to-destination 192.168.8.3:80<br />
$IPTABLES -A FORWARD -i eth1 -p tcp -d 192.168.8.3 &#8211;dport 80 -j ACCEPT</p>
<p>where eth1 connects to my internal LAN 192.168.8.0/24 and 18.4.15.73 is the web address that I need forwarded to my fake server.  What am I missing?<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://inodes.org/blog/2006/11/13/iptables-evilness/#comment-51</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Fri, 24 Nov 2006 02:15:29 +0000</pubDate>
		<guid isPermaLink="false">http://inodes.org/blog/2006/11/13/iptables-evilness/#comment-51</guid>
		<description>You are an evil, evil, man.</description>
		<content:encoded><![CDATA[<p>You are an evil, evil, man.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
