I have remote server(ubuntu server). I access remote server by ssh as ssh root@IP_OF_SERVER, then I have setup a webapp running in server and access it by IP_OF_SERVER:80. Every thing is working fine. Now I want to access server only over VPN means ssh over vpn connection. Here is my setup

local system <----> Mikrotik router <---------internet-------> remote server(ubuntu)

I have installed IPSEC_L2TP_vpn_with_Ubuntu_12.04 in remote server.

In mikrotik router I have setup L2TP client now I can able to connect to VPN server of ubuntu from Mikrotik router. I can also able to ping remote server, but I can't do ssh to remote server when VPN is connected and also can't get webapp(IP_OF_SERVER:80) in my local system. what would be the problem? Outside VPN, remote server is accessible over ssh but not inside VPN. My local system is have ubuntu desktop.

Update: After mikrotik router connected to VPN server of Remote server. Result of telnet:

niren@slash:~$ telnet SERVER_IP 443
Trying SERVER_IP...
Connected to SERVER_IP.
Escape character is '^]'.

niren@slash:~$ telnet SERVER_IP 22
Trying SERVER_IP...
telnet: Unable to connect to remote host: Connection refused

niren@slash:~$ telnet SERVER_IP 80
Trying SERVER_IP...
telnet: Unable to connect to remote host: Connection refused

Result of PING:

niren@slash:~$ ping SERVER_IP
PING SERVER_IP (SERVER_IP) 56(84) bytes of data.
64 bytes from SERVER_IP: icmp_seq=1 ttl=64 time=0.389 ms
64 bytes from SERVER_IP: icmp_seq=2 ttl=64 time=0.280 ms
64 bytes from SERVER_IP: icmp_seq=3 ttl=64 time=0.246 ms

Result of SSH:

niren@slash:~$ ssh root@SERVER_IP
ssh: connect to host SERVER_IP port 22: Connection refused
  • firewall maybe? – masegaloeh May 16 '14 at 18:25
  • I turned off firewall and tried but no luck – niren May 16 '14 at 18:25

Make sure you have OPENSSH installed on both machines for SSHing. Use sudo apt-get install openssh-server for the one you want to SSH into and sudo apt-get install openssh-client for the one you want to SSH from.

  • OP stated that he has working SSH connection before VPN implemented. – masegaloeh May 17 '14 at 6:46
  • Oh, I apologize. I got a bit confused by his wording. Someone please remove my answer then. – LoganR May 17 '14 at 15:02

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.