summaryrefslogtreecommitdiffstats
path: root/doc/README.SSH_VPN
blob: 0fb9af0b583c6939a604e37ab9282ef91dde86ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
You need to have enabled the following options in /etc/ssh/sshd_config (Server):

PermitTunnel yes
PermitRootLogin yes

Minimum requirement is OpenSSH 4.3 and ksshaskpass/ssh-askpass-gnome.

TUN and TAP modes are supported.

Network configuration can be made automaticlly (default) or by execution an specified script on server. If script is used the following parameters will be given:

Parameter 0: script name e.g. /root/ssh_vpn_up.sh
Parameter 1: device type  e.g. tun
Parameter 2: ip address  e.g. 1.2.3.4 (tun)
Parameter 3: remote ip address 1.2.3.5 (tun)

On automatic configuration tun0/tap0 will be used.

Example script on server:

###### /root/ssh_vpn_up.sh #####
#!/bin/bash

# $0 script name /root/ssh_vpn_up.sh
# $1 device type tun|tap
# $2 ip address 1.2.3.4 (tun)
# $3 remote ip address 1.2.3.5 (tun)

device="tun0"
ip=""
remote_ip=""
type="tun"

echo "type: $1"

if [ $# -gt 0 ]; then
        type="$1"
        if [ $# -gt 1 ]; then
                ip=$2
                if [ $# -gt 2 ]; then
                        remoteip=$3
                fi
        fi
fi

if [ "$type "="tun" ]; then
echo "tun!"
/sbin/ifconfig $device $ip pointopoint $remoteip up
fi

if [ "$type"="tap" ]; then
echo "tap!"
netmask="255.255.255.0"
ip="10.0.0.1"
device="tap0"
/sbin/ifconfig $device $ip netmask $netmask up
fi
############ END ##########