Stouts / Stouts.openvpn

Ansible role to install and configure OpenVPN server
MIT License
287 stars 207 forks source link

Masquerade rule confusion. - Allow NATing outgoing vpn traffic #141

Closed lennarkivistik closed 4 years ago

lennarkivistik commented 4 years ago
  when:
    - iptables_nat_rules.stdout.find("vpn_masquerade") == -1
    - not openvpn_server

with the not part in the rule, I can never manage to get the masquerade to be created as the variable openvpn_server is always set as expected, should it not be - openvpn_server != '' or am i missing something? or maybe - openvpn_masquerade == true

lennarkivistik commented 4 years ago

I thought i had gotten it to work without any changes to the original file so closed the issue but sadly I had removed - not openvpn_server line and saved so it looked like it worked. sorry for the closing and opening the issue.

nkakouros commented 4 years ago

What version of the role do you use? Try the devel version.

lennarkivistik commented 4 years ago

Yes was using the development branch

https://github.com/Stouts/Stouts.openvpn/blob/develop/tasks/system/firewall.yml

It was in this commit i see that the logic was reversed https://github.com/Stouts/Stouts.openvpn/commit/bfce548c81a9330b80effced97aca7586a2d2065#diff-d29651c5eddf846629546ae0d73f6bcd

so instead of openvpn_server variable being set then it will add the masquerade it will only run when it is not set, which would be never as you always need the openvpn_server variable.

nkakouros commented 4 years ago

I had pushed some commits that addressed these issues about a month ago but I had pushed them to my personal fork and forgot to push here as well. I just did. Could you try now?

Plus, it added some new features and options.

lennarkivistik commented 4 years ago

Yes, now it worked as expected 👯

nkakouros commented 4 years ago

Glad to hear! Should the issue be closed now?