Logic Machine Forum
Open port check from Logic Machine - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2)
+--- Thread: Open port check from Logic Machine (/showthread.php?tid=3275)



Open port check from Logic Machine - Tokatubs - 01.04.2021

Is there a script or something to check if an outgoing port is open. It department says the port is open. But i dont seem to get the Lm communicating.


RE: Open port check from Logic Machine - admin - 06.04.2021

Use this to check if LM can connect to a certain TCP port or not.
Code:
function checktcp(ip, port)
  local sock = require('socket').tcp()
  sock:settimeout(1)
  local res, err = sock:connect(ip, port)
  sock:close()
  return res, err
end

-- change IP/PORT as needed
res, err = checktcp('192.168.1.1', 80)
if res then
  log('connect OK')
else
  log('connect ERROR', err)
end



RE: Open port check from Logic Machine - Tokatubs - 06.04.2021

Ok, thanks. 

Just post this in Resident script and add the ip of the Lm5 and the port 8883. Correct?


RE: Open port check from Logic Machine - Daniel - 06.04.2021

No this is the IP/domain where you want to connect to.


RE: Open port check from Logic Machine - Tokatubs - 06.04.2021

Ok, i am trying to test remote.logicmachine.net with port 8883. Ping works great. But trying the port.

Ok, then i know the port is still closed.
Thanks for help. 

* arg: 1
  * string: connect ERROR
* arg: 2
  * string: timeout



RE: Open port check from Logic Machine - Tokatubs - 08.04.2021

What port does Zerotier use on the LM, is it 9993. Not getting any confirmation on Zerotier from the LM.
It only says "requesting confirmation". But not seen in Zerotier.


RE: Open port check from Logic Machine - admin - 08.04.2021

ZeroTier uses 9993 UDP. The example script is for checking connection to TCP servers. Can you try checking remote.logicmachine.net port 443?


RE: Open port check from Logic Machine - Tokatubs - 08.04.2021

* string: connect OK

That works. IT just opened the 8883 to remote.logicmachine.net for me. Because that was the original thread.

But i cant seem to get the zerotier working. Have 4 other LM on Zerotier, only this one that i am not getting the request at Zerotier.


RE: Open port check from Logic Machine - admin - 08.04.2021

See this: https://zerotier.atlassian.net/wiki/spaces/SD/pages/6815768/Router+Configuration+Tips


RE: Open port check from Logic Machine - Tokatubs - 08.04.2021

9993 was closed on router. Now its working. 

Thanks a lot.