I know there are some questions like this Docker. Assign IP from the same range as Host - but there are all 2-3 years old that I found. I would like know, what is the best practice solution for the followng task:
I have my docker host with the following Network settings:
The host has an additonal IP: 192.168.0.3
And I have an docker container with icinga2 image, with following addional options:
-p 192.168.0.3:80:80 \
-p 192.168.0.3:443:443 \
-p 192.168.0.3:5665:5665 \
So I’m able to connect from my client (192.168.0.4) to Webserver and API from 192.168.0.4 to 192.168.0.3
All traffic from the container (e.g. ping 192.168.0.1 from bash inside the container) have as source: 192.168.0.2, but I want 192.168.0.3 as souce IP.
I tried with bridged Network, but then the host container is not reachable anymore.
I read something about macvlan, as documented it is for legacy application, but is this the only solution?
Maybe someone could help me.