Alternative gateway for openvpn

I build fully working site-to-site-vpn using server. System work properly and is transparent as i dream.

openvpn client.conf found remote "openvpnserverip 1194" and all work just as must. Now three different site and all are together.

But: client1 is my home, and network is ADSL = slow. I want put it vpn-traffic to 4G.

client1
Network 10.15.0.0/22, (DHCP 10.15.1.1-254), default gateway 10.15.0.1 = ADSL.
In same network is 10.15.0.19, 4G-modem. I want put all vpn-traffic to 4G, but all other ADSL.

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fdc1:e63d:b73e::/48'

config interface 'lan'
option type 'bridge'
option ifname 'eth0'
option proto 'static'
option netmask '255.255.252.0'
option ip6assign '60'
option ipaddr '10.15.0.1'

config interface 'wan'
option ifname 'eth1'
option proto 'static'
option netmask '255.255.255.252'
option ip6assign '60'
option ipaddr ''
option gateway ''
list dns '8.8.8.8'
list dns '8.8.4.4'
#this is right and all work

config route
option target 'openvpnserverip'
option gateway '10.15.0.19'
option netmask '255.255.255.0'
option interface 'lan'

When I try tracert, it show no traffic via this 10.15.0.19.

I know this is very easy and simple to config, BUT I have no idea why this my static route not work.

So: Site1/client 1, how I can make this type route, "all traffic from network go via adsl (10.15.0.1) but vpn-traffic 4G (10.15.0.19)?

Modified 4.8.2020 20.37 (Finnish time): "openvpn config" ... added word openvpnserverip and same word config route, option target... this editor/forum remove this two word. Reason I wrote this word "left-arrow openvpnserverip right-arrow".

If your server has a static IP address, then use OVPN_SERVER_PUBLIC_IP/32 as the target.
Otherwise, you should probably specify the remote ISP pool.

config route
option target 'openvpnserverip'
option gateway '10.15.0.19'
option netmask '255.255.255.255'
option interface 'lan'

Now work. Yes, error was only mask: my mask was /24, right mask /32. Ok, problem solved. Thanks.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.