2

I have established VPN using OpenVPN. Ubuntu 14.04

Now, I want to forward through VPN only specific traffic, based on destination IP range (i.e 192.168.2.1 - 192.168.2.255).

Should I use iptables for that?

1 Answer 1

3

No,

You should only advertise routes to that IP range via the VPN. This is part of the VPN server setup and you should of covered it when setting up the VPN.

[https://community.openvpn.net/openvpn/wiki/RoutedLans] shows how you'd add the routes for some lans behind the VPN.

Like so:

route 192.168.2.0 255.255.255.0

Also make sure you don't have

redirect-gateway

As this causes all traffic to try and route over your VPN.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.