that binds to 127.0.0.1 on a random port
If you configure to bind to a specific IP then only that IP is listening.
That being said, confirm that there is a bound java process listening on the network adapter addresses.
Use a tool like netstat
to list the LISTENING socket (ip address + port).
Don't forget to turn on the PID for each listening socket (in netstat
that would be the --programs
command line)
Example:
$ netstat --tcp --numeric --listening --programs
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:33067 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:3000 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp6 0 0 127.0.0.1:63342 :::* LISTEN 963265/java
tcp6 0 0 :::38939 :::* LISTEN 963265/java
tcp6 0 0 127.0.0.1:57036 :::* LISTEN 2207436/java
tcp6 0 0 ::1:631 :::* LISTEN -
tcp6 0 0 127.0.0.1:33215 :::* LISTEN 963265/java
tcp6 0 0 127.0.0.1:34351 :::* LISTEN 1497959/java
tcp6 0 0 127.0.0.1:40785 :::* LISTEN 2207436/java
tcp6 0 0 127.0.0.1:20432 :::* LISTEN 1497959/java
tcp6 0 0 :::80 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 127.0.0.1:6942 :::* LISTEN 963265/java
Now, back to your specific example ...
sudo ifconfig lo0 alias 192.168.22.2
You are attempting to add a 192.*
IP (not publicly routeable, private address space) which is a not a loopback address space, as an IP alias to a loopback device, yeah. That's not going to work. Use a different loopback address instead (eg: 127.0.0.22
) for your lo0
adapter.