How to create a systemd service dependency on a Podman custom network interface?

Posted on

Hello,

I have a systemd service (ServiceA) on my host OS that is configured to listen on specific IP addresses 127.0.0.1 and 10.0.0.1 with After=network.target in its systemd service file.

I also have another service (ServiceB) in a Podman container that uses a custom network bridge that I created with the following command:

podman network create -d bridge --gateway 10.0.0.1 --subnet 10.0.0.0/24 custom-network

After server startup, ServiceA is not listening on 10.0.0.1 IP because the Podman custom-network interface was not yet available.

How to create a systemd service dependency on a Podman custom network interface?

Responses