Routing certain IP ranges through VPN client

This forum is for admins who are looking to build or expand their OpenVPN setup.

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

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
GeckoGrp
OpenVpn Newbie
Posts: 13
Joined: Mon Oct 30, 2017 8:29 am

Routing certain IP ranges through VPN client

Post by GeckoGrp » Fri Jul 13, 2018 5:28 am

Hi Gents,

I have the following issue.

I assign my OVPN clients IP addresses like this using the ccd file option and they connect fine to the server and all can route to each other no worries:

Client 1 - 10.9.1.1
Client 2 - 10.9.2.1
Client 3 - 10.9.3.1
Client 4 - 10.9.4.1
Client 5 - 10.9.5.1
Client 6 - 10.9.6.1
Client 7 - 10.9.7.1
Client 8 - 10.9.8.1
Client 9 - 10.9.9.1
Client 10 - 10.9.10.1

My client has a current OVPN network with every LAN residing behind these VPN clients having network addresses of 10.1.1.0 so i cant use the iroute option. The client will not let me change the LAN IP address ranges which reside behind the OVPN clients.

So i tried this:

Put a 1:1 NAT in the OVPN clients like this
10.9.1.0 to 10.1.1.0 etc...

and tried routing the whole subnets to each ovpn client like this

I tried putting in a /etc/sysconfig/network-scripts/route-tun0 file with the following entries:

10.9.1.0 via 10.9.1.1 dev tun0
10.9.2.0 via 10.9.2.1 dev tun0
10.9.3.0 via 10.9.3.1 dev tun0
10.9.4.0 via 10.9.4.1 dev tun0
10.9.5.0 via 10.9.5.1 dev tun0
10.9.6.0 via 10.9.6.1 dev tun0
10.9.7.0 via 10.9.7.1 dev tun0
10.9.8.0 via 10.9.8.1 dev tun0
10.9.9.0 via 10.9.9.1 dev tun0
10.9.10.0 via 10.9.10.1 dev tun0

Has not worked. Am i on the right track.

Please help!

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Routing certain IP ranges through VPN client

Post by TinCanTech » Fri Jul 13, 2018 12:00 pm

GeckoGrp wrote:
Fri Jul 13, 2018 5:28 am
My client has a current OVPN network with every LAN residing behind these VPN clients having network addresses of 10.1.1.0 so i cant use the iroute option. The client will not let me change the LAN IP address ranges which reside behind the OVPN clients.
If you set up your network as a notwork then openvpn will not work ..

There maybe a solution but it is beyond the scope of this forum.

If you cannot resolve this yourself you can contact me privately : tincanteksup <at> gmail

Post Reply