Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Can't see my UPnP Opened Ports
Interesting situation - apologies for the long Preface:
After setting Port Forwards via UPnP on a Google Fiber modem, the modem decided to ignore them after a few days. The ports were still listed using MiniUPnPC (upnpc -l , in Linux), but I could not connect to them and did not show up as 'Open' using various Port Testing Web tools.
Once I deleted them and recreated them, they became 'active', I could connect and they showed as 'Open' on the Port Testing Web sites.

The Code:
So I found this very nice little Python code to test Ports:
import socket

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(2)                                      #2 Second Timeout
result = sock.connect_ex(('',yyyyy))
if result == 0:
  print 'port OPEN'
  print 'port CLOSED, connect_ex returned: '+str(result)
And tried it on the Google Modem I was behind.
Oddly, those Ports Opened Manually through Google's Admin Web interface returned 'port OPEN', while those opened via UPnP always showed 'port CLOSED, connect_ex returned: 111'.
Testing from another location (not behind the Google Fiber modem, the above code worked correctly for both Manually opened Ports and those opened via UPnP.

Finally to my Question:
I need to be able to test if a given port is actually open from behind the Google Fiber modem, and then delete/add it again if not. Is there something wrong with the above code to do this, or another way to test, or perhaps a setting in Google Fiber modem that I missed?

Sorry if this is not appropriate for this forum. It covers so many different areas, I'm not sure where to post it...

Thank you for your time.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Async socket server and ports Pengwyn 1 571 Feb-28-2019, 12:13 AM
Last Post: DeaD_EyE

Forum Jump:

Users browsing this thread: 1 Guest(s)