1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-04-17 11:56:28 +02:00

add hans-arm

This commit is contained in:
kev 2016-10-29 01:05:25 +08:00
parent 75d9f88d97
commit dfc0f2ba3b
4 changed files with 52 additions and 6 deletions

View File

@ -4,10 +4,17 @@ hans
[Hans][1] makes it possible to tunnel IPv4 through ICMP echo packets, so you [Hans][1] makes it possible to tunnel IPv4 through ICMP echo packets, so you
could call it a ping tunnel. could call it a ping tunnel.
## How It Works
```
Client ---> G.F.W ---> Server ---> Internet
tun0 ping tun0
```
## docker-compose.yml ## docker-compose.yml
```yaml ```yaml
hans: server:
image: vimagick/hans image: vimagick/hans
environment: environment:
- NETWORK=10.1.2.0 - NETWORK=10.1.2.0
@ -15,13 +22,22 @@ hans:
net: host net: host
privileged: yes privileged: yes
restart: always restart: always
client:
image: easypi/hans-arm
environment:
- SERVER=1.2.3.4
- PASSWORD=password
net: host
privileged: yes
restart: always
``` ```
## Server Setup ## Server Setup
```bash ```bash
# Start Server Program # Start Server Container
$ docker-compose up -d $ docker-compose up -d server
# Enable Masquerade (Method A) # Enable Masquerade (Method A)
$ iptables -t nat -A POSTROUTING -s 10.1.2.0/24 -o eth0 -j MASQUERADE $ iptables -t nat -A POSTROUTING -s 10.1.2.0/24 -o eth0 -j MASQUERADE
@ -33,8 +49,8 @@ $ firewall-cmd --add-masquerade
## Client Setup ## Client Setup
```bash ```bash
# Start Client Program # Start Client Container
$ hans -f -c 1.2.3.4 -p password $ docker-compose up -d client
# Access Server Directly # Access Server Directly
$ ip route add 1.2.3.4 via 192.168.1.1 $ ip route add 1.2.3.4 via 192.168.1.1

22
hans/arm/Dockerfile Normal file
View File

@ -0,0 +1,22 @@
#
# Dockerfile for hans-arm
#
FROM easypi/alpine-arm
MAINTAINER EasyPi Software Foundation
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 SERVER 1.2.3.4
ENV PASSWORD password
CMD hans -f -c $SERVER -p $PASSWORD

View File

@ -0,0 +1,8 @@
hans:
image: easypi/hans-arm
environment:
- SERVER=1.2.3.4
- PASSWORD=password
net: host
privileged: yes
restart: always

View File

@ -1,4 +1,4 @@
# /etc/default/hans # /etc/default/hans
GATEWAY=192.168.31.1 GATEWAY=192.168.1.1
SERVER=1.2.3.4 SERVER=1.2.3.4
PASSWORD=password PASSWORD=password