0

So, I set up my iptables rules on openvpn server (ubuntu) to allow ssh connections over /dev/tun0 with range of ip.

output of pinky from server with both clients connected:

jimic@ridingthewave-vpn:~$ pinky
Login    Name                 TTY      Idle   When             Where
jimic                         pts/0         2017-07-25 11:19 173.48.##.##
jimic                         pts/1    00:02  2017-07-25 11:17 10.8.0.10

When I log in from my phone over openvpn you see the bottom, which is what I want.

When I log in from my home pc, also ubuntu, you see the top, which means ssh connection is not being routed through vpn. Both have open vpn client running, and desktop runs everything else through vpn, but not ssh. For some reason the home computer talks to the server directly only for ssh.

Any idea's on how I can fix this? Since it works fine from the phone I am certain it is an issue with the client desktop. Thanks for any ideas.

Couple updates: ip route show on client machine gives:

0.0.0.0/1 via 10.8.0.5 dev tun0

default via 192.168.1.1 dev wls1 proto static metric 600

10.8.0.1 via 10.8.0.5 dev tun0

10.8.0.5 dev tun0 proto kernel scope link src 10.8.0.6

128.0.0.0/1 via 10.8.0.5 dev tun0

138.1##.7.4# via 192.168.1.1 dev wls1

169.254.0.0/16 dev wls1 scope link metric 1000

192.168.1.0/24 dev wls1 proto kernel scope link src 192.168.1.2

metric 600

I think:

vpn.ip.add.ress via 192.168.1.1 dev wls1

might be the problem, or it might be what makes openvpn work :)

Gonna have to learn more about route but any input about what that line does are appreciated.

Another update, running netstat -tupn on client has some interesting results:

Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

tcp 0 0 10.8.0.6:55708 216.58.219.227:443 ESTABLISHED 3579/chrome

tcp 0 0 10.8.0.6:55770 216.58.219.227:443 ESTABLISHED 3579/chrome

tcp 0 0 10.8.0.6:44892 151.101.193.69:443 ESTABLISHED 3579/chrome

tcp 0 0 10.8.0.6:36648 198.252.206.25:443 ESTABLISHED 3579/chrome

tcp 0 0 10.8.0.6:44678 216.58.219.238:443 ESTABLISHED 3579/chrome

tcp 0 0 127.0.1.1:139 127.0.0.1:58754 ESTABLISHED 19740/smbd

tcp 0 0 10.8.0.6:35248 172.217.3.106:443 ESTABLISHED 3579/chrome

tcp 28 0 127.0.0.1:58754 127.0.1.1:139 ESTABLISHED 19727/gvfsd-smb-bro

tcp 0 0 10.8.0.6:35256 172.217.3.106:443 ESTABLISHED 3579/chrome

tcp 0 123 192.168.1.2:52030 104.64.74.229:80 ESTABLISHED 18525/cinnamon

tcp 0 0 10.8.0.6:45554 216.58.219.234:443 ESTABLISHED 3579/chrome

tcp 0 0 192.168.1.2:34444 138.197.7.47:22 ESTABLISHED 3937/ssh

tcp 0 0 10.8.0.6:51430 209.85.232.188:5228 ESTABLISHED 3579/chrome

tcp 0 0 10.8.0.6:41824 216.58.219.237:443 ESTABLISHED 3579/chrome

tcp 0 0 10.8.0.6:45046 92.242.140.21:80 TIME_WAIT -

udp 0 0 10.8.0.6:45003 172.217.10.238:443 ESTABLISHED 3579/chrome

Some weird ones like:

tcp 0 0 192.168.1.2:34444 138.1##.7.47:22 ESTABLISHED 3937/ssh

tcp 0 123 192.168.1.2:52030 104.64.74.229:80 ESTABLISHED 18525/cinnamon

Also, when i try to access a website I set up with same iptables rules this appears on client(website is view able on phone)

tcp 0 1 192.168.1.2:36704 138.197.7.47:80 SYN_SENT 3579/chrome

Could this have anything to do with iptables server rule to accept ESTABLISHED connections? ANY input would be appreciated, usually i figure these little things out by now.

Kernel IP routing table Destination Gateway Genmask Flags Iface

0.0.0.0 10.8.0.5 128.0.0.0 UG tun0

0.0.0.0 192.168.1.1 0.0.0.0 UG wls1

10.8.0.1 10.8.0.5 255.255.255.255 UGH tun0

10.8.0.5 0.0.0.0 255.255.255.255 UH tun0

128.0.0.0 10.8.0.5 128.0.0.0 UG tun0

1#8.1#7.7.47 192.168.1.1 255.255.255.255 UGH wls1

16#.254.0.0 0.0.0.0 255.255.0.0 U wls1

192.168.1.0 0.0.0.0 255.255.255.0 U wls1

Sorry about the formatting, I am losing faith in this site but any ideas, even if they are wrong would be greatly appreciated.

  • Definitely a routing issue at the Ubuntu client. Looks like it's either not actually connected to the VPN, or that it's not the default gateway for outbound traffic. – Oli Jul 25 '17 at 12:38
  • traceroute shows client going through vpn, and so does chrome when i ask it for external ip it shows that of VPN machine. – jimicloudstuff Jul 26 '17 at 12:02

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.