Solved

openvpn routing problem

Posted on 2010-11-12
26
580 Views
Last Modified: 2012-05-10
I am running a vpn server using the following config
when I connect I recieve an error stating
PUSH_REQUEST status=1
and it is setting my defualt gatway to the gateway of the wireless network I am connected to please help


local 192.168.0.59
server 192.168.200.0 255.255.255.0
port 5959
proto udp
max-clients 100
mssfix 1400
persist-key
dev tap
push dhcp-option 192.168.200.0
push "route-gateway 192.168.200.0 255.255.255.0 192.168.0.1 255.255.255.0"
push "redirect-gateway"
dh "C:/Program Files/OpenVPN/easy-rsa/keys/dh1024.pem"
ca "C:/Program Files/OpenVPN/easy-rsa/keys/ca.crt"
cert "C:/Program Files/OpenVPN/easy-rsa/keys/pracvpn.crt"
key "c:/program files/openvpn/easy-rsa/keys/pracvpn.key"
keepalive 10 120        
comp-lzo
script-security 2
status openvpn-status.log
verb 3

0
Comment
Question by:jfranco123
  • 15
  • 7
  • 4
26 Comments
 
LVL 6

Expert Comment

by:r3nder
Comment Utility
check the IP of your wireless router. I am willing to bet it is 192.168.0.1 which in the statement above is where you are configuing it.
Try this
change
push "route-gateway 192.168.200.0 255.255.255.0 192.168.0.1 255.255.255.0"
to
push "route-gateway 192.168.200.0 255.255.255.0"

R3nder
0
 
LVL 2

Author Comment

by:jfranco123
Comment Utility
The ip of the router is 192.168.1.1
I tried your change and am recieving the same error
0
 
LVL 6

Expert Comment

by:r3nder
Comment Utility
I suggest you use "route 192.168.200.0 255.255.255.0" in the OpenVPN
configuration file on the client Otherwise OpenVPN won't probably
know how to deal with the traffic.
0
 
LVL 2

Author Comment

by:jfranco123
Comment Utility
Here is my current config
still openvpn is assigning my defauly gateway to 192.168.1.1

local 192.168.0.59
server 192.168.200.0 255.255.255.0
port 5959
proto udp
max-clients 100
mssfix 1400
persist-key
dev tap
push "route 192.168.200.0 255.255.255.0"
push "route-gateway 192.168.200.0 255.255.255.0"
push "redirect-gateway"
dh "C:/Program Files/OpenVPN/easy-rsa/keys/dh1024.pem"
ca "C:/Program Files/OpenVPN/easy-rsa/keys/ca.crt"
cert "C:/Program Files/OpenVPN/easy-rsa/keys/pracvpn.crt"
key "c:/program files/openvpn/easy-rsa/keys/pracvpn.key"
keepalive 10 120        
comp-lzo
script-security 2
status openvpn-status.log
verb 3

0
 
LVL 6

Expert Comment

by:r3nder
Comment Utility
your openVPN server is it on a LAN - if so you will have to add a firewall rule to it. It should look something like this (depending on make and model)

Destination Gateway Subnet Mask Metric Interface Description
10.243.0.0 10.69.69.86 255.255.255.0 0 LAN vpn stuff
(VPN) (server) (subnet)
0
 
LVL 2

Author Comment

by:jfranco123
Comment Utility
I am not using a windows firewall and my firewall has a rule in it
destination 192.168.200.0 subnet 255.255.255.0 gateway 192.168.0.1
0
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
Last post is obviously misdirected - wrong question?!

The following config options do not make much sense. Remove them. One of them redirects your default gateway.
push "route-gateway 192.168.200.0 255.255.255.0"
push "redirect-gateway"

Open in new window

0
 
LVL 6

Expert Comment

