Networking
FreeBSD Podman supports two networking modes for containers.
Port Forwarding (Recommended)
Maps container port to host port. Requires pf configuration.
pf.conf Setup
Add to /etc/pf.conf:
# Podman container networking
rdr-anchor "cni-rdr/*"
nat-anchor "cni-rdr/*"
table <cni-nat>
nat on $ext_if inet from <cni-nat> to any -> ($ext_if)
nat on $ext_if inet from 10.88.0.0/16 to any -> ($ext_if)
Enable local filtering:
Multiple Ports
podman run -d \
-p 80:80 \
-p 443:443 \
-p 8080:8080 \
--name traefik ghcr.io/daemonless/traefik:latest
Host Network
Container shares the host's network namespace directly.
| Pros | Cons |
|---|---|
| Simpler setup | Less isolation |
| No pf config needed | Port conflicts possible |
| Better performance | Container sees all host interfaces |
Container-to-Container
Containers on the default bridge network can communicate via IP. Use podman inspect to find container IPs: