My question is fairly simple;
If I select 127.0.0.1 in RPi and bind port 502 to it,
will it automagically be available for ALL configured IP adresses on the RPi?
Eg: I bind to 127.0.0.1, in my example, port 502 will be exposed on 192.168.168.14 (eth0) AND 192.168.168.15 (wlan0)?
-> If I bind to 192.168.168.14 , in my example port 502 will be exposed on 192.168.168.14 (eth0) ONLY.
-> If I bind to 192.168.168.15 , in my example it will be exposed on 192.168.168.15 (wlan0) ONLY.
Is this assumption correct?
127.0.0.1 is a virtual interface that is typically referenced as localhost and serves as loopback traffic. It's mainly used to diagnostic within the host itself since traffic can't go anywhere outside... listening (binding) to localhost would work across services if their traffic also originated from the same host.
In Linux, a good way of checking to see what services are listening to what ports is to use the following command lsof -i -P -n. In Windows, netstat -a.
If you tick the "bind to adapter" on the general tab of the modbus slave device, and you have selected 127.0.0.1 at the Ethernet adapter, it should only be available to the localhost.
to bind to all adapters (pre SP17 functionality), you should leave it unticked.
Thank you all for the clear anwsers :-)
Log in to post a comment.