by:r3nder
Comment Utility
k - Linux/BSD
The server route table is:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
(use your IP's)
10.8.0.2 * 255.255.255.255 UH 0 0 0 tun0
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0

The client conf file is:
remote server_ip 1194
client
dev tun
proto tcp
resolv-retry infinite # this is necessary for DynDNS
nobind
user nobody
group nobody
persist-key
persist-tun
ca ca.crt
cert ronclient.crt
key ronclient.key
comp-lzo
verb 4
mute 20

The client routing table when connected looks like this:
Destination  Gateway      Genmask      Flags      Metric      Ref Use Iface
10.8.0.5    *      255.255.255.255 UH      0       0   0   tun0
10.8.0.1   10.8.0.5 255.255.255.255 UGH 0       0   0   tun0
192.168.5.0 *       255.255.255.0 U     0       0   0   eth1
192.168.0.0 10.8.0.5 255.255.255.0 UG   0       0   0   tun0
link-local  *        255.255.0.0   U    1000    0   0   eth1
default    192.168.5.1 0.0.0.0   UG     0       0   0   eth1
0
 
LVL 2

Author Comment

by:jfranco123
Comment Utility
qlemo:
I removed
 push "route-gateway 192.168.200.0 255.255.255.0"
push "redirect-gateway
from my config file and am still having the same issue
and now I am unable to see the one machine I had a static route on.
when I do an ipconfig
I have default gateway completely blank
0
 
LVL 68

Assisted Solution

by:Qlemo
Qlemo earned 500 total points
Comment Utility
I did not read your complete config. Whoever set it up, did it with several mistakes or conflicts.

Let's consolidate the facts:
Your server LAN is 192.168.0.0/24, the server having 192.168.0.59.
OpenVPN is configured in TAP mode (bridging) with IPs of 192.168.200.0/24.
Your local LAN is 192.168.1.0/24, and the WLAN router is 192.168.1.1.

I don't get what you want to achieve, and what the error is. Could you explain that? Which side is wrong? What's that static route about?

0
 
LVL 2

Author Comment

by:jfranco123
Comment Utility
server lan 192.168.0.0
openvpn server 192.168.0.59
I am running tap mode without bridiging
my local lan is 192.168.0.0
and the wlan I am using is 192.168.1.1
0
 
LVL 2

Author Comment

by:jfranco123
Comment Utility
I want to be able to vpn in from the wireless gateway which is 192.168.1.1 to the local lan which is 192.168.0.1 using a vpn ip of 192.168.200.0 and be able to hit all the machines on the 192.168.0.0 network
0
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
The OpenVPN client is running on 192.168.1.1?

192.168.0.0/24 is appearing twice - as your server LAN and the local LAN. Is that correct? Because that is no supported configuration - LANs need to be distinct.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 2

Author Comment

by:jfranco123
Comment Utility
the client that is connecting to the openvpn has the 192.168.1.1 gateway
the openvpn server is 192.168.0.59
I can only ping 192.168.0.59
I want to be able to connect to all the machines on 192.168.0.0
0
 
LVL 68

Assisted Solution

by:Qlemo
Qlemo earned 500 total points
Comment Utility
Since you can ping 192.168.0.59, you still have route-redirect in your server config, I assume.
Further, I reckon the 192.168.0.59 is not the default gateway on the 192.168.0.0 LAN. If that is true, the default gateway needs to know how to route your requests (coming from 192.168.200.x) - by setting a route there for 192.168.200.0 mask 255.255.255.0 using gateway 192.168.0.59.

The above is based on a network layout like

   PCs (192.168.0.x) ---------------------v
   OpenVPN Server (192.168.0.59) ----|------------ Firewall/Router (192.168.0.x)
                                                                                                          |
    PC (192.168.1.x) -----> WLAN (192.168.1.1)-------(OpenVPN 192.168.200.x)

I have omitted the public IPs and Internet routing.
0
 
LVL 2

Author Comment

by:jfranco123
Comment Utility
I dont have the route-redirect in my config
where would i add that route? to the 192.168.0.59 machine (vpn server) or my router?
0
 
LVL 2

Author Comment

by:jfranco123
Comment Utility
okay... I added the route to the gateway 192.168.0.254 and un remarked the pushgateway and redirect gateway and I can see all network devices?
0
 
LVL 68

Assisted Solution

by:Qlemo
Qlemo earned 500 total points
Comment Utility
Ît is important the default gateway of the 192.168.0.0 network has that route set.
0
 
LVL 2

Author Comment

by:jfranco123
Comment Utility
the default gateway is 192.168.0.254 that has the route in it
0
 
LVL 2

Author Comment

by:jfranco123
Comment Utility
but the vpn only works if I leave the following command in the server config
push "route-gateway 192.168.200.0 255.255.255.0"
push "redirect-gateway"
 
0
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
You reset your default gateway on the client by using redirect-gateway, and ALL traffic flows over the OpenVPN. I don't think you need the that statements, but instead
push "route 192.168.0.0 255.255.255.0"

Open in new window


0
 
LVL 2

Accepted Solution

by:
jfranco123 earned 0 total points
Comment Utility
I removed the push gateway and redirect and added that line above and everything works... Thank You SO MUCH!!!!
0
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
Great it works now. The config does make much more sense now ;-).
0
 
LVL 2

Author Comment

by:jfranco123
Comment Utility
yes it does thank you for all the help again
0
 
LVL 2

Author Comment

by:jfranco123
Comment Utility
thanks
0
 
LVL 2

Author Closing Comment

by:jfranco123
Comment Utility
Thank you for your patience and your advice
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now