Hello,
I have containers on a server (Ubuntu Server 20.04.2 LTS; Docker 20.10.7) which are connected with MACVLAN in the same network (172.16.240.0/24) as the host (172.16.240.14) is. The containers have static IPs set during creation.
All containers can communicate with all hosts in 172.168.240.0/24 except the 172.168.240.14 where they are running on. Also all containers have internet access.
In reverse all hosts in 172.168.240.0/24 and all other networks except 172.168.10.14 can reach the containers.
Basically host and containers refuse to communicate.
UFW is disabled on the server, in the containers have no firewalls and no iptables in them.
iptables on the host is (auto-created during setup - no manual conig done):
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
DOCKER-USER all -- anywhere anywhere
DOCKER-ISOLATION-STAGE-1 all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain DOCKER (2 references)
target prot opt source destination
ACCEPT tcp -- anywhere 172.17.0.2 tcp dpt:9000
ACCEPT tcp -- anywhere 172.17.0.2 tcp dpt:8000
ACCEPT tcp -- anywhere 172.19.0.4 tcp dpt:http-alt
Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target prot opt source destination
DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-ISOLATION-STAGE-2 (2 references)
target prot opt source destination
DROP all -- anywhere anywhere
DROP all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
CURL refuses with “no route to host” which is neither true nor possible. All configuration (IP, gateway, …) must be correct, otherwise the containers and the host wouldn’t have internet and other network access.
Also all containers can communicate with each other via the IPs from the MACVLAN.
ip route
172.16.240.0/24 dev ens160 proto kernel scope link src 172.16.240.14
172.16.240.1 dev ens160 proto dhcp scope link src 172.16.240.14 metric 100
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
172.19.0.0/16 dev br-83843de83969 proto kernel scope link src 172.19.0.1
ip route get 172.16.240.100 (IP of one of the containers)
172.16.240.100 dev ens160 src 172.16.240.14 uid 0
cache
I didn’t find any hints on the internet other than years long history of unsolved similar problems.
Is it even possible? Or is this bug a “feature” and will never work?