Fixed IP for bridge interface to communicate with host

vega2004

Dabbler
Joined
Apr 18, 2021
Messages
19
Hi

I need mDNS in docker container because I already use mDNS (Timemachine) on the host I need to have static IP (IPAM Type) in the app/docker container because the container is not supporting IPv6 Avahi.
The container needs to communicate with the host.
I looks like the communication between the static IP 192.168.0.200 and host IP 192.168.0.1 is not working
For this I use the internal bridge IP of the host 172.16.0.1 and the docker container 172.16.0.60.

But after every restart the container ip is counting up 172.16.0.61 .. 172.16.0.62

Is there a way to fix this IP or establish a direct connection with external IPs 192.168.0.200 ->192.168.0.1 ?

Host: 192.168.0.1
Docker: 192.168.0.200 (no static route defined)
Host Container IP: 172.16.0.1
Docker Container IP: 172.16.0.60 counting up after every restart.
 

chuck32

Guru
Joined
Jan 14, 2023
Messages
623
The internal docker network 172.16.0.x is irrelevant here, because that is not part of your local 192.168.0.x network. Let docker handle this subnet.
How did you configure the bridge? I'm using docker in a Ubuntu VM but it should be same for apps.
 

vega2004

Dabbler
Joined
Apr 18, 2021
Messages
19
I'm struggling to create the bridge interface
I created a bridge br0 with IP 192.168.0.200/24
I use this interface in the docker with static IP 192.168.0.200
This is not working is there a documentation how it should configured with docker
 

chuck32

Guru
Joined
Jan 14, 2023
Messages
623
Can you Screenshots of your network configuration?
 

vega2004

Dabbler
Joined
Apr 18, 2021
Messages
19
Network
1706461206597.png

Docker:
1706461120758.png
 

chuck32

Guru
Joined
Jan 14, 2023
Messages
623
Thanks!

You didn't state which guide you followed, but you do not assign an alias to the interface itself and then also to the bridge.
Delete the alias for enp38s0. When you create the bridge, the bridge will get an alias and that IP will be the IP of your truenas instance.

The settings on the docker side look okay to me, but that's not how I deploy containers so I'd have to check later

Can you ping the docker IP?
 
Top