I have a weird problem with network in my docker containers, and I ran out of ideas on debugging it:
I have a pre-defined network instantiated as follows:
This is the network-related configuration in my docker-compose file:
Neither the host nor other contains on the host can access this container. Arp table on the host contains an incomplete record for the address:
The unexpected twist is, that the container is accessible from all machines on the network, except the host with the container and other containers on the same host
Starting a container using plain docker yields identical results:
What I tried:
- deleting iptables rules defined by docker (in case it was a problem with the firewall)
- adding another ethernet switch between the host and the main switch
- changing network type from macvlan to ipvlan
I have a feeling that I'm missing something trivial.
Your advice will be highly appreciated.
I have a pre-defined network instantiated as follows:
Code:
docker network create -d macvlan --opt parent=enp6s18 --subnet 192.168.48.0/22 --gateway 192.168.48.1 --ip-range 192.168.49.0/24 net48
Code:
version: '3'
services:
server:
...
networks:
net48:
ipv4_address: 192.168.49.87
networks:
net48:
external: true
Code:
$ arp -a
...
? (192.168.49.87) at <incomplete> on enp6s18
...
Starting a container using plain docker yields identical results:
Code:
docker run --rm -d --name nginx --network net48 --ip 192.168.49.89 nginx
...
# ping 192.168.49.89
PING 192.168.49.89 (192.168.49.89) 56(84) bytes of data.
From 192.168.49.27 icmp_seq=1 Destination Host Unreachable
From 192.168.49.27 icmp_seq=2 Destination Host Unreachable
From 192.168.49.27 icmp_seq=3 Destination Host Unreachable
^C
--- 192.168.49.89 ping statistics --
What I tried:
- deleting iptables rules defined by docker (in case it was a problem with the firewall)
- adding another ethernet switch between the host and the main switch
- changing network type from macvlan to ipvlan
I have a feeling that I'm missing something trivial.
Your advice will be highly appreciated.