LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-30-2015, 12:36 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,638

Rep: Reputation: 183Reputation: 183
Forwarded port, connection refused


I'm probably doing something very simple wrong ...

I've backed up a working ubuntu host and restored that to a different computer giving it a new host name. Everything works just fine on the new host except for one thing ...

I have x11vnc server running on the host. From a remote, I can connect a viewer via the default port 5900, no problem. However, I actually want the remote to use port 3389.

On the x11vnc server I have the following iptables command:

/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 3389 -j REDIRECT --to-port 5900

That works fine on the original host, but for some reason does not work on the new host. An nmap scan of the new host shows port 5900 open, but not 3389. I can telnet to 5900, but not 3389:

Code:
$ telnet 192.168.0.99 5900
Trying 192.168.0.99...
Connected to 192.168.0.99.
Escape character is '^]'.
RFB 003.008

$ telnet 192.168.0.99 3389
Trying 192.168.0.99...
telnet: connect to address 192.168.0.99: Connection refused
These computers are essentially clones of each other. I don't understand the problem. Need help.
 
Old 10-30-2015, 02:58 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Is the interface on the clone really named eth0? In other words, did you adapt the udev rule that names interfaces based on their hardcoded MAC address (/etc/udev/rules.d/70-persistent-network-rules or so)?

Or: You can put log targets in your iptables rules, e.g. add an almost identical line before the REDIRECT, but with -j LOG. The output goes to /var/log/syslog. Do this on both servers, also in the INPUT chain, and compare the results.
 
Old 10-30-2015, 12:03 PM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,638

Original Poster
Rep: Reputation: 183Reputation: 183
Quote:
Originally Posted by berndbausch View Post
Is the interface on the clone really named eth0? In other words, did you adapt the udev rule that names interfaces based on their hardcoded MAC address (/etc/udev/rules.d/70-persistent-network-rules or so)?
Good call on that! I clobbered the /etc/udev/rules.d/70-persistent-net.rules with the original machine's. I deleted that file, rebooted, and now I can connect to that port. Thanks!
 
  


Reply

Tags
connection refused, iptables


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
port 22 connection refused satimis Linux - Networking 4 09-18-2010 09:55 AM
ssh: connection refused, port 22 Roko Linux - Networking 5 12-01-2008 05:12 AM
Connection refused error for port 25 jgnasser Linux - Networking 3 08-25-2004 07:09 AM
port 22: connection refused lkalman Linux - Networking 13 06-17-2003 07:55 PM
Connection Refused on port 9240 Rustiy Linux - Networking 2 04-22-2003 09:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration