chucklessducks / VPS-Wireguard-Nginx-Mailcow

My journey to make my own email server.
57 stars 7 forks source link

Suggestion: Add Masquerade on Wireguard Wiki #1

Open lohrbini opened 2 years ago

lohrbini commented 2 years ago

While setup the mailcow behind a restricted provider without a static IP Address I came upon this error:

# Example message since the error is no longer in the logs
Get https://index.docker.io/v1/repositories/image/image: read tcp 162.242.195.84:443: i/o timeout

The solution to fix this error was to masquerade the traffic on wg0

[Interface]
...
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o ens4 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o ens4 -j MASQUERADE
...

Could be usefull for other user and may be worth to add

Kind regards