SNAT -Masquerade on tun openvpn client tunnel

NethServer Version: 7.9.2009

Module: 3.10.0-1160.76.1.el7.x86_64

Dear Nethserver Community.

I just have successfully configured a tunnel openvpn client on nethserver.

To be able to make everything work,I have to configure a snat on the tunnel interface.

To by pass the problem I have handwritten the rule in the file file SNAT using the command Masquerade,(I find this solution googling),everythings works well but everytime I reboot the service shorewall or I make some updates to configuration ,the rules disappear from file and I have to write again.

Can you help me?

Thanks in advance

Hi and welcome to NethServer Community,

templates are used to write the config files so you need a custom template to make the changes permanent.

Just write the rule to a custom template fragment file /etc/e-smith/templates-custom/etc/shorewall/snat/90customsnat and apply the shorewall configuration:

signal-event firewall-adjust

Now you should see the rule at the end of the /etc/shorewall/snat file.

3 Likes

Thank you !!!

Fantastic!!

You are Great!!

1 Like