openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
3.96k stars 3.46k forks source link

docker container not accepting traffic from another container #19856

Open dsl400 opened 1 year ago

dsl400 commented 1 year ago

Maintainer: @G-M0N3Y-2503 Environment: x86/64 OpenWrt 22.03.0 r19685-512e76967f / LuCI openwrt-22.03 branch git-22.245.77528-487e58a

root@OpenWrt:~# dockerd --version
Docker version 20.10.18, build e42327a
root@OpenWrt:~# docker --version
Docker version 20.10.18, build b40c2f6
root@OpenWrt:~# 

Description:

BusyBox v1.35.0 (2022-09-03 02:55:34 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 22.03.0, r19685-512e76967f
 -----------------------------------------------------
root@OpenWrt:~# docker run --rm -itd --network testnetwork --name test1 busybox
root@OpenWrt:~# docker run --rm -itd --network testnetwork --name test2 busybox
root@OpenWrt:~# docker exec -it test1 sh
/ # ping test2
PING test2 (172.18.0.3): 56 data bytes
--- test2 ping statistics ---
5 packets transmitted, 0 packets received, 100% packet loss
/ # 
G-M0N3Y-2503 commented 1 year ago

Unfortunatly, if you are using firewall4/nftables, docker doesn't work as easily as it did with firewall3/iptables.
That is to say, If you are using firewall4, i'd imagine that if you disabled the iptables option in /etc/config/dockerd you should be able to configure the firewall and NAT etc within OpenWrt itself.

michaellmonaghan commented 1 year ago

This is still an issue as of 23.05.0-rc2.

G-M0N3Y-2503 commented 1 year ago

OpenWrt: https://github.com/openwrt/packages/issues/16818#issuecomment-1120403722 Docker: https://github.com/moby/moby/issues/26824

G-M0N3Y-2503 commented 3 months ago

https://github.com/openwrt/packages/issues/17766