<?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 Re: DNAT  to web server inside internal network in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799909#M23663</link>
    <description>Do you enable the ip forwarding in your kernel? please check /etc/sysctl.conf, you should have net.ipv4.ip_forward = 1&lt;BR /&gt;. if net.ipv4.ip_forward = 0 change it to "1" and execute sysctl -p on command line.</description>
    <pubDate>Tue, 06 Jun 2006 09:02:42 GMT</pubDate>
    <dc:creator>Delrish</dc:creator>
    <dc:date>2006-06-06T09:02:42Z</dc:date>
    <item>
      <title>DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799904#M23658</link>
      <description>Hello all, &lt;BR /&gt;&lt;BR /&gt;I am trying to route traffic from internet to my web server which is located inside my local network ( please see attachment ) to acomplish this I am using iptables ( script in attachment ) &lt;BR /&gt;but because of some reason when I enter ip address of machine with two NICs ( one with public IP address and one with private IP address ) I simpli do not receive web page from web server from my internal network.&lt;BR /&gt;&lt;BR /&gt;So please take I look in attachment and write down your opinions. I put 10.1.1.1 and 10.1.1.2 addresses but perhaps the mistake is lying there. Which ip address should I assign to eth1  ( I assigned 10.1.1.1, and 10.1.1.2 to my web server, but i tried with same address for eth1 and web server but it did not works )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Every comment is welcome.&lt;BR /&gt;Thank you.</description>
      <pubDate>Mon, 05 Jun 2006 01:29:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799904#M23658</guid>
      <dc:creator>debian111</dc:creator>
      <dc:date>2006-06-05T01:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799905#M23659</link>
      <description>You have to either Source NAT the incoming connection or have to setup the gateway for webserver as the private IP of the public IP machine (10.1.1.2) and Masquerade the outgoing connection in the public IP machine.&lt;BR /&gt;&lt;BR /&gt;It will be something simillar to &lt;BR /&gt;&lt;BR /&gt;Method 1:&lt;BR /&gt;&lt;BR /&gt;On the public machine:&lt;BR /&gt;&lt;BR /&gt;iptables -t nat -A PREROUTING -d 150.1.1.1 -p tcp -dport 80 -j DNAT --to-destination 10.1.1.2:80&lt;BR /&gt;&lt;BR /&gt;iptables -t nat -A POSROUTING -d 10.1.1.1 -p tcp -dport 80 -j SNAT --to-source  10.1.1.2&lt;BR /&gt;&lt;BR /&gt;Method 2:&lt;BR /&gt;&lt;BR /&gt;On the Public machine:&lt;BR /&gt;iptables -t nat -A PREROUTING -d 150.1.1.1 -p tcp -dport 80 -j DNAT --to-destination 10.1.1.2:80&lt;BR /&gt;&lt;BR /&gt;iptables -t nat -A PREROUTING -j MASQUERADE.&lt;BR /&gt;&lt;BR /&gt;one the webserver:&lt;BR /&gt;&lt;BR /&gt;route del default&lt;BR /&gt;route add default gw 10.1.1.2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Fine tune as per your requirements.&lt;BR /&gt;&lt;BR /&gt;-logu&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Jun 2006 05:29:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799905#M23659</guid>
      <dc:creator>Logu_2</dc:creator>
      <dc:date>2006-06-05T05:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799906#M23660</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;You need port forwarding.&lt;BR /&gt;&lt;BR /&gt;I've found iptables a bit byzantine to work with.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.fs-security.com" target="_blank"&gt;http://www.fs-security.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Firestarter is iptables based, configurable in X Windows via a gui and works very well.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 05 Jun 2006 05:40:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799906#M23660</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2006-06-05T05:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799907#M23661</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;I  did as Logu suggested me I mean I put this into my script &lt;BR /&gt;#!/bin/bash&lt;BR /&gt;&lt;BR /&gt;echo "0" &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;BR /&gt;&lt;BR /&gt;iptables -F FORWARD&lt;BR /&gt;&lt;BR /&gt;iptables -F -t nat&lt;BR /&gt;iptables -F -t mangle&lt;BR /&gt;&lt;BR /&gt;iptables -X -t nat&lt;BR /&gt;iptables -X -t mangle&lt;BR /&gt;&lt;BR /&gt;iptables -P FORWARD DROP&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;iptables -t nat -A PREROUTING -d 150.1.1.1 -p tcp --dport 80 -j DNAT --to-destination 10.1.1.2:80&lt;BR /&gt;iptables -t nat -A POSTROUTING -d 10.1.1.1 -p tcp --dport 80 -j SNAT --to-source 10.1.1.2&lt;BR /&gt;&lt;BR /&gt;echo "1" &amp;gt; /proc/sys/net/ipv4/conf/all/rp_filter&lt;BR /&gt;echo "1" &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and after starting script and issuing  iptables -t nat -L from command line I got output as follows&lt;BR /&gt;&lt;BR /&gt;debian:/# iptables -t nat -L&lt;BR /&gt;Chain PREROUTING (policy ACCEPT)&lt;BR /&gt;target     prot opt source               destination&lt;BR /&gt;DNAT       tcp  --  anywhere             debian              tcp dpt:www to:10.1.1.2:80&lt;BR /&gt;&lt;BR /&gt;Chain POSTROUTING (policy ACCEPT)&lt;BR /&gt;target     prot opt source               destination&lt;BR /&gt;SNAT       tcp  --  anywhere             10.1.1.1            tcp dpt:www to:10.1.1.2&lt;BR /&gt;&lt;BR /&gt;Chain OUTPUT (policy ACCEPT)&lt;BR /&gt;target     prot opt source               destination&lt;BR /&gt;debian:/#&lt;BR /&gt;&lt;BR /&gt;But I still can not receive web page from my web server which ip address is 10.1.1.2 , I really cannot find out what I made wrong. Any suggestion will help me .&lt;BR /&gt;I mean is there any kind of other features that I forgot to implement, I am new in this field and I do not have much experinnce in working with iptables.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Tue, 06 Jun 2006 01:19:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799907#M23661</guid>
      <dc:creator>debian111</dc:creator>
      <dc:date>2006-06-06T01:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799908#M23662</link>
      <description>I guess the problem is with the FORWARD policy which is set to DROP. You have to explicitly allow this traffic in the FORWARD chain or change the policy to ACCEPT.&lt;BR /&gt;&lt;BR /&gt;BTW, -X is to delete the userdefined chains.&lt;BR /&gt;&lt;BR /&gt;Just use this set of rules and let me know.&lt;BR /&gt;&lt;BR /&gt;echo "1" &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;BR /&gt;&lt;BR /&gt;iptables -F FORWARD&lt;BR /&gt;iptables -F -t nat&lt;BR /&gt;iptables -F -t mangle&lt;BR /&gt;&lt;BR /&gt;iptables -t nat -A PREROUTING -s ! 10.1.1.1 -d 150.1.1.1 -p tcp --dport 80 -j DNAT --to-destination 10.1.1.2:80&lt;BR /&gt;iptables -t nat -A POSTROUTING -d 10.1.1.1 -p tcp --dport 80 -j SNAT --to-source 10.1.1.2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-logu&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Jun 2006 06:15:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799908#M23662</guid>
      <dc:creator>Logu_2</dc:creator>
      <dc:date>2006-06-06T06:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799909#M23663</link>
      <description>Do you enable the ip forwarding in your kernel? please check /etc/sysctl.conf, you should have net.ipv4.ip_forward = 1&lt;BR /&gt;. if net.ipv4.ip_forward = 0 change it to "1" and execute sysctl -p on command line.</description>
      <pubDate>Tue, 06 Jun 2006 09:02:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799909#M23663</guid>
      <dc:creator>Delrish</dc:creator>
      <dc:date>2006-06-06T09:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799910#M23664</link>
      <description>Hi , &lt;BR /&gt;&lt;BR /&gt;I tried what Logu suggested me last day, but unfortunately I did not get expected result.&lt;BR /&gt;&lt;BR /&gt;Alireza says that I should enable ip forwarding &lt;BR /&gt;and I thought about that, I did not change anything in /etc/sysctl.conf file actually in that file I have &lt;BR /&gt;&lt;BR /&gt;/etc# cat sysctl.conf |more&lt;BR /&gt;#&lt;BR /&gt;# /etc/sysctl.conf - Configuration file for setting system variables&lt;BR /&gt;# See sysctl.conf (5) for information.&lt;BR /&gt;#&lt;BR /&gt;#kernel.domainname = example.com&lt;BR /&gt;#net/ipv4/icmp_echo_ignore_broadcasts=1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What do you think should I make somthing with&lt;BR /&gt;/etc/iproute2 file, and add some routes with &lt;BR /&gt;route add ( something like that ). &lt;BR /&gt;What do you think? Is neccessary first make possibele to "see" each other interfaces eth0 and eth1, in order to exchange packets.&lt;BR /&gt;&lt;BR /&gt;I am really interested in making nat on my computer using iptables software package. &lt;BR /&gt;&lt;BR /&gt;Any suggestion, advice, will help me, and thanks for this help&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 07 Jun 2006 00:57:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799910#M23664</guid>
      <dc:creator>debian111</dc:creator>
      <dc:date>2006-06-07T00:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799911#M23665</link>
      <description>Should I change some options in /etc/network/options?&lt;BR /&gt; I will try this today leter.&lt;BR /&gt;&lt;BR /&gt;/etc/network# cat options&lt;BR /&gt;ip_forward=no   ( I mean this change to yes )&lt;BR /&gt;spoofprotect=yes&lt;BR /&gt;syncookies=no&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jun 2006 01:52:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799911#M23665</guid>
      <dc:creator>debian111</dc:creator>
      <dc:date>2006-06-07T01:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799912#M23666</link>
      <description>Could you give me a simple diagram (.jpg) with your network details, inlcuding from where you are trying to access the webserver. From webserver network or from the Machine A?&lt;BR /&gt;&lt;BR /&gt;Are you able to access your webserver from 10.1.1.2 using the the IP 10.1.1.1, something like &lt;A href="http://10.1.1.1" target="_blank"&gt;http://10.1.1.1&lt;/A&gt; ?&lt;BR /&gt;&lt;BR /&gt;Please give the output of the following commands from the webserver(10.1.1.1) and from the gateway (10.1.1.2)&lt;BR /&gt;&lt;BR /&gt;On the webserver (10.1.1.1):&lt;BR /&gt;/sbin/route -n&lt;BR /&gt;/sbin/iptables -L -n -v&lt;BR /&gt;/sbin/iptables -t nat -L -n -v&lt;BR /&gt;&lt;BR /&gt;Try to access the webserver from machine A, after giving the following command and note down the output&lt;BR /&gt;/usr/sbin/tcpdump -nei eth0 port 80&lt;BR /&gt;&lt;BR /&gt;On the gateway (10.1.1.2):&lt;BR /&gt;/sbin/route -n&lt;BR /&gt;/sbin/iptables -L -n -v&lt;BR /&gt;/sbin/iptables -t nat -L -n -v&lt;BR /&gt;cat /proc/sys/net/ipv4/ip_forward&lt;BR /&gt;&lt;BR /&gt;-logu</description>
      <pubDate>Wed, 07 Jun 2006 02:56:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799912#M23666</guid>
      <dc:creator>Logu_2</dc:creator>
      <dc:date>2006-06-07T02:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799913#M23667</link>
      <description>you should enable the ip forwarding. this option is disblaed by default. please dothe following command.&lt;BR /&gt;&lt;BR /&gt;echo "1" &amp;gt; /proc/sys/net/ipv4/ip_forward</description>
      <pubDate>Wed, 07 Jun 2006 03:07:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799913#M23667</guid>
      <dc:creator>Delrish</dc:creator>
      <dc:date>2006-06-07T03:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799914#M23668</link>
      <description>Also please check the rules on your webserver. try the following commands on your webserver to flush the rules on it. &lt;BR /&gt;&lt;BR /&gt;iptables -t nat -F&lt;BR /&gt;iptables -F</description>
      <pubDate>Wed, 07 Jun 2006 03:09:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799914#M23668</guid>
      <dc:creator>Delrish</dc:creator>
      <dc:date>2006-06-07T03:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799915#M23669</link>
      <description>I attached diagram. I am trying to access to web serer from some internet connected mashine which have public ip address, on diagram I signed it as machineA, it can be some machine B, C ...no mater. From firewall machine when I enter &lt;A href="http://10.1.1.1" target="_blank"&gt;http://10.1.1.1&lt;/A&gt; into browser, I can acess to webserver, and  from firewall I can ping 10.1.1.1--web server, but when I try to access to web server from some machine which is connected to eth0=150.1.1.1 ( it is home environment and I am trying access to webserver using notebook with an ip address 150.1.1.2 ( machineA)----I can not do that? I am testing this without internet connection at home. I maen I do not care about IP addresses because it is closed system. All machines are connected with crossover cables, I mean from machineA-from(eth0)----to-(eth0)---firewall-from(eth1)---to--(eth0)-webserver &lt;BR /&gt;is crossover cable as connection&lt;BR /&gt;&lt;BR /&gt;Other tests I will  try today later and put output tomorrow&lt;BR /&gt;&lt;BR /&gt;Thank you for you help.</description>
      <pubDate>Wed, 07 Jun 2006 03:51:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799915#M23669</guid>
      <dc:creator>debian111</dc:creator>
      <dc:date>2006-06-07T03:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799916#M23670</link>
      <description>Would you please provide the following information from both the servers&lt;BR /&gt;&lt;BR /&gt;uname -a&lt;BR /&gt;ifconfig&lt;BR /&gt;netstat -rn&lt;BR /&gt;iptables -L&lt;BR /&gt;iptables -t nat -L&lt;BR /&gt;cat /proc/sys/net/ipv4/ip_forward&lt;BR /&gt;lsmod&lt;BR /&gt;ping 10.1.1.1&lt;BR /&gt;ping 10.1.1.2&lt;BR /&gt;traceroute 10.1.1.1&lt;BR /&gt;traceroute 150.1.1.2&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jun 2006 04:05:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799916#M23670</guid>
      <dc:creator>Delrish</dc:creator>
      <dc:date>2006-06-07T04:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799917#M23671</link>
      <description>Hi Debian,&lt;BR /&gt;&lt;BR /&gt;Probably everybody mistaken unintentionaly game of .1 &amp;amp; .2 in your table ( may be I'm wrong!)&lt;BR /&gt;&lt;BR /&gt;So, the rule for NATing in your case is:&lt;BR /&gt;&lt;BR /&gt;IP of External NIC of firewall -&amp;gt; IP of your web server&lt;BR /&gt;&lt;BR /&gt;thus,as I have seen the IP of Web server is 10.1.1.1, the iptable lines should be:&lt;BR /&gt;iptables -t nat -A PREROUTING -d 150.1.1.1 -p tcp --dport 80 -j DNAT --to-destination 10.1.1.1:80&lt;BR /&gt;iptables -t nat -A POSTROUTING -d 10.1.1.1 -p tcp --dport 80 -j SNAT --to-source 10.1.1.2&lt;BR /&gt;&lt;BR /&gt;You also have to configure sysctl.conf for ip forwarding as illustrated above, and also make rules for forward table (for allowing forwarding traffic from firewaal to web server &amp;amp; vice versa) in iptables script.&lt;BR /&gt;Also make sure you have hosted website on port 80 only.&lt;BR /&gt;&lt;BR /&gt;Hope it will work..&lt;BR /&gt;regards,</description>
      <pubDate>Wed, 07 Jun 2006 08:14:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799917#M23671</guid>
      <dc:creator>kcpant</dc:creator>
      <dc:date>2006-06-07T08:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799918#M23672</link>
      <description>Add to earlier reply, the postrouting line should have source (-s) instead of destination (-d).&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jun 2006 08:17:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799918#M23672</guid>
      <dc:creator>kcpant</dc:creator>
      <dc:date>2006-06-07T08:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799919#M23673</link>
      <description>First of all, you made a mistake, you can get the webserver through the 150.1.1.1 ip address from 150.1.1.2&lt;BR /&gt;So please change your rules as below:&lt;BR /&gt;&lt;BR /&gt;iptables -t nat -A PREROUTING -p tcp -d 150.1.1.1 --dport 80 -j DNAT --to-destination 10.1.1.1&lt;BR /&gt;&lt;BR /&gt;please flush the other rules befor apply the above one.&lt;BR /&gt;iptables -t nat -F&lt;BR /&gt;iptables -F&lt;BR /&gt;&lt;BR /&gt;Now you can get the page with &lt;A href="http://150.1.1.1" target="_blank"&gt;http://150.1.1.1&lt;/A&gt;</description>
      <pubDate>Wed, 07 Jun 2006 08:38:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799919#M23673</guid>
      <dc:creator>Delrish</dc:creator>
      <dc:date>2006-06-07T08:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799920#M23674</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;After issuing tcpdump -nei eth0 port 80 on server 10.1.1.1 I got the following output&lt;BR /&gt;&lt;BR /&gt;[root@server /]# tcpdump -nei eth0 port 80&lt;BR /&gt;tcpdump: verbose output suppressed, use -v or -vv for full protocol decode&lt;BR /&gt;listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes&lt;BR /&gt;&lt;BR /&gt;then I tried to ping 10.1.1.1 from mechineA =150.1.1.1  &lt;BR /&gt;&lt;BR /&gt;debian:/# ping 10.1.1.1&lt;BR /&gt;connect: Network is unreachable&lt;BR /&gt;debian:/#&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rules I had on firewall are listed bellow&lt;BR /&gt;&lt;BR /&gt;makina:/# iptables -t nat -L&lt;BR /&gt;Chain PREROUTING (policy ACCEPT)&lt;BR /&gt;target     prot opt source               destination&lt;BR /&gt;DNAT       tcp  -- !10.1.1.1             debian              tcp dpt:www to:10.1.1.2:80&lt;BR /&gt;&lt;BR /&gt;Chain POSTROUTING (policy ACCEPT)&lt;BR /&gt;target     prot opt source               destination&lt;BR /&gt;SNAT       tcp  --  anywhere             10.1.1.1            tcp dpt:www to:10.1.1.2&lt;BR /&gt;&lt;BR /&gt;Chain OUTPUT (policy ACCEPT)&lt;BR /&gt;target     prot opt source               destination&lt;BR /&gt;makina:/#&lt;BR /&gt;&lt;BR /&gt;On webserver output of some commands are as following&lt;BR /&gt;&lt;BR /&gt;[root@server /]# route -n&lt;BR /&gt;Kernel IP routing table&lt;BR /&gt;Destination     Gateway         Genmask         Flags Metric Ref    Use Iface&lt;BR /&gt;169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0&lt;BR /&gt;10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth0&lt;BR /&gt;[root@server /]#&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[root@server /]# iptables -L&lt;BR /&gt;Chain INPUT (policy ACCEPT)&lt;BR /&gt;target     prot opt source               destination&lt;BR /&gt;&lt;BR /&gt;Chain FORWARD (policy ACCEPT)&lt;BR /&gt;target     prot opt source               destination&lt;BR /&gt;&lt;BR /&gt;Chain OUTPUT (policy ACCEPT)&lt;BR /&gt;target     prot opt source               destination&lt;BR /&gt;&lt;BR /&gt;Chain RH-Firewall-1-INPUT (0 references)&lt;BR /&gt;target     prot opt source               destination&lt;BR /&gt;[root@server /]#&lt;BR /&gt;&lt;BR /&gt;[root@server /]# iptables -L -n -v&lt;BR /&gt;Chain INPUT (policy ACCEPT 1414 packets, 106K bytes)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;&lt;BR /&gt;Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;&lt;BR /&gt;Chain OUTPUT (policy ACCEPT 1018 packets, 115K bytes)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;&lt;BR /&gt;Chain RH-Firewall-1-INPUT (0 references)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;[root@server /]#&lt;BR /&gt;&lt;BR /&gt;[root@server /]# iptables -t nat -L -n -v&lt;BR /&gt;Chain PREROUTING (policy ACCEPT 150 packets, 12390 bytes)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;&lt;BR /&gt;Chain POSTROUTING (policy ACCEPT 51 packets, 3821 bytes)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;&lt;BR /&gt;Chain OUTPUT (policy ACCEPT 51 packets, 3821 bytes)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;[root@server /]#&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;On firewall output of the same comands are  as following &lt;BR /&gt;Destination     Gateway         Genmask         Flags Metric Ref    Use Iface&lt;BR /&gt;150.1.1.0       0.0.0.0         255.255.255.0   U     0      0        0 eth0&lt;BR /&gt;10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth1&lt;BR /&gt;makina:/#&lt;BR /&gt;&lt;BR /&gt;makina:/# iptables -L -n -v&lt;BR /&gt;Chain INPUT (policy ACCEPT 1299 packets, 103K bytes)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;&lt;BR /&gt;Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;&lt;BR /&gt;Chain OUTPUT (policy ACCEPT 955 packets, 104K bytes)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;makina:/#&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;makina:/# iptables -t nat -L -n -v&lt;BR /&gt;Chain PREROUTING (policy ACCEPT 1 packets, 60 bytes)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;    0     0 DNAT       tcp  --  *      *      !10.1.1.1             150.1.1.1           tcp dpt:80 to:10.1.1.2:80&lt;BR /&gt;&lt;BR /&gt;Chain POSTROUTING (policy ACCEPT 27 packets, 1890 bytes)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;    0     0 SNAT       tcp  --  *      *       0.0.0.0/0            10.1.1.1            tcp dpt:80 to:10.1.1.2&lt;BR /&gt;&lt;BR /&gt;Chain OUTPUT (policy ACCEPT 27 packets, 1890 bytes)&lt;BR /&gt; pkts bytes target     prot opt in     out     source               destination&lt;BR /&gt;makina:/#&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jun 2006 01:31:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799920#M23674</guid>
      <dc:creator>debian111</dc:creator>
      <dc:date>2006-06-08T01:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799921#M23675</link>
      <description>Hi,&lt;BR /&gt;I attached all necessary parameters for webserver, I will try today what you suggested me, and I am hoping that will help me, &lt;BR /&gt;&lt;BR /&gt;Thank you for your help, it means me a lot.&lt;BR /&gt;Regards</description>
      <pubDate>Thu, 08 Jun 2006 01:34:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799921#M23675</guid>
      <dc:creator>debian111</dc:creator>
      <dc:date>2006-06-08T01:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799922#M23676</link>
      <description>&lt;BR /&gt;kcpant says &lt;BR /&gt;" thus,as I have seen the IP of Web server is 10.1.1.1, the iptable lines should be:&lt;BR /&gt;iptables -t nat -A PREROUTING -d 150.1.1.1 -p tcp --dport 80 -j DNAT --to-destination 10.1.1.1:80&lt;BR /&gt;iptables -t nat -A POSTROUTING -d 10.1.1.1 -p tcp --dport 80 -j SNAT --to-source 10.1.1.2 " &lt;BR /&gt;&lt;BR /&gt;But there is someting confusing to me 10.1.1.1 is ip address of web server and second nic interfece eth1 on firewall machine has ip address 10.1.1.2, and I can not understand how packets will find a path to 10.1.1.1 because 10.1.1.1 is ip address of nic interface located on web server which is separate machine, or perhaps second rule will direct packets from firewalls address 10.1.1.2 to webserver address 10.1.1.1.&lt;BR /&gt;&lt;BR /&gt;Just my opinion about this part of message.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jun 2006 01:46:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799922#M23676</guid>
      <dc:creator>debian111</dc:creator>
      <dc:date>2006-06-08T01:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: DNAT  to web server inside internal network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799923#M23677</link>
      <description>I think I messed it up. Let me try again and hope we will fix it.&lt;BR /&gt;&lt;BR /&gt;|MacA(150.1.1.2)|----|(150.1.1.1)fwall(10.1.1.2)|  ----|(10.1.1.1)wserver|&lt;BR /&gt;&lt;BR /&gt;I bet this time it should work. :)&lt;BR /&gt;Execute the following on th firewall:&lt;BR /&gt;#----------------------------------------&lt;BR /&gt;echo "1" &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;BR /&gt;&lt;BR /&gt;iptables -F &lt;BR /&gt;iptables -t nat -F&lt;BR /&gt;iptables -t mangle -F&lt;BR /&gt;&lt;BR /&gt;iptables -P FORWARD ACCEPT&lt;BR /&gt;&lt;BR /&gt;iptables -t nat -A PREROUTING -s ! 10.1.1.1 -d 150.1.1.1 -p tcp --dport 80 -j DNAT --to-destination 10.1.1.1:80&lt;BR /&gt;&lt;BR /&gt;iptables -t nat -A POSTROUTING -d 10.1.1.1 -p tcp --dport 80 -j SNAT --to-source 10.1.1.2&lt;BR /&gt;#-----------------------------------------</description>
      <pubDate>Thu, 08 Jun 2006 05:08:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/dnat-to-web-server-inside-internal-network/m-p/3799923#M23677</guid>
      <dc:creator>Logu_2</dc:creator>
      <dc:date>2006-06-08T05:08:27Z</dc:date>
    </item>
  </channel>
</rss>

