Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Question about binding a port to an IP adress

  • h-hermsen

    h-hermsen - 2022-01-05

    Hi All,

    My question is fairly simple;

    If I select 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, in my example, port 502 will be exposed on (eth0) AND (wlan0)?

    -> If I bind to , in my example port 502 will be exposed on (eth0) ONLY.

    -> If I bind to , in my example it will be exposed on (wlan0) ONLY.

    Is this assumption correct?

    Many thanks.


    Last edit: h-hermsen 2022-01-05
  • nothinrandom

    nothinrandom - 2022-01-05

    πŸ‘‹ @h-hermsen, 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.

    • If you want your service to listen on all interfaces, then you could listen on instead.

    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.

  • h-hermsen

    h-hermsen - 2022-01-05

    @i-campbell, @nothinrandom
    Thank you all for the clear anwsers :-)


    Last edit: h-hermsen 2022-01-05

Log in to post a comment.