Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Please do not blame on me for bringing that question here but after days of searching in Internet for the answer I gave up and desided to ask the question myself.
I have VNC running on Redhat 9.0. When I try to connect with VNC client in my internal network (addresses 192.xxx...) I can connect with no problems. But if I try to connect from the external world or even in internal network by giving external IP my connection fails with an error Connection refused (10061).
My internal network stays behind a hardware firewall/router so the most obvious thing to look after would be the router settings. On the router connected to CableModem I opened the ports 5900, 5901, 5800, 5801, 21, 22 and forwarded them to the same port numbers of the internal IP of my Redhat. On the Redhat (RH) box I disabled the firewall at all.
From outside I can connect to Telnet(21) or SSH(22) but for some reason it fails to connect to VNC. From the client I tried to specify "24.xxx.xxx.xxx:5900", "24.xxx.xxx.xxx:5901", "24.xxx.xxx.xxx:0", "24.xxx.xxx.xxx:1", "24.xxx.xxx.xxx:5800", "24.xxx.xxx.xxx:5801" and nothing works.
I even tried to put my RH to demilitarized zone (DMZ) so the external IP is mapped to RH internal IP but the connection still fails.
I forgot to mention that if I try to connect to Redhat VNC from the same box by giving the internal IP everything works fine but with the external IP it fails with the same error.
Actually it is a good thing that this is failing because connecting directly to VNC over the internet is a horrible breach of security. VNC transmits EVERYTHING (including passwords) in clear text.
So, what you really want to do is learn how to set up an SSH tunnel that VNC will work through. Since you can already connect via SSH, this should solve your problem. If you do a search here, you'll find dozens of threads on how to run VNC over an SSH tunnel.
VNC over SSH works fine, thank you for the advise but I still do not understand why the direct connection doesnot work if all the necesary ports are open.
I agree, from what you've posted it should work with a direct connection. The only thing I can guess is that somehow the port forwarding isn't quite right. You really should only have to forward one port for each screen you've got running on VNC. You've disabled the firewall, so that isn't it and if you can run VNC over an SSH tunnel, then VNC is working right. About the only thing left is the port forwarding.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.