#!/bin/bash modprobe tun #killall dhclient iptables -I INPUT 1 -i tun0 -j ACCEPT NS=`grep nameserver /etc/resolv.conf |head -1|awk '{print $2}'` GW=`route -n | grep "^0.0.0.0" | awk '{ print $2 }'` /etc/init.d/nstxcd start ifconfig tun0 mtu 500 route del default route add $NS gw $GW route add -net default gw 192.168.249.1