Routing specific IP's over VPN

This forum is for admins who are looking to build or expand their OpenVPN setup.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
yasar11732
OpenVpn Newbie
Posts: 3
Joined: Tue Feb 09, 2021 8:09 pm

Routing specific IP's over VPN

Post by yasar11732 » Tue Feb 09, 2021 8:13 pm

Hi,

I have setup OpenVPN on my workplace server. I can successfully access webservices and shared folders (windows) over VPN.

One of the programs I use for work need to access a specific server that can only be accessed from my office's IP address. I have determined destination IP address using WireShark program.

Can I setup OpenVPN in a way that, requests going for aforementioned server routed over openVPN?

I don't want to route all my internet traffic over vpn if possible,

Thanks in advance

300000
OpenVPN Super User
Posts: 463
Joined: Tue May 01, 2012 9:30 pm

Re: Routing specific IP's over VPN

Post by 300000 » Wed Feb 10, 2021 2:56 pm

Yes you can route only network you like and the rest go to your local network.on you client open it and add this one.



route 0.0.0.0 192.0.0.0 net_gateway
route 64.0.0.0 192.0.0.0 net_gateway
route 128.0.0.0 192.0.0.0 net_gateway
route 192.0.0.0 192.0.0.0 net_gateway


This part is use your local network .if you need route some network over vpn you can do this .


67.98.89.76 255.255.255.252 67.98.89.70

route 67.98.89.76 255.255.255.252 vpn _gateway


vpn_gateway must be lease it like that so openvpn can add gareway on fly. Just correct ip and subnet you want to route only.

Post Reply