Link to home
Start Free TrialLog in
Avatar of jfranco123
jfranco123

asked on

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

Avatar of r3nder
r3nder
Flag of United States of America image

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
Avatar of jfranco123
jfranco123

ASKER

The ip of the router is 192.168.1.1
I tried your change and am recieving the same error
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.
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

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)
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
Avatar of Qlemo
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

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
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
SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
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
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.
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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?
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?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the default gateway is 192.168.0.254 that has the route in it
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"
 
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


ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great it works now. The config does make much more sense now ;-).
yes it does thank you for all the help again
thanks
Thank you for your patience and your advice