summaryrefslogtreecommitdiffstats
path: root/crypto/kerberosIV/appl/kip/kipd-control.in
blob: 8fb0e9bb0b83596ea9d6a462255f90b6be02b548 (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
#!/bin/sh
#
# $Id$
#
# Simple example how you can missuse kip to provide "mobile-ip".
# This is since there is no way to tunnel ip over udp or any other
# protocol. There is also problems to get thru firewalls and NATs
# with mobile-ip since (today) they usully doesn't support IPIP or
# GRE.
#
# All commands are for linux (redhat6.1) but it should be quite 
# simple to fix it to support other OS.
#

PATH=/sbin:/usr/sbin:/usr/bin:/bin

# arguments are: [up|down] dev remote-peer-addr user

state=$1
dev=$2
remote=$3
user=$4

outdevice=eth0

case "$state" in
    up)
        case "$user" in
            lha.root@E.KTH.SE)
                ifconfig $dev 10.0.0.1 pointopoint 130.237.43.17
                route add -host 130.237.43.17 gw 10.0.0.1
                arp -H ether -i $outdevice \
                    -s 130.237.43.17 00:80:c8:82:83:61 pub
            ;;
        esac
        ;;
    down)
        case "$user" in
            lha.root@E.KTH.SE)
                ifconfig $dev 0.0.0.0
                ifconfig $dev down
                arp -i $outdevice -d 130.237.43.17
                arp -d 130.237.43.17
                true
            ;;
        *)
            ifconfig $dev down
            ;;
        esac
        ;;
    *)
        exit 17
        ;;
esac
OpenPOWER on IntegriCloud