2

I have a pptp VPN server set up on my Raspberry Pi at home, and it works really well, except when I'm stuck behind my college's firewall. I can SSH into it through commonly open firewall ports (443, 8080), but I was wondering if I could do the same with VPN.

The way I see it is it should work, since there are 4 ports that I know of open that I can SSH to my Raspberry Pi through (Not port 22 however!), but VPN just won't work. I have tried tinkering for the last two hours, but no luck. Has anyone done something like this before?

4
  • 1
    what have you tried so far (please include in your question)? i assume you've tried ssh tunneling and vpn from there?
    – h3rrmiller
    Jan 10, 2013 at 14:51
  • 1
    I have tried commands like this on my local machine (my mac): ssh -N -p 443 [email protected] -L 1723/localhost/8080. I wasn't sure but I figured this would take direct my VPN connection attempts from 1723 to 8080. I also had the 'local IP' in my ssh prefs on my Raspberry Pi set to 10.0.1.3 8080 Jan 10, 2013 at 14:55
  • 2
    you need to use the -w to specify a tunnel interface instead of creating a forward tunnel. take a look at wiki.archlinux.org/index.php/VPN_over_SSH also take a look at github.com/apenwarr/sshuttle
    – h3rrmiller
    Jan 10, 2013 at 15:02
  • Thanks, I have been using sshuttle for the time being, I just wanted to be able to flick the VPN switch and have it turn on as if it weren't behind a firewall at all Jan 11, 2013 at 0:23

2 Answers 2

2

You can use -w key with ssh. An example:

# ssh root@ssh-server -w 0:0 "/sbin/ifconfig tun0 192.168.100.1/24 pointopoint 192.168.100.2"
# ifconfig tun0 192.168.100.2/24 pointopoint 192.168.100.1
# route add -host ssh-server dev eth0
# route del default
# route add default gw 192.168.100.1

But you need connect with root privileges to your ssh-server and tune iptables for NATing your traffic. Don't forget to turn on PermitTunnel point-to-point in your /etc/ssh/sshd_config onto ssh-server

0

pptp is limited to port 1194 i had a similar problem not so long time ago. You can use another VPN technology than pptp. Look that :

In .ssh/config :

host raspberrypi.machine
hostname Your_Ip
localforward 1194 Your_Ip:1194

then ssh to raspberrypi.machine

Connect your pptp client to localhost 1194 and it should work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .