Tunneling over ICMP

August 28th, 2012 | Categories: Linux, Networking, Technology

I’ve been wanting to write about this for a bit. I usually VPN (to the gateway at home) for surfing when roaming. This also gives me access to my shellbox and with my ssh key. You can usually connect to port 443 (https) on most networks, even those that force you to use a socks or HTTP proxy.

However sometimes this is not possible. But if you are lucky you can still use ping and icmp. A simple check would be see if you can ping a server.

If you can ping your server, you can use it as a proxy. Throughput will be limited. But it’s better than nothing!

I’m doing this on CentOS and luckily RPMForge carries the ptunnel package. Installing was easy. Alternatively you can get the source here.

Below is how to install and start the server side, you could wrap this in an init script but I choose not to do so.

tokyo ~ # yum install ptunnel
tokyo ~ # ptunnel -x secretkeyhere -c eth0

You only need the -c if you have multiple interfaces.

Connecting with a client is easy too!

axion ~ # ptunnel -x secretkeyhere -p tokyo -lp 8000 -da nara -dp 22 -c eth0
axion ~ # ssh -p 8000

In the example above ssh will connect to nara on port 22 using tokyo as a proxy.

Of course you can use it to forward other ports. However, combine ssh with the dynamic port forwarding makes it very easy to get internet access.

Enjoy! And only use it for good 😉

  1. john
    July 6th, 2014 at 12:49
    Quote | #1

    what about windows?

    • July 6th, 2014 at 12:52
      Quote | #2

      I have not tried this on windows. I do not know of a windows binary for ptunnel.

Comments are closed.