IP over ICMP with Hans

Server Side

  1. Download, extract, and compile Hans http://code.gerade.org/hans/
    tar -xzf hans-version.tar.gz
    cd hans-version
    make
  2. Run as root
    ./hans -s 10.1.2.0 -p password
  3. Enable IPv4 forwarding
    echo 1 > /proc/sys/net/ipv4/ip_forward
  4. Edit /etc/sysconfg/iptables

    -A FORWARD -i tun0 -o eth0 -m state –state NEW,ESTABLISHED,RELATED -j ACCEPT
    -A FORWARD -i eth0 -o tun0 -m state –state ESTABLISHED,RELATED -j ACCEPT
    service iptables restart

  5. Run as root to forward traffic
    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Client Side

  1. Download and extract Hans http://code.gerade.org/hans/
    (For Linux, compile with make, for mac just download and extract)
  2. (macOS only) Download and install TUNTAP http://tuntaposx.sourceforge.net/
  3. Run as root

    (normal)  ./hans -c server_ip -p password
    (verbose) ./hans -fv -c server_ip -p password

  4. Set routing table (Linux)
    route add -host server_ip gw router_gateway_ip
    route add default gw 10.1.2.1
    route del default gw router_gateway_ip
  5. Set routing table (macOS)

    sudo route add -host server_ip router_gateway_ip
    sudo route delete default router_gateway_ip
    sudo route add default 10.1.2.1

Reference:
http://code.gerade.org/hans/
http://zhiwei.li/text/2012/11/30/ip-over-icmp/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s