Firewall and OPENVPN

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
vag_26
OpenVpn Newbie
Posts: 11
Joined: Mon Feb 18, 2013 5:38 pm

Firewall and OPENVPN

Post by vag_26 » Wed Mar 06, 2013 2:44 am

Hello again,

Recently, and after successful connection between two machines, I am trying to setup simple firewall rules to the OPENVPN server and then setup firewall rules to a firewall/gateway. The question is very simple, I think. So, for the first case, given the fact that the OPENVPN server is firewall as well I wrote the following:

Code: Select all

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE # for masquerading the outgoing packets
iptables -A INPUT -i tun0 10.8.0.0/24 -j ACCEPT   # to accept packets from clients
Here I have to questions.
1) When the server masquerade the packets, will do that so to the virtual source IP address as indicated by the command? And if that is the case, what is the point since virtual IP address is already concealed?

Now, I want to write rules to a different machine, the firewall. ( I show it in tutorials )

Code: Select all

iptables -A FORWARD -i tun0 -s 10.8.0.0/24 -o eth0 -j ACCEPT
In order for the above command to be applied, the firewall should be the OPENVPN server as well? Isn't it? Otherwise, how he could decrypt the packet to understand that they are coming from 10.8.0.0 ?

I hope this is easy for you!

Kind regards

Post Reply