From owner-freebsd-questions Mon Mar 4 20:10: 7 2002 Delivered-To: freebsd-questions@freebsd.org Received: from pintail.mail.pas.earthlink.net (pintail.mail.pas.earthlink.net [207.217.120.122]) by hub.freebsd.org (Postfix) with ESMTP id 1CE1837B416 for ; Mon, 4 Mar 2002 20:10:02 -0800 (PST) Received: from user-119aekg.biz.mindspring.com ([66.149.58.144] helo=motil) by pintail.mail.pas.earthlink.net with smtp (Exim 3.33 #1) id 16i6Gz-0004Vn-00 for freebsd-questions@freebsd.org; Mon, 04 Mar 2002 20:09:58 -0800 Message-ID: <018001c1c414$ebad2eb0$7d00a8c0@motil> From: "barazani" To: Subject: Fw: how to remove/delete tun0 ? Date: Mon, 4 Mar 2002 23:11:04 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Ok , eric this seems to work . here's the reasons to my question. I have a dsl connection at home ,i'm trying to achive maximum uptime BUT my dsl connection keeps dropping for no aparant reason . I have spoken to earthlink's support and there isn't any obvious problem . I know it's not my box !!! anyway , i wrote a little script that runs every 5 minutes and pings my default gateway . if it odes not get an naswer it kills ppp and restarts it . like so: -------------------------------- #! /bin/sh ping -c 3 `netstat -rn |grep default |awk '{print $2}'` > /dev/null 2>&1 STAT="$?" echo "`date +%d-%m-%Y/%H:%M` - $STAT" >> /var/log/ppp_alive.log if [ "$STAT" != 0 ] ;then sleep 10 ping -c 3 `netstat -rn |grep default |awk '{print $2}'` if [ "$STAT" != 0 ] ;then echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++">>/var/log/ppp_aliv e.err echo "ppp pid is `ps -auxw |grep ppp` >> /var/log/ppp_alive.err echo "`date +%d-%m-%Y/%H:%M` - $STAT" >> /var/log/ppp_alive.err tail -50 /var/log/ppp.log >> /var/log/ppp_alive.err echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++">>/var/log/ppp_aliv e.err ifconfig tun0 ip.add.re.ss delete #new addition thanks ,eric killall ppp sleep 20 /usr/sbin/ppp -quiet -auto elink ifconfig |mail -s "ppp restarted" bara_zani@yahoo.com fi fi the script works well but sometimes when i restart ppp it opens another tun device tun1 and it uses that as the pppoe interface ( which screws up my ipf rules - which are all tun0 ....) so i'm hoping the ifconfig ip.add.re.ss will do the trick and i'll only have one device . if anyone can think of a better way or has some improvements /suggestions as to my problem , i will be more than happy to give it a try thanks barazani > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message