unable to redirect default gateway

Need help configuring your VPN? Just post here and you'll get that help.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
snaf
OpenVpn Newbie
Posts: 2
Joined: Mon May 12, 2014 2:14 pm

unable to redirect default gateway

Post by snaf » Mon May 12, 2014 2:32 pm

Hello. I can't connect my vps to vpn server. It shows me this message :

Code: Select all

Mon May 12 16:16:56 2014 NOTE: unable to redirect default gateway -- Cannot read current default gateway from system
OS = debian 7 ( stable )

Code: Select all

openvpn --version
OpenVPN 2.2.1 x86_64-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Jun 18 2013
Just testing purpose I used the same config to connect my working pc to the vpn, and it was working perfect.
OS = Gentoo
openvpn = 2.3.2

It is posible to solve this problem?

snaf
OpenVpn Newbie
Posts: 2
Joined: Mon May 12, 2014 2:14 pm

Re: unable to redirect default gateway

Post by snaf » Mon May 12, 2014 3:05 pm

Finaly I connected to the vpn using this command

Code: Select all

openvpn --config "conf.ovpn" --route-gateway my_ip_address
But after this I lost control against vps, it wasn't respondig to ping or ssh. I logged to the server using KVM and using this command:

Code: Select all

curl curlmyip.com
I realised that it is succesfully connected and the output IP is changed.

How to force my vps to respond to ping/ssh throw global ip?

josazee
OpenVpn Newbie
Posts: 1
Joined: Sat May 02, 2015 11:29 pm

Re: unable to redirect default gateway

Post by josazee » Sat May 02, 2015 11:35 pm

In terminal type this:

Code: Select all

/sbin/ip addr show ppp0 | grep peer | awk ' { print $4 } ' | sed 's/\/32//'
The result of the above code is that it shows your default gateway.

Next type this:

Code: Select all

ip route replace default via xx:xx:xx:xx dev ppp0
The above code manually sets the default gateway.

NOTE: Replace xx:xx… with your gateway shown by the first code.

It should be solved

For more details see here http://9jera.com/forums/topic/unable-to ... t-gateway/

Post Reply