<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic iptables DNAT in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/iptables-dnat/m-p/4954153#M46654</link>
    <description>I have a multihomed linux 2.6 machine running iptables 1.2.11 which I use as my router.&lt;BR /&gt;&lt;BR /&gt;There is my network configuration:&lt;BR /&gt;Test1 -(subnet_1)- eth0 Linux_Router_with_Nat eth2 -(subnet_2)- Cisco_Router -(subnet_3)- Test2&lt;BR /&gt;&lt;BR /&gt;I wish to do DNAT on Linux Router so that any traffic arriving on the IP_from_subnet_2 are automatically redirected to the Test1.&lt;BR /&gt;&lt;BR /&gt;I've added the following rule:&lt;BR /&gt;iptables -t nat -A PREROUTING -d &lt;IP_FROM_SUBNET_2&gt; -i eth2 -j DNAT --to-destination &lt;IP_TEST1&gt;&lt;BR /&gt;&lt;BR /&gt;I have a default policy of ACCEPT in my FORWARD and INPUT chains.&lt;BR /&gt;&lt;BR /&gt;Now all packets from the subnet_2 are redirected  to Test1.&lt;BR /&gt;&lt;BR /&gt;But I have problem with subnet_3. Test1 does not receive any packets from this subnet.&lt;BR /&gt; &lt;BR /&gt;"pkts" and "bytes" columns increasing in "iptables -L -n -v -t nat" output when I attempt to make connection to Test1 from Test2 but "forward" chain is empty; seems DNAT packets not getting to FORWARD chain.   &lt;BR /&gt;&lt;BR /&gt;Tell anyone tell me why I can not get this working from subnet_3?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Sergejs&lt;/IP_TEST1&gt;&lt;/IP_FROM_SUBNET_2&gt;</description>
    <pubDate>Mon, 23 Jan 2006 08:48:47 GMT</pubDate>
    <dc:creator>Sergejs Svitnevs</dc:creator>
    <dc:date>2006-01-23T08:48:47Z</dc:date>
    <item>
      <title>iptables DNAT</title>
      <link>https://community.hpe.com/t5/operating-system-linux/iptables-dnat/m-p/4954153#M46654</link>
      <description>I have a multihomed linux 2.6 machine running iptables 1.2.11 which I use as my router.&lt;BR /&gt;&lt;BR /&gt;There is my network configuration:&lt;BR /&gt;Test1 -(subnet_1)- eth0 Linux_Router_with_Nat eth2 -(subnet_2)- Cisco_Router -(subnet_3)- Test2&lt;BR /&gt;&lt;BR /&gt;I wish to do DNAT on Linux Router so that any traffic arriving on the IP_from_subnet_2 are automatically redirected to the Test1.&lt;BR /&gt;&lt;BR /&gt;I've added the following rule:&lt;BR /&gt;iptables -t nat -A PREROUTING -d &lt;IP_FROM_SUBNET_2&gt; -i eth2 -j DNAT --to-destination &lt;IP_TEST1&gt;&lt;BR /&gt;&lt;BR /&gt;I have a default policy of ACCEPT in my FORWARD and INPUT chains.&lt;BR /&gt;&lt;BR /&gt;Now all packets from the subnet_2 are redirected  to Test1.&lt;BR /&gt;&lt;BR /&gt;But I have problem with subnet_3. Test1 does not receive any packets from this subnet.&lt;BR /&gt; &lt;BR /&gt;"pkts" and "bytes" columns increasing in "iptables -L -n -v -t nat" output when I attempt to make connection to Test1 from Test2 but "forward" chain is empty; seems DNAT packets not getting to FORWARD chain.   &lt;BR /&gt;&lt;BR /&gt;Tell anyone tell me why I can not get this working from subnet_3?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Sergejs&lt;/IP_TEST1&gt;&lt;/IP_FROM_SUBNET_2&gt;</description>
      <pubDate>Mon, 23 Jan 2006 08:48:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/iptables-dnat/m-p/4954153#M46654</guid>
      <dc:creator>Sergejs Svitnevs</dc:creator>
      <dc:date>2006-01-23T08:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: iptables DNAT</title>
      <link>https://community.hpe.com/t5/operating-system-linux/iptables-dnat/m-p/4954154#M46655</link>
      <description>Just checking: have you set &lt;BR /&gt;"sysctl net.ipv4.ip_forward" to 1? It is the master switch for all IP routing.&lt;BR /&gt;&lt;BR /&gt;What's in your routing table?&lt;BR /&gt;Linux_Router's default gateway should be pointing towards the Cisco_Router or there should be a specific route on Linux_router to the subnet_3 through the Cisco_Router. Otherwise the rp_filter might drop the packets.&lt;BR /&gt;&lt;BR /&gt;To test, set "sysctl net.ipv4.conf.all.rp_filter=0".&lt;BR /&gt;&lt;BR /&gt;If you don't have the "sysctl" command, you can use "echo 1 &amp;gt;/proc/sys/net/ipv4/ip_forward" and "echo 0 &amp;gt; /proc/sys/net/ipv4/conf/all/rp_filter".&lt;BR /&gt;</description>
      <pubDate>Mon, 23 Jan 2006 09:45:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/iptables-dnat/m-p/4954154#M46655</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2006-01-23T09:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: iptables DNAT</title>
      <link>https://community.hpe.com/t5/operating-system-linux/iptables-dnat/m-p/4954155#M46656</link>
      <description>Matti,&lt;BR /&gt;&lt;BR /&gt;IP forwarding is already enabled (I can forward packet from subnet_2 to subnet_1). It was not an issue.&lt;BR /&gt;&lt;BR /&gt;I have added a new route to Linux router describing the way how to reach Test2 via cisco router:&lt;BR /&gt;# route add -net subnet_3 gw Cisco_router&lt;BR /&gt;&lt;BR /&gt;and now DNAT works Ok.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot.</description>
      <pubDate>Mon, 23 Jan 2006 10:03:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/iptables-dnat/m-p/4954155#M46656</guid>
      <dc:creator>Sergejs Svitnevs</dc:creator>
      <dc:date>2006-01-23T10:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: iptables DNAT</title>
      <link>https://community.hpe.com/t5/operating-system-linux/iptables-dnat/m-p/4954156#M46657</link>
      <description>.</description>
      <pubDate>Mon, 23 Jan 2006 10:05:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/iptables-dnat/m-p/4954156#M46657</guid>
      <dc:creator>Sergejs Svitnevs</dc:creator>
      <dc:date>2006-01-23T10:05:18Z</dc:date>
    </item>
  </channel>
</rss>

