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?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityNo,
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.