Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection refused #4

Closed
sinchb opened this issue Oct 16, 2013 · 1 comment
Closed

Connection refused #4

sinchb opened this issue Oct 16, 2013 · 1 comment

Comments

@sinchb
Copy link

sinchb commented Oct 16, 2013

Failed to map port on openwrt? Maybe a firewall problem?
root@OpenWrt:~/natpmp# python natpmp_client.py 60009 60009
Traceback (most recent call last):
File "natpmp_client.py", line 37, in
main()
File "natpmp_client.py", line 34, in main
print NATPMP.map_port(protocol, public_port, private_port, lifetime, gateway_ip=gateway)
File "/root/natpmp/NATPMP.py", line 333, in map_port
port_mapping_response = send_request_with_retry(gateway_ip, port_mapping_request, response_data_class=PortMapResponse, retry=retry)
File "/root/natpmp/NATPMP.py", line 357, in send_request_with_retry
data,source_addr = read_response(gateway_socket, n * request.retry_increment)
File "/root/natpmp/NATPMP.py", line 348, in read_response
data,source_addr = resp_socket.recvfrom(responseSize)
socket.error: [Errno 146] Connection refused

@yimingliu
Copy link
Owner

Possibly. The gateway socket isn't responding, meaning that it couldn't write to the NATPMP port (UDP 5351) on the router at all. Make sure that the NATPMP server is on ( http://wiki.openwrt.org/doc/howto/upnp ) and the port isn't being blocked.

I should probably catch that error in the library so it's not some random socket error being printed to the user's screen.

@sinchb sinchb closed this as completed Oct 6, 2017
jaraco referenced this issue in jaraco/nat-pmp Feb 10, 2021
use spaces, fixed indentation, format using autopep8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants