diff --git a/README.md b/README.md index 731b886..03d1f60 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,7 @@ A collection of delicious docker recipes. - [x] delegated - [x] fteproxy :+1: - [x] fteproxy-arm :+1: +- [x] hans - [x] haproxy-arm - [x] kcptun :cn: - [x] mysql-proxy diff --git a/hans/Dockerfile b/hans/Dockerfile new file mode 100644 index 0000000..c97d219 --- /dev/null +++ b/hans/Dockerfile @@ -0,0 +1,22 @@ +# +# Dockerfile for hans +# + +FROM alpine +MAINTAINER kev + +RUN set -xe \ + && apk add --no-cache build-base curl libstdc++ linux-headers tar \ + && mkdir hans \ + && cd hans \ + && curl -sSL https://github.com/friedrich/hans/archive/v0.4.4.tar.gz | tar xz --strip 1 \ + && make \ + && mv hans /usr/bin/hans \ + && cd .. \ + && rm -rf hans \ + && apk del build-base curl linux-headers tar + +ENV NETWORK 10.1.2.0 +ENV PASSWORD password + +CMD hans -f -s $NETWORK -p $PASSWORD diff --git a/hans/README.md b/hans/README.md new file mode 100644 index 0000000..a7bb28c --- /dev/null +++ b/hans/README.md @@ -0,0 +1,43 @@ +hans +==== + +[Hans][1] makes it possible to tunnel IPv4 through ICMP echo packets, so you +could call it a ping tunnel. + +## docker-compose.yml + +```yaml +hans: + image: vimagick/hans + environment: + - NETWORK=10.1.2.0 + - PASSWORD=password + net: host + privileged: yes + restart: always +``` + +## Server Setup + +```bash +$ docker-compose up -d +``` + +## Client Setup + +```bash +# Run Client Program +$ hans -f -c 1.2.3.4 -p password + +# Access Server Directly +$ ip route add 1.2.3.4 via 192.168.1.1 + +# Change Default Route (Method A) +$ ip route change default via 10.1.2.1 + +# Change Default Route (Method B) +$ ip route add 0.0.0.0/1 dev tun0 +$ ip route add 128.0.0.0/1 dev tun0 +``` + +[1]: http://code.gerade.org/hans/ diff --git a/hans/docker-compose.yml b/hans/docker-compose.yml new file mode 100644 index 0000000..5618a63 --- /dev/null +++ b/hans/docker-compose.yml @@ -0,0 +1,8 @@ +hans: + image: vimagick/hans + environment: + - NETWORK=10.1.2.0 + - PASSWORD=password + net: host + privileged: yes + restart: always