Localhost or 127.0.0.1 accessible but not lan IP

Hi this is quite a weird problem that I run into.

I have setup a http proxy on openwrt, it listens on 0.0.0.0:8443
My openwrt has IP address of 192.168.1.1

However when trying to test it using curl --connect-timeout 2 -x 192.168.1.1:8443 http://example.com , it does not work, I got a connection timeout error. I have tried it from openwrt itself and a PC on the same local network.

Only if I test it using curl --connect-timeout 2 -x 127.0.0.1:8443 http://example.com on openwrt itself will I get the result that it actually connects.

Can someone please tell me why? Thank you!

If you try ---^ from the router?

Try restarting the proxy, it might be a race condition during boot.

I have tried it from openwrt itself and a PC on the same local network.

I have restarted this several times without rebooting router.

Ok, then telnet/nc to port 8433 using the br-lan IP, from the router and client?

Does it timeout?

On openwrt
nc 127.0.0.1 8443 it shows an empty row, I think it means connection successful?
(because if I nc 127.0.0.1 8444 it straight up refuses to connect since I have nothing on port 8444)
nc 192.168.1.1 8443 gives same result

On PC client
telnet 192.168.1.1 8443 gives a connection error

I assume your pc is in the same subnet?

That does netstat (on the router) say about port 8443?

Yes my pc is in the same local network. I can ping 192.168.1.1 and get response.

Just for fun, change 0.0.0.0 to the 192 subnet IP.

1 Like

Sorry, this service is created by docker.
So it is actually mapped from 172.17.0.4 (docker instance) to openwrt.
I don't think I can change 0.0.0.0 to 192.168.1.1 since the mapping is controlled by docker-ce

Then that's probably where you should look for the issue.

1 Like

I think you are right. Thank you for the help!!!

And what exactly should this solve in this context?

Nothing, that's why it says just for fun, I didn't expect it to make any difference at all.

It would have been interesting, if it did.