Kernel security restrictions generally prevent macvlan parent and child interfaces to communicate with each other - this restriction does not come from docker, it just inherits it.
Try accessing the container ip (=macvlan child ip) from a different host than your docker host.
Note: The nginx container should not require NET_ADMIN. With kernels don’t require NET_ADMIN capabilities anymore to bind ports below 1024.
Thanks for your response. Using a second device, the results remain the same. I have also attempted to ping the container ip from the second device, but every request times out.
ping 192.168.2.3
Pinging 192.168.2.3 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.2.3:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
I never tried macvlan with a subnet other than /24.
And I always configured ip_range: x.x.x.x/y with a smaller cidr netmask than the subnet itself.
In my experience, as long as the router is within the specified subnet, the container should be reachable and should be able to reach other devices in the lan. [Update]: on a second thought the router is irrelevant if your client is in the same subnet. Macvlan acts pretty much like a network switch.[/update]
You might want to check if setting the parent interface to promiscuous mode, and/or disabling checksum offloading has an effect.
Personally, I stopped using macvlan years ago, as the hustle dealing with it was not worth the benefits.