Re: Iptables Forwarding Vnc Connection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2003-02-15 at 01:29, Nathanael Morrison wrote:
> Hi,
> 
> I currently have several computers behind a linux gateway, one of which 
> is my personal computer. I often want to access my desktop from campus 
> using KDE's remote desktop feature. At the moment I forward any 
> connections to port 5900 to my pc. This works but then I thought, 
> wouldn't it be nice if I could to this securely with an ssh tunnel 
> Correct me if I'm wrong but, I think the connection gets tunneled 
> through ssh, and a connection is made locally (on the gateway) to port 
> 5900. Using iptables, is there a way to forward a locally generated 
> connection to another computer?
> 
Yes, you use PREROUTING and DNAT.

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 22 -s 192.168.0.1
-j DNAT --to 192.168.0.100:5900

Replace ips and ports as needed ...

You possibly need a FORWARD rule to forward the traffic once the
destination ip has changed.

> Your help would be greatly appreciated,
> 
> Nathanael Morrison
> 
-- 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(  Raymond Leach                       )
 ) Knowledge Factory                  (
(                                      )
 ) Tel: +27 11 445 8100               (
(  Fax: +27 11 445 8101                )
 )                                    (
(  http://www.knowledgefactory.co.za/  )
 ) http://www.saptg.co.za/            (
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   o                                o
    o                              o
        .--.                  .--.
       | o_o|                |o_o |
       | \_:|                |:_/ |
      / /   \\              //   \ \
     ( |     |)            (|     | )
     /`\_   _/'\          /'\_   _/`\
     \___)=(___/          \___)=(___/

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux