Hi Guys!
That's my first post in OpenWrt forum So hello everyone !! It's great to join your community.
My problem is similar to this one. However it wasn't replied so far and my case could be a little bit different. That's why decided to open a new topic. Sorry in advance if it will turn out be the same. Hope it won't.
So basically I have 3 routers:
from internet provider
NanoPi R2S - with OpenWrt, as a main router, this one is direcly conneted with first one
TpLink (which is my main router where all my devices are connected to) - this one is connected with NanoPi
All from above has set up static addresses.
I'm a capable of pulling docker image without any problem. However let's assume it's going to be the ubuntu image. While a container is started and attached (in interactive mode) trying a such simple commands like :
doesn't work because the ubuntu container has no connection to the internet.
My question is how can I fix it?
Of course I will provide all kind of information if needed. Please just tell me what to check and I'll post it.
Best regards
But be aware if you publish ports through docker (like with the -p command) you normally expose your service to the internet because docker uses iptables (or in your case probably nftables) to open ports on the host (in your case your OpenWrt device).
Also if your intention is to make your service accessible from the internet you will have to put your isp router/modem into bridge mode or at least configure static routes to your OpenWrt device and then disable masquerading. Otherwise you will have Double nat and won‘t be able to access your docker container from the internet.Preformatted text
So there is no need to unccoment anything according to your suggestion.
My intention it isn't really to allow connection from outside my home lan. Just would like to be able use localy (at least for now).
Bellow confirmation that I'm stucked:
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8181d1363d4b ubuntu "/bin/bash" 4 weeks ago Exited (255) 1 hour ago thirsty_jepsen
23782fad21c9 ubuntu "bash" 4 weeks ago Exited (0) 4 weeks ago sleepy_heyrovsky
# root @ FusionWrt in ~ [19:16:48]
$ docker start 8
8
# root @ FusionWrt in ~ [19:17:38]
$ docker attach 8
root@8181d1363d4b:/# ping google.com
bash: ping: command not found
root@8181d1363d4b:/# apt update
Ign:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
Ign:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Ign:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Ign:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
Ign:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Ign:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Ign:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
Ign:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Ign:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Err:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
Could not connect to ports.ubuntu.com:80 (185.125.190.39), connection timed out Could not connect to ports.ubuntu.com:80 (185.125.190.36), connection timed out
Err:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Unable to connect to ports.ubuntu.com:80:
Err:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Unable to connect to ports.ubuntu.com:80:
Err:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Unable to connect to ports.ubuntu.com:80:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/jammy/InRelease Could not connect to ports.ubuntu.com:80 (185.125.190.39), connection timed out Could not connect to ports.ubuntu.com:80 (185.125.190.36), connection timed out
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/jammy-updates/InRelease Unable to connect to ports.ubuntu.com:80:
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/jammy-backports/InRelease Unable to connect to ports.ubuntu.com:80:
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/jammy-security/InRelease Unable to connect to ports.ubuntu.com:80:
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@8181d1363d4b:/#
(sorry for language version, but I just don't have English here). If any from following is fine for you, just please let me know and I'll resend any picture:
Mmmh hard to say whats causing the issues. Seems like you are using a custom build. Maybe something else is setup wrong. When i enable docker zone forwarding to wan i get instant Internet access.
Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
Seems like you are using a vpn… Is your default routing via WAN or VPN? If it’s via vpn you probably have to allow forwarding from your docker zone to your vpn firewall zone aswell…
Like this
config forwarding
option src 'docker'
option dest 'vpn'
Not at all. Yeap, I have installed by default a VPN soft in that particular version of OpenWrt. It comes with build. I haven't configured it yet (that's next point on my list to menage and after handling current issue I'm going to ask on that forum for help with VPN or Proxy Server as well..). Also I'm sure I don't use VPN because of fact that after reqesting information from service like "what is my ip" I always receive my internet provider assigned ip.
Never the leas, I really appriciate fact that you take your time and check my settings! Thank you Hudra!
What else can we check?