1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-24 07:48:38 +00:00
This commit is contained in:
kev 2016-10-28 22:24:03 +08:00
parent 7ef0ee4e0f
commit e81047a200
4 changed files with 74 additions and 0 deletions

@ -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

22
hans/Dockerfile Normal file

@ -0,0 +1,22 @@
#
# Dockerfile for hans
#
FROM alpine
MAINTAINER kev <noreply@easypi.info>
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

43
hans/README.md Normal file

@ -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/

8
hans/docker-compose.yml Normal file

@ -0,0 +1,8 @@
hans:
image: vimagick/hans
environment:
- NETWORK=10.1.2.0
- PASSWORD=password
net: host
privileged: yes
restart: always