LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   OpenVpn question (https://www.linuxquestions.org/questions/linux-networking-3/openvpn-question-602092/)

hasnain110 11-24-2007 09:31 AM

OpenVpn question
 
I have setup openvpn on Centos and its working like a charm for me ..but my problem is when my client connects to vpn all traffic start going through my VPN tunnel over internet which I dont want, Is there any way I could route my traffic towards 202.125.128.204 only through VPN...rest of the traffic should go through my DSL GATEWAY

Server.conf


port 1194
proto udp
dev tun0
ca keys/server/ca.crt
cert keys/server/server.crt
key keys/server/server.key
dh keys/server/dh1024.pem
server 10.66.77.0 255.255.255.0
crl-verify keys/server/crl.pem
cipher none
user nobody
group adm
status servers/changeme/logs/openvpn-status.log
log-append servers/changeme/logs/openvpn.log
verb 2
mute 20
max-clients 100
keepalive 10 120
client-config-dir /etc/openvpn/servers/changeme/ccd
persist-key
persist-tun
ccd-exclusive
push "route 192.168.168.0 255.255.255.0"
push "redirect-gateway def1"

karpi 11-25-2007 03:05 AM

hi,

remove the line push "redirect..
the option resets your default gateway to the vpn.

and restart OpenVPN

HTH
Karpi

hasnain110 11-25-2007 03:31 AM

Thanks for reply, I have tried your suggested way, by removing "rediredt..." option..in that case im not able to route my traffic for 202.125.128.204 through vpn tunnel over internet...let me tell you that my vpn client get ip from 10.x.x.x subnet....I need a through which I only route traffic comming for 202.125.128.204 through vpn tunnel,,,rest of the internet traffic should not be pass through my vpn server and it should go through by client own dns gateway

karpi 11-25-2007 03:57 AM

hello,

add
push "route 202.125.128.20 255.255.255.0"

or add a static route to your routing table.

HTH

hasnain110 11-25-2007 05:40 AM

okay so you say by just pusing route for 202.125.128.204...vpn server would only route traffic through tunnel for this ip and rest of the traffic would not come through tunnel ..is that correct????

If thats the scene then this is exactly what i want...ill try and will get back to you

hasnain110 11-25-2007 08:50 AM

okay Karpi it worked like a charm...thank you so very much for you time and help man...I really appreciate it


All times are GMT -5. The time now is 09:53 AM.