Dispynode using a public Client with nodes under NAT

Questions, issues regarding dispy / pycos

Moderator: admin

Post Reply
alemalza
Posts: 2
Joined: Mon May 31, 2021 4:17 pm

Dispynode using a public Client with nodes under NAT

Post by alemalza »

Hi,
i am trying to configure my dispynode network using a public server (with a reachable IP address) where i can expose any port i want with a(or more) node under a NAT (unreachable directly).
The schema is this:

Image

i would to do this:

Image

I read this topic from dispy official Documentation:

https://dispy.org/examples.html#port-fo ... g-with-ssh

and my configuratio is exactly the opposite.

I try, from node behind NAT to use:

Code: Select all

ssh -L 9700:localhost:9700 <remote client ip>
and from note start dispy with:

Code: Select all

dispynode.py -i <remote client ip>
but i get an error:
Traceback (most recent call last):
File "/usr/local/bin/dispynode.py", line 2217, in service_schedule
yield self.broadcast_ping_msg(task=task)
File "/usr/local/lib/python3.7/dist-packages/pycos/__init__.py", line 3688, in _schedule
retval = task._generator.send(task._value)
File "/usr/local/bin/dispynode.py", line 887, in broadcast_ping_msg
sock.bind((addrinfo.ip, 0))
OSError: [Errno 99] Cannot assign requested address
Could it work with an SSh port forwarding tunnel from client to nodes? In case wich ports are to forward?

Is there a configuration for manage fort forwarding and correct dispy communication in this schenario?

So many many thanks in advance
Giri
Site Admin
Posts: 58
Joined: Sun Dec 27, 2020 5:35 pm

Re: Dispynode using a public Client with nodes under NAT

Post by Giri »

The terminology you used is a bit confusing to me. I will go by what I understand from the figure.

It seems your client is publicly accessible from nodes but nodes can be accessed through SSH only. In that case, you can only use one node as nodes have to have distinct IP addresses. To use one node, follow steps below:

Code: Select all

ssh -L localhost:9701:localhost:9701 server (NODE in LAN1)
dispynode.py -d -i 127.0.0.1
In the client, give '127.0.0.1' as one of the nodes, e.g.,

Code: Select all

cluster = dispy.JobCluster(compute, nodes=['127.0.0.1', '*'], host='62.12.34.55', ...)
if the client is directly at IP address 62.12.34.55. If that is router's address, then use that as 'ext_host' address.
alemalza
Posts: 2
Joined: Mon May 31, 2021 4:17 pm

Re: Dispynode using a public Client with nodes under NAT

Post by alemalza »

Hi Giri,
so many thanks! When you write:

Code: Select all

ssh -L localhost:9701:localhost:9701 server (NODE in LAN1)
you speak about run this command on my node right? But i don't understand when at the end of command "server" what do you mean? The client public ip?
I don't know the public ip of my node (node does not have a public ip addres)

So many thanks in advance
Post Reply