#!/bin/sh
if [ -z "$EUID" -a -x /usr/bin/id ]; then
EUID=`id -u`
fi
if [ "$EUID" = "0" ]; then
/sbin/ifconfig tap0 > /dev/null 2>&1
if [ "$?" = "0" ]; then
ifconfig tap0 169.254.1.1 netmask 255.255.255.0 up
else
# *** If create tap device with openvpn, then it will be failed while
# pinging tap0 from VIRTUAL ROUTER, I don't know why, but tunctl
# works fine. ***
#
# openvpn --mktun --dev tap0
tunctl -u wandering -t tap0
ifconfig tap0 169.254.1.1 netmask 255.255.255.0 up
fi
cd /tmp/Dynamips
ps aux | grep 'dynamips -H' | awk '{print }' | xargs kill
dynamips -H 7200 &
dynamips -H 7201 &
dynamips -H 7202 &
dynamips -H 7203 &
else
echo
echo "*** Permission denied, please run this as root! ***"
echo
exit 1
fi
阅读(470) | 评论(0) | 转发(0) |