Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 2731  / 3 Years ago, thu, july 8, 2021, 11:17:57

I have written a python script to listen on port 2626 and executed the script.



proof that localhost is listening



tcp        0      0 127.0.0.1:2626          0.0.0.0:*               LISTEN


I can connect via telnet to this port over localhost with the following command:



:~$ telnet localhost 2626
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.


However when I try to connect from a remote machine the connection gets refused.



 :~$ telnet 128.251.xxx.xxx 2626
Trying 128.251.xxx.xxx...
telnet: Unable to connect to remote host: Connection refused


I even issued the following command to accept traffic on port 2626:



 sudo iptables -A INPUT -p tcp -i eth0 --dport 2626 -j ACCEPT


What could be the reason telnet on port 2626 is refusing connections from remote machines and how can I fix it?


More From » 11.10

 Answers
4

The 127.0.0.1:2626 from the netstat output indicates that your python script is only accepting connections on 127.0.0.1. If you wish to be able to accept connections from any address, have it accept connections on 0.0.0.0


[#41007] Saturday, July 10, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
adedes

Total Points: 454
Total Questions: 114
Total Answers: 111

Location: Turks and Caicos Islands
Member since Fri, May 8, 2020
4 Years ago
;