0

i am trying to setup my openvpn server but it doesnt work!

Client config:

client

dev tap

;dev-node MyTap

;proto tcp
proto udp

remote 5.1.85.206 1194

;remote-random

resolv-retry infinite

nobind

;user nobody
;group nobody

persist-key
persist-tun


;http-proxy-retry 
;http-proxy [proxy server] [proxy port #]


;mute-replay-warnings


ca ca.crt
cert client1.crt
key client1.key


remote-cert-tls server


tls-auth ta.key 1


;cipher x


comp-lzo

verb 3

;mute 20

redirect-gateway
dhcp-option DNS 8.8.8.8

Server config:

;local a.b.c.d

port 1194

;proto tcp
proto udp

dev tap
;dev tun

;dev-node MyTap


ca ca.crt
cert server.crt
key server.key  # This file should be kept secret


dh dh2048.pem


server 10.8.0.0 255.255.255.0


ifconfig-pool-persist ipp.txt


;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100


;server-bridge

;push "route 192.168.10.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"
push "dhcp-option DNS 8.8.8.8"


;client-config-dir ccd
;route 192.168.40.128 255.255.255.248

;client-config-dir ccd
;route 10.9.0.0 255.255.255.252

;learn-address ./script

;push "redirect-gateway def1 bypass-dhcp"

;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"

;client-to-client

;duplicate-cn

keepalive 10 120

tls-auth ta.key 0 # This file is secret

;cipher BF-CBC        # Blowfish (default)
;cipher AES-128-CBC   # AES
;cipher DES-EDE3-CBC  # Triple-DES6

comp-lzo

max-clients 2

user nobody
group nogroup

persist-key
#persist-tun

status openvpn-status.log

;log         openvpn.log
;log-append  openvpn.log

verb 3

;mute 20

Log: no errors :/

i hope you can help me :)

PS: I am on Windows 10 with newest version of openvpn I am connected with ethernet directly to my router

2 Answers 2

1

Its likely you havn't set outbound NAT for the VPN network that your server uses. Therefore your router on the server network doesn't know to translate traffic from your VPN network to a WAN side IP.

2
  • And how can I fix this in my server config? //edit i'm new to vpn / openvpn
    – Scrumplex
    Aug 16, 2015 at 10:40
  • Well it appears it was something else, but you wouldn't fix NAT on OpenVPN, this would happen on your router. Aug 16, 2015 at 12:57
0

FIXED

I just forgot to change the network adapter from eth0 to venet0 (its a openvz vserver).

My IPTABLES rules:

sysctl -w net.ipv4.ip_forward=1
iptables -A FORWARD -o eth0 -i tun0 -s 10.8.0.0/24 -m conntrack --ctstate NEW -$
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o venet0 -j MASQUERADE

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .