What I'm trying to achieve

I need my container to be able to ping other devices in the network. Specifically, my nginx container that now has a static IP address through macvlan.

Setup

Server (NAS):           192.168.1.1
     other container  : 192.168.1.1:32811
     nginx (container): 192.168.1.192 (macvlan bridge_lan)

Gateway:                192.168.1.254

What I've done

To setup my network I ran:

docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.254 --ip-range=192.168.1.200/27 -o parent=eth0 bridged_lan

I then create a docker container and assigned it to the bridge_lan network. If I navigate to 192.168.1.192 I get greeted with my nginx container. A few tests shows it's almost correctly setup, where:

Network -> nginx container // every device can ping this container on network
nginx container -> network // container cannot ping any device, except for case below
nginx container -> gateway // the only device it can ping, the gateway

I'm clearly missing something here. It might be my lack of understanding but why and how do I resolve this issue? I just need my container to have its own static IP address and make it reachable on my LAN and vice versa.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.