Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "J. Bakshi" <joydeep@infoservices.in>
To: "Remzi AKYÜZ" <linuxliste@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: how to access port forwarded server through internet ?
Date: Tue, 15 Mar 2011 19:22:01 +0530	[thread overview]
Message-ID: <20110315192201.7b139b3f@debian> (raw)
In-Reply-To: <4D7F66A2.1080804@gmail.com>

Hello Remzi,

Thanks for your kind response. Yes the forwarding is enable as I have it in my script

`````````````````
echo 1 >  /proc/sys/net/ipv4/ip_forward
`````````````````````

But no luck :-( here is the modified rule

iptables -A INPUT -p tcp -m tcp --dport 81 -j ACCEPT
iptables -A PREROUTING -t nat -i ${LAN_IFACE} -p tcp --dport 81 -j DNAT --to 192.168.1.2:8080
iptables -A FORWARD -p tcp -m state --state NEW,ESTABLISHED --dport 81 -i ${LAN_IFACE} -j ACCEPT


On Tue, 15 Mar 2011 15:16:18 +0200
Remzi AKYÜZ <linuxliste@gmail.com> wrote:

> Hello,
> forwarding is enable?
> can you try this;
> 
> #sysctl -w net.ipv4.ip_forward=1
> #iptables -A FORWARD -p tcp -m state --state NEW,ESTABLISHED --dport 81 
> -i ${LAN_IFACE} -j ACCEPT
> 
> 
> On 03/15/2011 02:29 PM, J. Bakshi wrote:
> > Dear list,
> >
> > Here is a port forwarding issue.  I have a linux router which have two NIC; one facing WAN and the other facing LAN. IP forwarding is active and this box is working as a gateway. This box has LAN IP 192.168.1.1
> >
> > There is another box (webserver) 192.168.1.2 within the internal network and the router box has port forwarding to access the webserver.
> >
> > ```````````````````````````
> > iptables -A INPUT -p tcp -m tcp --dport 81 -j ACCEPT
> > iptables -A PREROUTING -t nat -i ${LAN_IFACE} -p tcp --dport 81 -j DNAT --to 192.168.1.2:8080
> > iptables -A FORWARD -p tcp -m state --state NEW --dport 81 -i ${LAN_IFACE} -j ACCEPT
> > ````````````````````````````
> >
> > So within LAN I can access the 192.168.1.2 web server through  192.168.1.1:81 as port forwarding is there. But I can not access the same through internet. If I point at<domain-name>:81 throught internet ; the browser simply reports it can't connect to the service; though the other services running at that very server are quite accessible through internet. Have I missed something in my firewall rule ? Could anyone give any clue please ?
> >
> > Thanks
> > --
> > To unsubscribe from this list: send the line "unsubscribe netfilter" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  reply	other threads:[~2011-03-15 13:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-15 12:29 how to access port forwarded server through internet ? J. Bakshi
2011-03-15 13:16 ` Remzi AKYÜZ
2011-03-15 13:52   ` J. Bakshi [this message]
2011-03-16  7:20     ` J. Bakshi
2011-03-16  7:33       ` Remzi AKYÜZ
2011-03-15 14:16 ` Pandu Poluan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110315192201.7b139b3f@debian \
    --to=joydeep@infoservices.in \
    --cc=linuxliste@gmail.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox