rc.tunnel.
#!/bin/sh
# Read the config file.
. /etc/rc.d/axdefs
case "$1" in
up)
MODIPIP=`${SDIR}/lsmod | grep ipip | head -n1 | awk '{ print $1 }'`
if [ "$MODIPIP" = "ipip" ]; then
echo "Module ipip already loaded..."
else
${SDIR}/modprobe ipip
fi
UP=`ifconfig tunl0 | grep RUNNING | awk '{ print $2 }'`
if [ "$UP" = "RUNNING" ]; then
echo "Interface tunl0 is already up and running..."
else
${SDIR}/ifconfig tunl0 44.137.28.48 netmask 255.255.255.255 mtu 512 up
${SDIR}/ip route add 44.135.34.201 via 209.87.203.183 dev tunl0 proto static onlink
${SDIR}/ip route add 44.135.34/24 via 209.87.203.183 dev tunl0 proto static onlink
# ${SDIR}/ip route add 44.137.28.80 via 145.19.22.82 dev tunl0 proto static onlink
${SDIR}/ip route add 44.137.28.81 via 145.19.1.81 dev tunl0 proto static onlink
# Untill pi1goe is working again send all 44 packets to gw.pe9ghz
# ${SDIR}/route add -net 44.137.0.0 gw 44.137.28.27 netmask 255.255.0.0 scc3
${SDIR}/ip route add 44/8 via 145.19.1.81 dev tunl0 proto static onlink
fi
;;
down)
UP=`ifconfig tunl0 | grep RUNNING | awk '{ print $2 }'`
if [ "$UP" = "RUNNING" ]; then
${SDIR}/ifconfig tunl0 down
rmmod ipip
${SDIR}/route add -net 44.0.0.0 netmask 255.0.0.0 gw 44.137.28.27 scc3
else
echo "Interface tunl0 is already down..."
fi
;;
*)
echo "USAGE: rc.tunnel up|down"
esac
exit 0
## Examples are;
# ${SDIR}/ifconfig tunl0 44.178.16.1 netmask 255.255.255.255 mtu 1024 up
# ${SDIR}/ip route add 44/8 via 194.87.1.92 dev tunl0 proto static onlink
Back to ax25-description page.