I tried to install and exectue the OpenWRT openwrt/rootfs:x86_64 image on a Docker Container running on a remote VPS but I am unable to access Luci Interface from outside of the VPS instance.
The VPS instance is an Ubuntu machine 22.04LT running on a remote vultr VPS and the firewall of the VPS is turned off.
I can get access to the OpenWRT command interface and run CLI commands there I have installed Luci inside the OpenWRT container but I can not access from outside (I mean both VPS host and Remote Machine) to the Luci interface.
I have done following steps on VPS machine (ubuntu 22.04 LTS)
#ufw disable
#docker run -it --name=openwrt -p 80:18888 openwrtorg/rootfs:x86-64
After executing the above command I get logged into the running OpenWRT container and
I have entered following commands (following is inside OpenWRT)
root@2183678412#opkg update;opkg install luci
...
...
...
4+0 records out
Configuring luci-light.
Configuring luci.
When I try get into the Luci interface on my PC by entering the http://public-ip-address:18888/
and on the VPS instance I have tried following command and
I get the connection was rest on my machine.
By the way the docker intsance(s) on the VPS do have following
Ip subnet
IPv4 address for docker0: 172.17.0.1
For more diagnostics I have attached some of the commands that I executed on the VPS host
root@vultr:~# docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
29554ec1bc80 openwrt/rootfs "/sbin/init" 52 minutes ago Up 52 minutes 22/tcp, 80/tcp, 443/tcp, 0.0.0.0:80->18888/tcp, :::80->18888/tcp distracted_mcnulty
root@vultr:~# curl 0.0.0.0:18888
curl: (7) Failed to connect to 0.0.0.0 port 18888 after 0 ms: Connection refused
root@vultr:~# curl 172.17.0.1:18888
curl: (7) Failed to connect to 172.17.0.1 port 18888 after 0 ms: Connection refused
root@vultr:~# curl localhost:18888
curl: (7) Failed to connect to localhost port 18888 after 0 ms: Connection refused
I want to know how can I access to the Luci Interface of the OpenWRT running on a Docker Container on a VPS from a remote machine.
Shall I do any extra port mapping or URL fixing on the OpenWRT or Docker or VPS host?
as a second objective I want to have the LuCi https interface being availabe for the remote users
and the http interface deactivated, how can I acheive this requirement?