| Linode Forum https://forum.linode.com/ |
|
| Setup OpenVPN server https://forum.linode.com/viewtopic.php?f=19&t=11779 |
Page 2 of 3 |
| Author: | Webkungen [ Tue Apr 28, 2015 8:02 am ] |
| Post subject: | Re: Setup OpenVPN server |
Now I tried to copy/paste your server config exactly, but I added the values for: Code: dh I'm connected, but still with gateway 192.168.255.5 and DCHP 192.168.255.5 instead of 192.168.255.1 Can't figure out what's going on, or how I can fix this. Have googled for hours reading threads from people with different issues but doesn't matter what I try, the problem persits. |
|
| Author: | obs [ Tue Apr 28, 2015 11:14 am ] |
| Post subject: | Re: Setup OpenVPN server |
192.168.255.5 is the correct gateway that's how openvpn works, you'll see 192.168.255.6 as your IP. You should get your servers IP if you connect to an external site. |
|
| Author: | sweh [ Tue Apr 28, 2015 11:20 am ] |
| Post subject: | Re: Setup OpenVPN server |
obs wrote: You should get your servers IP if you connect to an external site. Don't you need to set up IP Masquerading for that to work? |
|
| Author: | Webkungen [ Tue Apr 28, 2015 6:16 pm ] |
| Post subject: | Re: Setup OpenVPN server |
I have setup "dnsmasq" or what it was called, and nope, sorry, still not working. Do I have to bridge the ethernet adapters or something like that? Was thinking, could it possibly be a limitation in my modem/isp? I've got a pocket Wifi (3g) LTE Modem. I still don't understand why I cannot ping the DNS or Gateway (192.168.255.5) I'm getting, what is the reason for that? |
|
| Author: | obs [ Wed Apr 29, 2015 4:57 am ] |
| Post subject: | Re: Setup OpenVPN server |
sweh wrote: obs wrote: You should get your servers IP if you connect to an external site. Don't you need to set up IP Masquerading for that to work? Possibly, I don't on my server but it could be the OPs firewall killing it or something else specific to their server or even their ISP. I run openvpn from docker so all I have is ip forwarding enabled in the kernel, and iptables forwarding ovpn requests to the docker instance, it just works out of the box for me. |
|
| Author: | Webkungen [ Wed Apr 29, 2015 5:20 am ] |
| Post subject: | Re: Setup OpenVPN server |
So how do I look my iptables settings for these openVPN clients traffic? |
|
| Author: | kangaby [ Wed Apr 29, 2015 11:06 pm ] |
| Post subject: | Re: Setup OpenVPN server |
Webkungen wrote: Good morning Note that in the image above, I also enabled push "redirect-gateway" in the config (which is different from your config) but when I comment it out, the only difference is that "Default gateway" is blank when connected to the server. I read in one of the online guides, you need to put the redirect-gateway in the client config file, as putting it in the server config file didn't work properly. This may or may not help: http://marguspala.com/simple-way-to-rou ... h-openvpn/ “redirect-gateway def1″ changes client routing table so that all traffic is directed via server. Without it only traffic sent to servers ip 10.66.77.1 will be sent there. Most materials in web recommend to add to server config push “redirect-gateway def1″ but this is not working in some cases so better add this config directly to client |
|
| Author: | Webkungen [ Thu Apr 30, 2015 3:32 am ] |
| Post subject: | Re: Setup OpenVPN server |
Still not getting gateway correct, have the push directive in server config, and redirect-gateway in the client config. But I can telnet the smtp server with the local IP, which is good. Code: #:/etc/openvpn# ifconfig tun0 My server is configured with local IP as well, is there a way to use those ip addresses for the VPN as well, i.e. so I will be able to reach the other debian boxes in the local network? Code: eth0:0 Link encap:Ethernet HWaddr f2:3c:91:df:58:af |
|
| Author: | Webkungen [ Thu Apr 30, 2015 8:57 pm ] |
| Post subject: | Re: Setup OpenVPN server |
The OpenVPN log for the client looks like this when connecting: Code: Fri May 01 08:45:44 2015 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS 8.8.4.4,dhcp-option DNS 8.8.8.8,route 192.168.255.1,topology net30,ping 10,ping-restart 60,ifconfig 192.168.255.6 192.168.255.5' This looks like an error, but what does it mean? Code: Fri May 01 08:45:49 2015 C:\WINDOWS\system32\route.exe ADD 178.79.135.11 MASK 255.255.255.255 192.168.0.1 Can the problem had to do with my local ips? From my modem I'm getting 192.168.0.x in my local network, and on the vpn server there is also a local ip setup, using 192.168.192.x |
|
| Author: | kangaby [ Thu Apr 30, 2015 10:41 pm ] |
| Post subject: | Re: Setup OpenVPN server |
This might be un-related. On my Linode I had Debian 7, with openvpn, and I could send traffic up the VPN and out to the world. Checking whatsmyip, my traffic was originating from my Linode. I upgraded to Debian 8 this week, to get openvpn with IP6, but with my original configs, I can't get to the outside world anymore, and yes, I have set IP forwarding in the kernel. So are you by chance running Debian 8. If so I don't have an answer. Also you need to have redirect-gateway without the def1 to get the default gateway to be set for the vpn. Well at least I did, and it was also mentioned at one other tutorial site. Problem is so much has changed, and most of the tutorials appear out of date, compared to how you had to do things, and how you now have to do things. In the log above, you have: Code: Warning: route gateway is ambiguous: 192.168.0.1 (2 matches)this could be bad, maybe. |
|
| Author: | Webkungen [ Fri May 01, 2015 1:14 am ] |
| Post subject: | Re: Setup OpenVPN server |
I removed "def1" now from both server and client config. When I connect to the VPN, I'm unable to browse any website at all. However, I can ping and telnet services on the local network (VPN server). Trying to trace Google.com: Code: # tracert google.com As you see I never come outside the network on the server. Same result with firewall (csf) disabled. My guess is that there MUST BE some kind of server config betwen the network interfaces (bridging or similar?) I'm missing? |
|
| Author: | kangaby [ Fri May 01, 2015 6:09 am ] |
| Post subject: | Re: Setup OpenVPN server |
Well I've got my problem sorted out - I hadn't done the iptables bit at the bottom. Also you can have def1 in the client side, and existing connections (ssh) will be maintained when the VPN comes up. On the Server: Code: # Set your server IP address here On the client: Code: client Turn on IP forwarding on the server: Code: echo 1 > /proc/sys/net/ipv4/ip_forward Now, back to that pesky IP6 part. |
|
| Author: | kangaby [ Fri May 01, 2015 6:17 am ] |
| Post subject: | Re: Setup OpenVPN server |
With the VPN up - here is the server ip addr: Code: 18: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100 and the client ipconfig /all (trimmed) Code: Ethernet adapter Windows TAP Adapter: Note there is no default gateway, but whatismyip returns my servers ip address, not my ISP's. Removing the def1 from the client config sets this. Code: Ethernet adapter Windows TAP Adapter: |
|
| Author: | Webkungen [ Fri May 01, 2015 11:09 pm ] |
| Post subject: | Re: Setup OpenVPN server |
Not getting this... I tried to copy your config exactly except the ca, cert and key (and changed local as well). Still same issue.. I can connect, I can ping the vpn server etc. but cannot browse internet at all. No matter what I do, I'm getting ERR_CONNECTION_TIMED_OUT. Tried to disable both csf and my anti-virus/firewall software (ESET). |
|
| Author: | kangaby [ Sat May 02, 2015 12:09 am ] |
| Post subject: | Re: Setup OpenVPN server |
Is eth0 on a public IP address and not a private IP address? If it's on a private 192, 172, 10 it will be dropped by your servers upstream routers. Also if you are trying to connect other servers / computes on the private IP address subnet of the VPN, you need to look into the client-to-client server config option and associated magic with ccd files that is required to make this work. I can't help you with that as I don't use it or need it. |
|
| Page 2 of 3 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|