jedisct1 / dsvpn

A Dead Simple VPN.
MIT License
5.16k stars 393 forks source link

Wired connection is connecting to VPS, but unable to get outside. #70

Closed ghost closed 4 years ago

ghost commented 4 years ago

I have set up a VPS with DSVPN running as server. I can connect with our wired no problem, but I am not getting out from VPS. If I switch to my 4G-connection through my phone with wifi, I can connect and get internet just fine with DSVPN.

I will paste some information I think is relevant. If someone spots something, or need more information, let me know and I will paste more. Please and thank you.

Wired connection without VPN:

➜  ~ ifconfig
enp0s25: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.111.0.85  netmask 255.255.0.0  broadcast 10.111.255.255
        inet6 fe80::9f6:3b4:49dc:47e0  prefixlen 64  scopeid 0x20<link>
        ether 34:e6:d7:50:52:27  txqueuelen 1000  (Ethernet)
        RX packets 285  bytes 83017 (83.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 93  bytes 23727 (23.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xe2e00000-e2e20000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 178  bytes 13978 (13.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 178  bytes 13978 (13.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

➜  ~ ip r
default via 10.111.0.1 dev enp0s25 proto dhcp metric 100 
10.111.0.0/16 dev enp0s25 proto kernel scope link src 10.111.0.85 metric 100 
169.254.0.0/16 dev enp0s25 scope link metric 1000 

➜  ~ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.111.0.1      0.0.0.0         UG    100    0        0 enp0s25
10.111.0.0      0.0.0.0         255.255.0.0     U     100    0        0 enp0s25
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 enp0s25

Wired connection with VPN:


➜  ~ ifconfig
enp0s25: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.111.0.85  netmask 255.255.0.0  broadcast 10.111.255.255
        inet6 fe80::9f6:3b4:49dc:47e0  prefixlen 64  scopeid 0x20<link>
        ether 34:e6:d7:50:52:27  txqueuelen 1000  (Ethernet)
        RX packets 59693  bytes 12117992 (12.1 MB)
        RX errors 0  dropped 481  overruns 0  frame 0
        TX packets 7546  bytes 1530621 (1.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xe2e00000-e2e20000

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 12057  bytes 1102304 (1.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12057  bytes 1102304 (1.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 9000
        inet 192.168.192.1  netmask 255.255.255.255  destination 192.168.192.254
        inet6 64:ff9b::c0a8:c001  prefixlen 96  scopeid 0x0<global>
        inet6 fe80::8b89:cd0d:b297:bfeb  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 500  (UNSPEC)
        RX packets 1  bytes 48 (48.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 149  bytes 23164 (23.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

➜  ~ ip r
default via 10.111.0.1 dev enp0s25 proto dhcp metric 100
10.111.0.0/16 dev enp0s25 proto kernel scope link src 10.111.0.85 metric 100
169.254.0.0/16 dev enp0s25 scope link metric 1000
192.168.192.254 dev tun0 proto kernel scope link src 192.168.192.1 

➜  ~ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.111.0.1      0.0.0.0         UG    100    0        0 enp0s25
10.111.0.0      0.0.0.0         255.255.0.0     U     100    0        0 enp0s25
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 enp0s25
192.168.192.254 0.0.0.0         255.255.255.255 UH    0      0        0 tun0
ghost commented 4 years ago

Found the problem! It was an issue with DNS resolving. The wired connection had a local DNS-resolver. Changed into a public one and everything works!

jedisct1 commented 4 years ago

Awesome, thanks for the update!