2
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2026-01-04 20:14:56 +01: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
could call it a ping tunnel.
## How It Works
```
Client ---> G.F.W ---> Server ---> Internet
tun0 ping tun0
```
## docker-compose.yml
```yaml
hans:
server:
image: vimagick/hans
environment:
- NETWORK=10.1.2.0
@@ -15,13 +22,22 @@ hans:
net: host
privileged: yes
restart: always
client:
image: easypi/hans-arm
environment:
- SERVER=1.2.3.4
- PASSWORD=password
net: host
privileged: yes
restart: always
```
## Server Setup
```bash
# Start Server Program
$ docker-compose up -d
# Start Server Container
$ docker-compose up -d server
# Enable Masquerade (Method A)
$ 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
```bash
# Start Client Program
$ hans -f -c 1.2.3.4 -p password
# Start Client Container
$ docker-compose up -d client
# Access Server Directly
$ ip route add 1.2.3.4 via 192.168.1.1