• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 623
  • Last Modified:

openvpn routing problem

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
jfranco123
Asked:
jfranco123
  • 15
  • 7
  • 4
4 Solutions
 
r3nderCommented:
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
 
jfranco123Author Commented:
The ip of the router is 192.168.1.1
I tried your change and am recieving the same error
0
 
r3nderCommented:
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
Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

 
jfranco123Author Commented:
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
 
r3nderCommented:
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
 
jfranco123Author Commented:
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
 
QlemoDeveloperCommented:
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
 
r3nderCommented:
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
 
jfranco123Author Commented:
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
 
QlemoDeveloperCommented:
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
 
jfranco123Author Commented:
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
 
jfranco123Author Commented:
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
 
QlemoDeveloperCommented:
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
 
jfranco123Author Commented:
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
 
QlemoDeveloperCommented:
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
 
jfranco123Author Commented:
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
 
jfranco123Author Commented:
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
 
QlemoDeveloperCommented:
Ît is important the default gateway of the 192.168.0.0 network has that route set.
0
 
jfranco123Author Commented:
the default gateway is 192.168.0.254 that has the route in it
0
 
jfranco123Author Commented:
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
 
QlemoDeveloperCommented:
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
 
jfranco123Author Commented:
I removed the push gateway and redirect and added that line above and everything works... Thank You SO MUCH!!!!
0
 
QlemoDeveloperCommented:
Great it works now. The config does make much more sense now ;-).
0
 
jfranco123Author Commented:
yes it does thank you for all the help again
0
 
jfranco123Author Commented:
thanks
0
 
jfranco123Author Commented:
Thank you for your patience and your advice
0

Featured Post

Evaluating UTMs? Here's what you need to know!

Evaluating a UTM appliance and vendor can prove to be an overwhelming exercise.  How can you make sure that you're getting the security that your organization needs without breaking the bank? Check out our UTM Buyer's Guide for more information on what you should be looking for!

  • 15
  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now