Standalone version of netfilter-mailcow with SNAT support only
5.2K
A minimal Docker container for managing SNAT (Source Network Address Translation) rules for both IPv4 and IPv6 using Python and python-iptables. Based on mailcow/netfilter.
POSTROUTING chain for IPv4 and/or IPv6.Source code is hosted at https://oaklab.hu/crys/snat. Images are built by GitLab CI automatically.
| Tag | Description |
|---|---|
stable | Latest stable version |
latest | Latest development version |
X.Y.Z | Specific version (e.g., 3.0.0) |
| Variable | Description |
|---|---|
SNAT4_TO_SOURCE | IPv4 address to use as the SNAT target |
SNAT4_NETWORK | IPv4 network (in CIDR notation) to match for SNAT |
SNAT6_TO_SOURCE | IPv6 address to use as the SNAT target |
SNAT6_NETWORK | IPv6 network (in CIDR notation) to match for SNAT |
services:
snat:
container_name: snat
image: huncrys/snat
environment:
SNAT4_TO_SOURCE: "192.0.2.1"
SNAT4_NETWORK: "192.0.2.0/24"
SNAT6_TO_SOURCE: "2001:db8::1"
SNAT6_NETWORK: "2001:db8::/64"
network_mode: host
cap_drop:
- ALL
cap_add:
- NET_ADMIN
- NET_RAW
- SYS_MODULE
volumes:
- /lib/modules:/lib/modules:ro
restart: unless-stopped
docker run -d \
--name snat \
--net host \
-e SNAT4_TO_SOURCE=192.0.2.1 \
-e SNAT4_NETWORK=192.0.2.0/24 \
-e SNAT6_TO_SOURCE=2001:db8::1 \
-e SNAT6_NETWORK=2001:db8::/64 \
--cap-drop ALL \
--cap-add NET_ADMIN \
--cap-add NET_RAW \
--cap-add SYS_MODULE \
-v /lib/modules:/lib/modules:ro \
--restart unless-stopped \
huncrys/snat
Content type
Image
Digest
sha256:853b78970…
Size
18.6 MB
Last updated
3 months ago
docker pull huncrys/snat:36d8e0c1