im having some issue with routing and pushing routes to client, my server has ip forwarding enabled and redirect-gateway enabled and client is able to connect to server and all traffic is sent through tunnel from client to server, we dont use NAT on server because we want client traffic destined to an application on same server to only go through tunnel and that works.
the problem is how do we push routes from openvpn server to client such that only traffic to server ip is sent through tunnel but rest should go out of their regular internet router, i tried pushing routes of server ip through tunnel but it results in biting on tail situation where even vpn traffic tries to go through tunnel causing a loop
my server config
local x.x.x.x
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
tls-server
tls-auth ta.key 0
server 10.8.0.0 255.255.255.0
duplicate-cn
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
cipher AES-128-CBC
tun-mtu 1500
fragment 1450
mssfix 1450
route-method exe
push "redirect-gateway def1 bypass-dns"
my client config
remote x.x.x.x 1194
proto udp
dev tun
ca ca.crt
cert client1.crt
key client1.key
ns-cert-type server
tls-client
tls-auth ta.key 1
keepalive 10 120
comp-lzo
persist-key
persist-tun
verb 3
cipher AES-128-CBC
fast-io
resolv-retry infinite
nobind
pull
key-direction 1
route-method exe
route-delay 2
tun-mtu 1500
fragment 1450
mssfix 1450