Re: Iptables rule to access machine behind the gateway ...

Sameer Verma <[email protected]>
Newsgroups gmane.network.nocat
Message-ID <[email protected]>
Scott C. Lemon wrote:

> I know that I saw this addressed before, however I can not find the 
> solution in the archives ... I've been searching for a while ...
>  
> I want to add a rule to iptables that will allow me to access a 
> machine, that is behind the nocat gateway, from the Internet.
>  
> In our various locations, we have both access points and some 
> computers that are on the "internal" network.  Often, I want to be 
> able to access these using either VNC or a Web Browser from out on the 
> Internet.
>  
> How can I define a rule that maps a port on the "external" network 
> side, to a address:port on the "internal" side?  I have not yet 
> figured out the proper iptables syntax to do this ...
>  
> Thanks!
>  
>  
> Scott C. Lemon


Scott,
Something like this should give you unfettered access from the outside 
to a service running internally. This example is to do Remote Desktop on 
Windows (port 3389).

iptables -t nat -A PREROUTING  -p tcp --dport 3389 -j DNAT 
--to-destination 192.168.89.10:3389

Run this after running Nocat.

Hope this helps.

Sameer

-- 
Dr. Sameer Verma, Ph.D.
Asst. Professor of Information Systems
San Francisco State University
San Francisco CA 94132 USA
http://verma.sfsu.edu/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.