Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Debian: Docker breaking port forwarding?
Post Body

I have a VPS running Debian 10 as OpenVPN server that is forwarding a public port to a different port of an OpenVPN client using ufw:

in /etc/ufw/before.rules i added

*nat
:PREROUTING ACCEPT [0:0]
-A PREROUTING -d server_ip -p tcp --dport 8200 -j DNAT --to-dest VPN_client_ip:444

:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s VPN_subnet/24 -o eth0 -j MASQUERADE
-A POSTROUTING -d VPN_client_ip -p tcp --dport 444 -j SNAT --to-source server_ip

If I flush all iptables rules using

iptables-save | awk '/^[*]/ { print $1 }
                        /^:[A-Z]  [^-]/ { print $1 " ACCEPT" ; }
                        /COMMIT/ { print $0; }' | iptables-restore

and then do

ufw reload

it works just fine. But this removed the docker iptables rules. Restarting docker readds them and breaks the forwarding. Any ideas why? How can I diagnose this problem?

Author
Account Strength
100%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
47,329
Link Karma
3,471
Comment Karma
43,171
Profile updated: 1 month ago
Posts updated: 2 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 years ago