Yea, basically this is the run-down of the IGD error and the local net support as I understand it (these are two separate issues from what I can see):
-
sn_node
only supports, from what I gather, networks that run entirely on localhost or networks forward across NAT. LAN nets, etc. that don’t run on local but don’t require port forwarding either don’t seem to be supported I think… This is not a limitation of sn_node
but comes from qp2p
. This is what I understand that @tfa and @mav we’re wrestling with in part.
- The IGD error you’re receiving is not actually a product of the above, but is related. It seems like a bug with automatic port-forwarding via UPnP, which I wrote about in this issue. This is pertinent to nets that are port-forwarded across NAT, which has nothing really to do with running a LAN net, but is a misleading error you’ll receive when you try. Manual port forwarding can be used to get around this (specify both
--local-ip
and --external-ip
after setting up the port forwarding). If you’re running LAN or something, you’d still be dead in the water, as per the above point, probably due to lack of support (not due to this error).
If this is also due to IGD, then I have a theory that might be worth testing…
I’ve little-to-no experience with docker, so I don’t know if I can help necessarily. Consider everything following to be speculation. But the difference between --public
and --network=host
seems related to the second issue considering it’s creating a “software network bridge” that probably looks like a NAT traversal to the docker instance is my guess (I’m getting all of this from this stackoverflow question btw).
But because that port mapping seems like a manual mapping to me, I think you can use --local-ip
, --local-port
, and then also specify --external-ip
and --external-port
to skip UPnP which will dodge your IGD error. The --network
option doesn’t virtualize the net interface with such a software bridge afaik, so I presume that’s why it works.
I’ll admit I don’t know enough about the software network bridge stuff to know exactly what those arguments look like, but perhaps try something like this as an idea? This is pure speculation, I haven’t run this, nor do I know for sure if it will run, but this is where I’d start my investigation at least.
sn_node --local --local-port=$port --external-port=$port --external-ip=${host_local_ip} --root-dir "${node_dir}/$port" --hard-coded-contacts='["127.0.0.1:12000"]' &
I don’t believe 127.0.0.1 resolves to the same local ip from the perspective of the docker instance (unless you specify --network=host
perhaps), so my thinking is you’d need to pass the host’s local-ip to the script and store it in $host_local_ip
and this effectively maps the localhost of your docker image to the localhost of the host while still virtualizing the interface. This would effectively bypass UPnP, get rid of your IGD error, and still forward the port across the software bridge… Maybe… 
If I’ve got some time, I’ll reinstall docker and maybe try it out myself though. I’m curious enough to play with it a bit 