server conf:
dev tun
proto udp
port <server port>
mode server
tls-server
float
dh /etc/openvpn/ssl/keys/dh2048.pem
ca /etc/openvpn/ssl/keys/ca.crt
cert /etc/openvpn/ssl/keys/server.crt
key /etc/openvpn/ssl/keys/server.key
tls-auth /etc/openvpn/ssl/keys/ta.key 0
user nobody
group nogroup
status /var/log/openvpn/vpn-status.log
log /var/log/openvpn/vpnlog
comp-lzo
verb 3
keepalive 10 120
fragment 1300
mssfix
hand-window 300
tcp-nodelay
push "redirect-gateway def1"
push "dhcp-option DNS <server dns from resolv.conf on vps>"
client conf:
client
dev tun
proto udp
remote <server ip> <server port>
resolv-retry infinite
nobind
user nobody
group nobody
persist-key
persist-tun
mute-replay-warnings
ca /home/haxle/vpnkeys/ca.crt
cert /home/haxle/vpnkeys/client1.crt
key /home/haxle/vpnkeys/client1.key
tls-auth /home/haxle/vpnkeys/ta.key 1
comp-lzo
verb 3
remote-cert-tls server
pull
fragment 1300
mssfix
route-gateway <server ip>
this configuration is working so far as to get "initialization sequence complete" on my client but specifically I'm getting these
messages that I'm assuming are creating my problem with redirect-gateway:
Sun Oct 13 09:33:20 2013 /usr/bin/ip route add <server ip>/32 via 192.168.1.1
Sun Oct 13 09:33:20 2013 /usr/bin/ip route add 0.0.0.0/1 via <server ip>
RTNETLINK answers: Network is unreachable
Sun Oct 13 09:33:20 2013 ERROR: Linux route add command failed: external program exited with error status: 2
Sun Oct 13 09:33:20 2013 /usr/bin/ip route add 128.0.0.0/1 via <server ip>
RTNETLINK answers: Network is unreachable
Sun Oct 13 09:33:20 2013 ERROR: Linux route add command failed: external program exited with error status: 2
Sun Oct 13 09:33:20 2013 GID set to nobody
Sun Oct 13 09:33:20 2013 UID set to nobody
Sun Oct 13 09:33:20 2013 Initialization Sequence Completed
My goal is to have all of my traffic routed through the openvpn server, I was getting another error on my display before this that
stated:
NOTE: unable to redirect default gateway -- VPN gateway parameter (--route-gateway or --ifconfig) is missing
which prompted me to add the last line in my client config to mitigate the problem.. aparently I don't know what I'm doing and I don't really know what to put there to make this work, so I apoligize if this is obvious somewhere in the how to or on the internet but I'm having trouble finding it. Any help would be apriciated, thank you!
P.S.
I'm not sure if it matters but the vps is on a public ip that is exposed to the internet so i don't know how that would affect the dns and dhcp portions of this solution. thanks