port 1194
proto udp
dev tun
ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\server.crt"
key "C:\\Program Files\\OpenVPN\\config\\server.key"
dh "C:\\Program Files\\OpenVPN\\config\\dh1024.pem"
tls-auth "C:\\Program Files\\OpenVPN\\config\\ta.key" 0
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
cipher AES-256-CBC
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
explicit-exit-notify 1
Client config
client
dev tun
proto udp
remote example.ddns.us 443
resolv-retry infinite
nobind
comp-lzo
persist-key
persist-tun
remote-cert-tls server
key-direction 1
cipher AES-256-CBC
verb 3
<ca>
-----BEGIN CERTIFICATE-----
ca.crt here
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
your-device-name-here.crt here
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
your-device-name-here.key here
-----END PRIVATE KEY-----
</key>
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
ta.key here
-----END OpenVPN Static key V1-----
</tls-auth>
It can work and my client get ip address 10.8.0.6 and I can ping 10.8.0.1 gateway but I can't access internet.
Both "routing and remote access" and "openvpn" service are running.
I doubt windows 10 "routing and remote access" not working but not sure.
Anyone has experience for this kind of issue when setup openvpn on win10.
Eric
Re: openvpn client connect with openvpn server but can't access internet
Posted: Wed Nov 18, 2020 1:08 pm
by bhfm511@gamil.com
OK, will use [oconf] for configuration. Just know it.
Re: openvpn client connect with openvpn server but can't access internet
Posted: Wed Nov 18, 2020 11:14 pm
by 300000
you need ip forward so it can jump from 10.8.0.0 to real ip one , without ipforward client only can ping 10.8.0.1 and 10.8.0.2 that all it can do right now
Re: openvpn client connect with openvpn server but can't access internet
Posted: Thu Nov 19, 2020 12:00 am
by bhfm511@gamil.com
Hi 300000,
I follow this configuration to set up IP forwarding.
[Configuring The Server To Allow Traffic
This next part makes it so that your VPN sends all traffic through it
Open "regedit" and paste this text into the top address bar
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Double click "IPEnabledRouter" and enter the value data as "1"
Now open "run" and enter "services.msc"
Find "Routing and Remote Access", right click it, go into properties and change the "Startup type" to "Automatic"
Now find "OpenVPNService", right click it, go into properties and change the "Startup type" to "Automatic"
Now go into Control Panel and navigate to "Network and Sharing Center" then click "Change Adapter Settings" on the left
Find the adapter that has "TAP" underneath it, then rename that adapter to "TAP"
Right click on your adapter that has an internet connection and go to "properties"
Select "Sharing" at the top and check the box for "Allow other network users to connect..."]
Re: openvpn client connect with openvpn server but can't access internet
Posted: Thu Nov 19, 2020 12:09 am
by bhfm511@gamil.com
BTW, I have another issue on my openvpn server side. When I setup "Automatic" Startup type for "OpenVPNService", openvpn server can't connect but if I choose "OpenVPNSerivce" to Manual mode, I can connect openvpn server. Can't understand well!
Re: openvpn client connect with openvpn server but can't access internet
Posted: Thu Nov 19, 2020 12:11 am
by bhfm511@gamil.com
I just test to ping. Only can ping 10.8.0.1 and can't ping 10.8.0.2 also from client side.
[Press Windows key + R.
In the Run dialog box, type regedit and press Enter to open Registry Editor.
Navigate or jump to the registry key path below:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedAccess
Then right-click on an empty space on the right pane.
Select New > DWORD (32-bit) Value.
Name the key EnableRebootPersistConnection.
Double-click the newly created key and set the Value data to 1.
Click OK to save changes.
You can now exit Registry Editor and then, proceed to change the ICS Service Startup mode to Automatic.]