LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-24-2007, 09:31 AM   #1
hasnain110
LQ Newbie
 
Registered: Feb 2006
Posts: 11

Rep: Reputation: 0
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"
 
Old 11-25-2007, 03:05 AM   #2
karpi
Member
 
Registered: Oct 2005
Location: Germany
Distribution: Suse
Posts: 134

Rep: Reputation: 15
hi,

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

and restart OpenVPN

HTH
Karpi
 
Old 11-25-2007, 03:31 AM   #3
hasnain110
LQ Newbie
 
Registered: Feb 2006
Posts: 11

Original Poster
Rep: Reputation: 0
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
 
Old 11-25-2007, 03:57 AM   #4
karpi
Member
 
Registered: Oct 2005
Location: Germany
Distribution: Suse
Posts: 134

Rep: Reputation: 15
hello,

add
push "route 202.125.128.20 255.255.255.0"

or add a static route to your routing table.

HTH
 
Old 11-25-2007, 05:40 AM   #5
hasnain110
LQ Newbie
 
Registered: Feb 2006
Posts: 11

Original Poster
Rep: Reputation: 0
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
 
Old 11-25-2007, 08:50 AM   #6
hasnain110
LQ Newbie
 
Registered: Feb 2006
Posts: 11

Original Poster
Rep: Reputation: 0
okay Karpi it worked like a charm...thank you so very much for you time and help man...I really appreciate it
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenVPN client has not default gateway when connect to OpenVPN server sailershen Linux - Security 3 03-04-2010 02:20 AM
OpenVPN Question : connecting 5-6 comps with OpenVPN duryodhan Linux - Networking 7 02-15-2007 10:28 PM
Openvpn client to client routing question soup Linux - Networking 0 02-16-2006 11:13 AM
OpenVPN Voyager_MP Linux - Networking 0 07-09-2004 04:32 AM
OpenVPN dunmarie Linux - Software 1 10-13-2003 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration