Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Feb 1996 01:48:05 -0800 (PST)
From:      Donald Burr <d_burr@ix.netcom.com>
To:        Binh Do <binhdo@binhdo.home.cs.ubc.ca>
Cc:        questions@freebsd.org
Subject:   Re: How to disconnect phone in "on-demand" mode
Message-ID:  <Pine.BSF.3.91.960207013509.741A-101000@starfleet.gov>
In-Reply-To: <199602070510.VAA00251@binhdo.home.cs.ubc.ca>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Tue, 6 Feb 1996, Binh Do wrote:

> At last it seems that I can dial to my ISP on demand. Now one problem arises.
> If I want to just cjeck mail and right after that I want to disconnect 
> and use phone. How should I do it gracefully (i.e. not just pick up the phone
> without doing anything with FreeBSD).
> 
> Cheers,

There are two ways to do this.  One way is to set the "timeout" value 
really low, like 10 or 5 (disconnects after 10 or 5 seconds 
(respectively) of inactivity).  This is fine for when you just want to 
read mail and disconnect, but may get in your way if you're trying to do 
some "real" work, such as ftp or other internet stuff.

There is another way, whcih I use and like... but you may not...

I wrote a couple of shell scripts to toy with PPP, tell it to turn off 
and turn on and etc.  I create logins in /etc/passwd with no password, 
called "ppp-off" and "ppp-on", so when I want to deactivate ppp, all I 
have to do is switch to an empty VC and type "ppp-off".  They can also be 
run directly from a shell prompt (you must be root).

Attached is a copy of my scripts.  Here are some notes concerning them, 
since my system is probably different than yours and some tailoring will 
be required.

1)	I run a name server.  When I have PPP turned on, I want the name
	server to be able to answer queries for any host on the Internet,
	which requires a valid root nameserver cache file with all of the
	main Internet name servers on it.  When PPP is OFF, I still want
	the name server to be able to answer queries for my own "fake"
	domain, since I have several machines around the house that depend
	on a name server being available, and I don't want them to act
	funny when PPP is off.  So when PPP is off, I install a small
	"fake" root server cache file, that refers all queries back to my
	own name server.  Sorta kludgy, but it works.

2)	If you don't run named, or want to handle it differently, you WILL
	need to edit the /usr/local/sbin/ppp-{off,on} scripts and change the
	named handling stuff.  It's pretty clearly set apart from the rest
	of the scripts, and shouldn't be that hard to manage.

3)	My auto-dialing ppp site is called "netcomd".  Change it to the
	name of your auto-dialing ppp site in the /etc/ppp/ppp.conf file.

4)	My remote PPP server's IP address is 163.179.78.2.  It needs a
	"default" route set to it.  My ppp-on script takes care of this.
	You will have to change this to the default route you need to use.

5)	You can use these shell scripts from a (root) shell prompt, or via
	commands such as sudo, etc.  Or you can add "fake" logins to the
	/etc/passwd file so that you can control PPP from any VC with a
	login prompt.  Use vipw and add the following:

ppp::0:0::0:0:PPP Control login:/:/usr/local/sbin/pppsh
ppp-off::0:0::0:0:Turn PPP off:/:/usr/local/sbin/ppp-off
ppp-on::0:0::0:0:Turn PPP on:/:/usr/local/sbin/ppp-on

	I know, I know, this is in bad form, and is bad for security, etc.
	Since I am a single-user machine at home, security really doesn't
	matter to me.  If you are on a network, you might not want to take
	this approach, or you may want to set passwords on the ppp-* logins.

6)	The "ppp" login and /usr/local/sbin/pppsh command is a easy way to
	control or query a running ppp daemon.  All it does is runs telnet
	to localhost port 3000, but "pppsh" is admittedly easier to type than
	"telnet localhost 3000"

Enjoy...

Donald Burr [d_burr@ix.netcom.com], PO Box 91212, Santa Barbara CA 93190-1212
TEL (805)564-1871 / FAX 564-2315 / WWW http://www.geopages.com/WallStreet/2072
PGP Public Key available by request (send e-mail) or on Public Key Servers.
** Uphold your right to privacy - Use PGP. **

[-- Attachment #2 --]
[r۸_)Psh,%]qZ&NNwznU,T<4w?ul˹'f6D'PEa׈N]1N`8|QRj6	)Jf(%bO@,rE<	 G>7={ڠyqX.|>%m1Г$C7Ch0?q
9_)s_8v.v.q#2}scP+I_]ϛP
Qz&>j	QƣGu0ḳ_!xk6s
EzҳZ.U#@g
ڛ):K
2ߞp	!_v3;l3!u$@ҊB3aGpD$(5hy<F|'g,B	&Ve	J'6{E</jzG:f^=NZG\A>-4Bq0KC違Ьo]ike5Ŏ`XڠzPO2ƅ-b@CZɂ$,- 8q(lh(vGx,YSCb6H\vF5uZ;fڪ_c7b{|كu~~lJ	,eV4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